[Magick-bugs] TIFF PhotometricIntrepretation bug/behavior change

michael.finch at sungard.com michael.finch at sungard.com
Thu Apr 19 10:08:46 PDT 2007


Version 6.3.1 of ImageMagick produced TIFF images with a
PhotometricIntrepretation tag of 0 (zero).
Version 6.3.3 of ImageMagick produces TIFF images with a
PhotometricIntrepretation tag of 1 (one).

The new Photometry setting causes images to be displayed as a negative
image, i.e. Black background with white text.

The following command line was used with both versions of ImageMagick.
The GhostScript installation was not changed.

convert -verbose -density 200x200 -units PixelsPerInch -monochrome
-compress Group4 "05 - Submitter Letter.pdf" foo.tif 

Here is a snippet of the 6.3.3 output:

ghostscript library] Files/gs/gs8.54/bin/gswin32c.exe" -q -dBATCH
-dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
"-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g1700x2200"
"-r200x200" "-sOutputFile=c:/temp/magick-.3n..Mhw"
"-fc:/temp/magick-pRZyXO8Z"
"-fc:/temp/magick-0IhkP7q."c:/temp/magick-.3n..Mhw[0] PNM 1700x2200
1700x2200+0+0 PseudoClass 256c 8-bit 28.5342mb 0.491u 0:01
c:/temp/magick-.3n..Mhw[1] PNM 1700x2200 1700x2200+0+0 DirectClass 8-bit
28.5342mb 0.391u 0:01
c:/temp/magick-.3n..Mhw[2] PNM 1700x2200 1700x2200+0+0 DirectClass 8-bit
28.5342mb 0.240u 0:01
c:/temp/magick-.3n..Mhw[3] PNM 1700x2200 1700x2200+0+0 PseudoClass 256c
8-bit 28.5342mb 0.110u 0:01
05 - Submitter Letter.pdf[0] PDF 1700x2200 1700x2200+0+0 PseudoClass
256c 16-bit 28.5342mb 
05 - Submitter Letter.pdf[0] PDF 1700x2200 1700x2200+0+0 DirectClass
16-bit 28.5342mb 
05 - Submitter Letter.pdf[0] PDF 1700x2200 1700x2200+0+0 DirectClass
16-bit 28.5342mb 
05 - Submitter Letter.pdf[0] PDF 1700x2200 1700x2200+0+0 PseudoClass
256c 16-bit 28.5342mb 
TIFF Directory at offset 0x0 (0)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 1700 Image Length: 2200
Resolution: 200, 200 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-black
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 2200
Planar Configuration: single image plane
Software: ImageMagick 6.3.3 03/14/07 Q16 http://www.imagemagick.org
DocumentName: foo.tif
ImageDescription: Image generated by GPL Ghostscript (device=pnmraw)



Here is a snippet of the 6.3.1 output:

[ghostscript library] Files/gs/gs8.54/bin/gswin32c.exe" -q -dBATCH
-dSAFER -dMaxBitmap=500000000 -dNOPAUSE -dAlignToPixels=0
"-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-g1700x2200"
"-r200x200" "-sOutputFile=c:/temp/magick-8MJALQAH"
"-fc:/temp/magick-hFpsySLB"
"-fc:/temp/magick-4XzVQx80"c:/temp/magick-8MJALQAH[0] PNM 1700x2200
1700x2200+0+0 PseudoClass 256c 8-bit 28.5342mb 0.270u 0:01
c:/temp/magick-8MJALQAH[1] PNM 1700x2200 1700x2200+0+0 DirectClass 8-bit
28.5342mb 0.220u 0:01
c:/temp/magick-8MJALQAH[2] PNM 1700x2200 1700x2200+0+0 DirectClass 8-bit
28.5342mb 0.150u 0:01
c:/temp/magick-8MJALQAH[3] PNM 1700x2200 1700x2200+0+0 PseudoClass 256c
8-bit 28.5342mb 0.070u 0:01
05 - Submitter Letter.pdf[0] PDF 1700x2200 1700x2200+0+0 PseudoClass
256c 8-bit 28.5342mb 
05 - Submitter Letter.pdf[1] PDF 1700x2200 1700x2200+0+0 DirectClass
8-bit 28.5342mb 
05 - Submitter Letter.pdf[2] PDF 1700x2200 1700x2200+0+0 DirectClass
8-bit 28.5342mb 
05 - Submitter Letter.pdf[3] PDF 1700x2200 1700x2200+0+0 PseudoClass
256c 8-bit 28.5342mb 
TIFF Directory at offset 0x0 (0)
Subfile Type: multi-page document (2 = 0x2)
Image Width: 1700 Image Length: 2200
Resolution: 200, 200 pixels/inch
Bits/Sample: 1
Compression Scheme: CCITT Group 4
Photometric Interpretation: min-is-white
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 1
Rows/Strip: 2200
Planar Configuration: single image plane
Software: ImageMagick 6.3.1 12/02/06 Q8 http://www.imagemagick.org
DocumentName: foo.tif
ImageDescription: Image generated by GPL Ghostscript (device=pnmraw)





As a workaround, I can use the "-negate" switch to flip all the pixels
in the image, so that the image matches the tag setting.  I would rather
flip the tag setting.  Many TIFF viewers don't pay attention to the
Photometry tag, including the "Imaging for Windows" viewer.





More information about the Magick-bugs mailing list