Page 1 of 1

clut fx 'v.p{0,u*v.h}'

Posted: 2015-08-05T18:43:26-07:00
by yakir
I'm trying to recolor a B&W image using the clut operator, but while:

Code: Select all

convert in.png cmap.png -fx 'v.p{0,u*v.h}' out.png
does the job (slowly), this:

Code: Select all

convert in.png cmap.png -clut out2.png
does not. I really want the result to look like out.png, with `-fx 'v.p{0,u*v.h}'`, and thought the clut would work. What's going on?

Thanks in advance!

Here are the details:
this is the link to these images: https://www.dropbox.com/sh/5pjx0p9mpw7n ... xy4ia?dl=0
Version: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC
Features: OpenMP

Re: clut fx 'v.p{0,u*v.h}'

Posted: 2015-08-05T19:29:32-07:00
by fmw42
You need to upgrade. I get pretty similar colors from your command on IM 6.9.1.9 Q16 Mac OSX using png, and exactly the same using tif for the output. I think the png results looks slightly different because in the clut method the output gets png:sRGB: intent=0 (Perceptual Intent), but in the fx method, there is no intent specified.

Unfortunately, adding -intent perceptual to the fx method is not setting the png intent in the output. This may be a bug.

Code: Select all

convert in.png cmap.png -fx 'v.p{0,u*v.h}' -intent perceptual out3.png

Re: clut fx 'v.p{0,u*v.h}'

Posted: 2015-08-07T08:29:11-07:00
by glennrp
I'm just getting 100% black output images, whether in PNG format or TXT format, with IM-6.7.7-9 through IM-6.9.1-10 Q16, libpng-1.2.50, and with IM-6.9.0-4, libpng-1.6.17.

Re: clut fx 'v.p{0,u*v.h}'

Posted: 2015-08-07T09:25:20-07:00
by fmw42
Both approaches work fine for me (apart from the intent issue) on IM 6.9.1.10 Q16 Mac OSX, if I save to PNG. If I use show:, the fx result does look black. TXT: shows different values. Using libpng @1.6.12_0

Re: clut fx 'v.p{0,u*v.h}'

Posted: 2015-08-07T12:45:05-07:00
by snibgo
in.png is grayscale, with gamma=1. At v6.7.7, IM was confused about grayscale and gamma. I also suggest an upgrade.