Change of photometric value

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
Basti

Change of photometric value

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Change of photometric value

Post 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.
Basti

Re: Change of photometric value

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Change of photometric value

Post 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.
Post Reply