Return-Path: <tiff-bounces@remotesensing.org>
Received: from xserve.flids.com (adsl-065-083-169-202.sip.mco.bellsouth.net [65.83.169.202])
        by inmx011.isp.belgacom.be (8.12.11/8.12.11/Skynet-IN-2.32) with ESMTP id j42GWYxB005588
        for <joris.at.lebbeke@skynet.be>; Mon, 2 May 2005 18:32:35 +0200
        (envelope-from <tiff-bounces@remotesensing.org>)
Received: from adsl-065-083-169-202.sip.mco.bellsouth.net (localhost [127.0.0.1])
	by xserve.flids.com (Postfix) with ESMTP
	id 3690224EB936; Mon,  2 May 2005 12:30:46 -0400 (EDT)
X-Original-To: tiff@remotesensing.org
Delivered-To: tiff@remotesensing.org
Received: from mail.srcp.com (unknown [12.5.252.28])
	by xserve.flids.com (Postfix) with ESMTP id E3C6624EB90B
	for <tiff@remotesensing.org>; Mon,  2 May 2005 12:30:42 -0400 (EDT)
Received: from CORPDALLMSG05.na.srcp.net ([10.150.10.111] RDNS failed) by
	mail.srcp.com with Microsoft SMTPSVC(6.0.3790.211); 
	Mon, 2 May 2005 11:30:42 -0500
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Subject: RE: [Tiff] Color TIFF/JPEG compression questions
Date: Mon, 2 May 2005 11:29:29 -0500
Message-ID: <741E24F735AED141B61948AC155E7DAA0E6123@CORPDALLMSG05.na.srcp.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: [Tiff] Color TIFF/JPEG compression questions
Thread-Index: AcVPIZJTM8C0FaGETyqdTI4fM3YeygADa03gAAEsgxA=
From: "Frank, Jason" <JasonFrank@srcp.com>
To: <tiff@remotesensing.org>
X-OriginalArrivalTime: 02 May 2005 16:30:42.0214 (UTC)
	FILETIME=[48704C60:01C54F34]
X-BeenThere: tiff@remotesensing.org
X-Mailman-Version: 2.1.2
Precedence: list
List-Id: TIFF and libtiff discussion  <tiff.remotesensing.org>
List-Unsubscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=unsubscribe>
List-Archive: <http://xserve.flids.com/pipermail/tiff>
List-Post: <mailto:tiff@remotesensing.org>
List-Help: <mailto:tiff-request@remotesensing.org?subject=help>
List-Subscribe: <http://xserve.flids.com/mailman/listinfo/tiff>,
	<mailto:tiff-request@remotesensing.org?subject=subscribe>
Sender: tiff-bounces@remotesensing.org
Errors-To: tiff-bounces@remotesensing.org
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by inmx011.isp.belgacom.be id j42GWYxB005588
X-UIDL: 000000000023ceae.0000018f
X-MSP-STORE: Mon, 02 May 2005 18:32:46 +0200
Status:   

And here's some more fun with that image.  Take the RGB image, and try
to tiffcp it like this: 

tiffcp -c jpeg -r32 quad-jpeg-rgb.tif quad-jpeg-rgb.tmp

Tiffcp says:
JPEGLib: Bogus input colorspace.

Jason

-----Original Message-----
From: tiff-bounces@remotesensing.org
[mailto:tiff-bounces@remotesensing.org] On Behalf Of Frank, Jason
Sent: Monday, May 02, 2005 11:12 AM
To: tiff@remotesensing.org
Subject: RE: [Tiff] Color TIFF/JPEG compression questions

Interesting, since my vendor is having trouble producing conforming
images, I took one of the images out of the libtiff image test pack,
v3.4pics.tar.gz.  I converted it to what I need to test with by doing
the follwing:

tiff2rgba  -c jpeg -r 16 quad-jpeg.tif  quad-jpeg-rgb.tif

This gave me a file with the following tags:

tiffinfo quad-jpeg-rgb.tif
TIFF Directory at offset 0xdb28
  Image Width: 512 Image Length: 384
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: RGB color
  Extra Samples: 1<assoc-alpha>
  YCbCr Subsampling: 2, 2
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 4
  Rows/Strip: 16
  Planar Configuration: single image plane
  Software: LIBTIFF, Version 3.7.2
Copyright (c) 1988-1996 Sam Leffler
Copyright (c) 1991-1996 Silicon Graphics, Inc.
  JPEG Tables: (289 bytes)

My source image has these tags:
TIFF Directory at offset 0x5b6e
  Image Width: 512 Image Length: 384
  Position: 0, 0
  Bits/Sample: 8
  Compression Scheme: JPEG
  Photometric Interpretation: YCbCr
  YCbCr Subsampling: 2, 2
  Samples/Pixel: 3
  Rows/Strip: 16
  Planar Configuration: single image plane
  Reference Black/White:
     0:     0   255
     1:   128   255
     2:   128   255
  JPEG Tables: (574 bytes)

It looks like tiff2rgba retained the YCbCr field.  And, for some reason
the source file has JPEG Tables, which I thought were used under Type 6
compressions.  I don't know if that's expected, but I thought I'd pass
it on.

I was able to convert it to PDF using pdflib3, and view it in Acrobat
Reader.  I can also view the converted TIF successfully in irfanView,
but not in MS' current viewer (whatever they're using now...)  I also
dropped the alpha channel, but that didn't appear to make any
difference.  I'm betting that MS might be having trouble with either the
YCbCr subampling or the JPEG tables.  Don't know much for sure anymore
though.

Jason


-----Original Message-----
From: tiff-bounces@remotesensing.org
[mailto:tiff-bounces@remotesensing.org] On Behalf Of Joris
Sent: Monday, May 02, 2005 9:16 AM
To: Grissom, Ed; tiff@remotesensing.org
Subject: Re: [Tiff] Color TIFF/JPEG compression questions

Ed,

> ...confusion over RGB vs. YCbCr.
>
> This image has tags for both :

Good of you to notice, I hadn't. Indeed, this point is more foremost
then the points I made.

> TiffTechNote 2 requires that if the underlying JPEG compression uses 
> YCbCr

Note that Photoshop apparently is able to save CMYK jpeg-in-tiff.

Tagdump of one such image generated with Photoshop:

SubFileType (1 Long): Zero
ImageWidth (1 Short): 3050
ImageLength (1 Short): 2035
BitsPerSample (4 Short): 8, 8, 8, 8
Compression (1 Short): JPEG Technote #2
Photometric (1 Short): Seperated
StripOffsets (407 Long): 26480, 50636, 74784, 99608, 124780, 150312,...
SamplesPerPixel (1 Short): 4
RowsPerStrip (1 Short): 5
StripByteCounts (407 Long): 24156, 24148, 24823, 25172, 25532, 25662,...
XResolution (1 Rational): 305
YResolution (1 Rational): 305
PlanarConfig (1 Short): Contig
ResolutionUnit (1 Short): Inch
Software (20 ASCII): Adobe Photoshop 7.0 DateTime (20 ASCII): 2004:08:29
15:13:38 DotRange (2 Byte): 0, 255 JpegTables (285 Undefined):
700 (4649 Byte): 60, 63, 120, 112, 97, 99, 107, 101, 116, 32,...
Photoshop (17958 Byte): 56, 66, 73, 77, 4, 37, 0, 0, 0, 0, 0, 16, 0,...
34665 (1 Long): 10661832

Upon examination of the first strip data, I see an APP14 marker, and 4
channels specified in both the SOF0 and SOS marker. The 'color
transform' byte in the Adobe-style APP14 marker equals 0, which I take
to mean that actual true CMYK is encoded in the jpeg data, without
additional tranformation.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff
_______________________________________________
Tiff mailing list
Tiff@remotesensing.org
http://xserve.flids.com/mailman/listinfo/tiff

