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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
yakir
Posts: 8
Joined: 2013-01-25T13:45:23-07:00
Authentication code: 6789

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

Post 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
Last edited by yakir on 2015-08-05T21:33:27-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

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

Post 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.
Last edited by glennrp on 2015-08-07T11:26:23-07:00, edited 2 times in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply