Page 1 of 1

Convert with -clut produces different images

Posted: 2011-05-04T06:55:06-07:00
by happy_user103
Hi all,

I have the following problem, possible bug, with coloring a grayscale image using convert and -clut.

On Ubuntu 10.04 with ImageMagick 6.5.7-8 2010-12-02 Q16 the desired conversion works:

Code: Select all

convert in.png colors.png -channel RGBA -clut desired.png
On Ubuntu 10.10 with ImageMagick 6.6.9-5 2011-04-19 Q8 the conversion produces something different:
convert in.png colors.png -channel RGBA -clut wrong.png
Thanks in advance.

The images used and produced:
in.png:
Image

colors.png:
Image

desired.png:
Image

wrong.png:
Image

Re: Convert with -clut produces different images

Posted: 2011-05-04T09:56:56-07:00
by fmw42
Your command works fine for me on IM 6.6.9.7 Q16 Mac OSX Tiger.

Re: Convert with -clut produces different images

Posted: 2011-05-04T19:16:04-07:00
by anthony
Clut handling of grayscale recolor with involving clut images with alpha, broke in one recent version of IM.

Another programmer (I will not say who) ignored a WARNING I had left in the source code and recoded it incorrectly.

FYI; It is a matter of image processing order in the core library function. Alpha in the clut image has to be recoded first, as it needs to use color value for the lookup (no alpha in input image). Only after alpha is handled can the color values be modified but the CLUT.

I fixed the problem, and re-added the warning, as soon as I discovered it. You must have been unlucky to download a bad version. color values modified before they are used to modify alpha!

Upgrade and all will be well.


ASIDE; Nice way of recoloring so as to represent negative and positive results in a baised grayscale image (perfect gray being regarded as zero).

Re: Convert with -clut produces different images

Posted: 2011-05-05T02:34:07-07:00
by happy_user103
After an upgrade to ImageMagick 6.6.9-8 2011-05-05 Q16 on Ubuntu 10.10 convert creates the desired output.

Thank you for your help.