AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.04.28 13:40 "[Tiff] Delphi 7, TIFF G3/4, Multipage", by Matthias Lach
2005.04.29 16:09 "Re: [Tiff] Delphi 7, TIFF G3/4, Multipage", by Joris
2005.05.02 16:12 "RE: [Tiff] Color TIFF/JPEG compression questions", by Frank, Jason
2005.05.02 13:44 "RE: [Tiff] Color TIFF/JPEG compression questions", by Grissom, Ed
2005.05.02 14:16 "Re: [Tiff] Color TIFF/JPEG compression questions", by Joris
2005.05.02 16:29 "RE: [Tiff] Color TIFF/JPEG compression questions", by Frank, Jason
2005.05.02 17:55 "Re: [Tiff] Color TIFF/JPEG compression questions", by Joris
2005.05.02 18:17 "RE: [Tiff] Color TIFF/JPEG compression questions", by Frank, Jason

2005.05.02 16:12 "RE: [Tiff] Color TIFF/JPEG compression questions", by Frank, Jason

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.