Anthony Thyssen wrote:

In the mean time you can use a LUT to reduce the number of colors

   http://www.cit.gu.edu.au/~anthony/graphics/imagick6/color/#color_lut

Great. I can do that with the command-line tools:

convert -depth 8 -size 1x32 gradient:#000-#1f1f1f gradient.pgm
convert image.pgm gradient.pgm -fx 'v.p{0,u*v.h}' -depth 8 reduced.pgm

...but I confess I'm at a loss on how to do it in PerlMagick:

$gradient = new Image:Magick;
$gradient->Read('gradient.pgm');

How do I get $gradient into the Fx function:

$image->Fx(expression=>'v.p{0,u*v.h}');

Sorry if these seem obvious. I have tried my best to search the docs &
google codesearch - there seem to be only 3 instances of use of ->Fx
with Image::Magick on the web, and none of them use colour lookup
tables...
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to