Page 1 of 1

Change of photometric value

Posted: 2008-06-02T23:29:49-07:00
by Basti
Good day!

I have a question concerning the Photometric values in TIFF images.

I would like to convert the compression of my image from "Deflate" to "LZW". I am doing this via your perl interface with these few steps:

1. Read Image
2. Set(compression=>"LZW");
3. Saving Image

The problem that occured is a change in the photometric value. Originally the value has been "minIsWhite" which is now "minIsBlack" thus inverting the colors of the image. I am using a 256 color gray-scale TIF.

Any ideas on how I can set the photometric value or leave the original value untouched?

Thanks and cheers for the great app!

-Basti

Re: Change of photometric value

Posted: 2008-06-03T06:10:43-07:00
by magick
From the command line you can change the polarity of the TIFF image with the quantum:polarity define. See http://www.imagemagick.org/script/formats.php#supported and browse down to the TIFF format.

Re: Change of photometric value

Posted: 2008-06-17T00:18:14-07:00
by Basti
Ah yes this works flawlessly with the commandline tool.

Is this also possible with the perl interface? I haven't found any polarity or quantum modificators.

Re: Change of photometric value

Posted: 2008-06-17T06:28:15-07:00
by magick
With PerlMagick, try something like
  • $image->Set("quantum:polarity","min-is-white");
However, a patch was required so you will need ImageMagick 6.4.1-9 Beta available sometime tomorrow otherwise an exception is thrown.