AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2003.12.30 20:48 "[Tiff] Non Color - Compression in 3.6.X", by Carl J. Collin
2004.01.01 14:48 "Re: [Tiff] Non Color - Compression in 3.6.X", by Antonio Scuri
2004.01.02 06:52 "Re: [Tiff] Non Color - Compression in 3.6.X", by Carl J. Collin
2004.01.02 10:10 "Re: [Tiff] Non Color - Compression in 3.6.X", by Andrey Kiselev
2004.02.16 09:54 "[Tiff] TIFF BUG: RGB gets swapped on YCBCR", by Kenneth_Tjøstheim

2004.01.02 06:52 "Re: [Tiff] Non Color - Compression in 3.6.X", by Carl J. Collin

I don't know what to tell you. This is all the information I have...

Tiffinfo reported this to me on my original "greyscale" file.

TIFF Directory at offset 0xd4
    Subfile Type: (0 = 0x0)
    Image Width: 1600 Image Length: 2000
    Resolution: 200, 200 pixels/inch
    Bits/Sample: 8
    Compression Scheme: None
    Photometric Interpretation: min-is-black
    FillOrder: msb-to-lsb
    Orientation: row 0 top, col 0 lhs
    Samples/Pixel: 1
    Rows/Strip: 19
    Planar Configuration: single image plane

  Software: Oi/GFS, writer v00.06.02

I then tried to perform this command to compress: tiffcp -c jpeg ds1encounter1.tif compressed.tif and got this error:

TIFFReadDirectory: Warning, ds1encounter1.tif: unknown field with tag 32934 (0x80a6) encountered.

ds1encounter1.tif: Warning, incorrect count for field "Tag 32934" (0, expecting 1); tag ignored.

JPEGSetupEncode: RowsPerStrip must be multiple of 16 for JPEG.

So I performed this command: tiffcp -r 16 -c jpeg ds1encounter1.tif compressed.tif

and got this error:

JPEGLib: Bogus input colorspace.

So I performed this command: tiffcp -r 16 -c jpeg:r ds1encounter1.tif compressed.tif

and got no error, but when I tried to view the image using "display" which is from ImageMagick I get

this error:

display: Sorry, can not handle RGB image with Color channels=1. (compressed.tif)

So I thought maybe ImageMagick is just f'd up, so I tried to reverse the compression

ala "tiffcp -c none compressed.tif uncompressed.tif" and while the file size has expanded, the file is still reporting the same error in display (ImageMagick) display: Sorry, can not handle RGB image with Color channels=1. (compressed.tif)

Now the really interesting point again is that this works fine for if my original file has this for its tiffinfo:

TIFF Directory at offset 0x8
    Subfile Type: (0 = 0x0)
    Image Width: 849 Image Length: 933
    Resolution: 72, 72 pixels/inch
    Bits/Sample: 8
    Compression Scheme: LZW
    Photometric Interpretation: RGB color
    Samples/Pixel: 3
    Rows/Strip: 3
    Planar Configuration: single image plane

  Photoshop Data: <present>, 2968 bytes
  Predictor: horizontal differencing 2 (0x2)

It seems for all files that have a Photometric Interpretation of RGB color the compression schema works fine.

The other "really interesting thing" is that those broken compressed/uncompressed files above that don't work in the ImageMagick program or in the Wang viewer work FINE in Irfanview. So what the hell is going on?

Any ideas....

I can send files to anybody whom can help out, I'm just trying to figure out why the compression and decompression leaves the files in a state that seems can only be read by some programs.

Thanks!

I know in our in-house use of the new version of libTiff we have been having problems related to JPEG compression of grayscale images. Has anyone gotten this to work correctly? ImageMagick can not display these compressed files and decompressing them leaves them in a state that they are not viewable. Color images are fine though...

Any thoughts?

It is working fine for me. I can read and write Gray and RGB images using JPEG in libTIFF 3.6.1. I test the results in PhotoShop 6, and loaded ok.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).

Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003