Page 1 of 1

display with color mapping

Posted: 2011-07-11T21:42:39-07:00
by zxcvq
I have made a set of gradient images that I successfully use with convert:

Code: Select all

convert infile.png gradient.ppm -clut outfile.png
Is there a way to use these gradient images with display so that images are displayed with the color mapping applied?

Thanks.

Re: display with color mapping

Posted: 2011-07-12T10:44:05-07:00
by fmw42
on unix, you can do:

convert infile.png gradient.ppm -clut show:

see http://www.imagemagick.org/Usage/files/#show

Re: display with color mapping

Posted: 2011-07-12T12:09:40-07:00
by zxcvq
Many thanks for your reply. I hadn't used the show: delegate before. Two follow-ups to this:
  • show: does not work for me with png files, I get convert: delegate failed `SHOW' @ error/delegate.c/InvokeDelegate/979. If I previously convert the png to jpg and use show: on the jpg, it work fine. This is with Imagemagick 6.6.7.

    Using show: is a way to automate the process convert->display->rm temp image. I was interested in something along the lines of what imview does (on-the-fly color mapping). Feature request? :)

Re: display with color mapping

Posted: 2011-07-12T12:30:37-07:00
by fmw42
zxcvq wrote:Many thanks for your reply. I hadn't used the show: delegate before. Two follow-ups to this:
  • show: does not work for me with png files, I get convert: delegate failed `SHOW' @ error/delegate.c/InvokeDelegate/979. If I previously convert the png to jpg and use show: on the jpg, it work fine. This is with Imagemagick 6.6.7.

    Using show: is a way to automate the process convert->display->rm temp image. I was interested in something along the lines of what imview does (on-the-fly color mapping). Feature request? :)

Seems like I am not even able to get show: to work on IM 6.7.1.0 Q16 Mac OSX Tiger. I will report it.

I am unfamiliar with imview. Is that part of Imagemagick? Are you on windows? I don't think that is a unix Imagemagick option?

PS The PNG coder has made many changes over many release to the PNG reader/writer. You may want to upgrade your IM with respect to PNG handling.

Re: display with color mapping

Posted: 2011-07-12T12:46:34-07:00
by zxcvq
fmw42 wrote:Seems like I am not even able to get show: to work on IM 6.7.1.0 Q16 Mac OSX Tiger. I will report it.

I am unfamiliar with imview. Is that part of IM? Are you on windows? I don't think that is a unix IM option?
Yes, I am on *nix (linux, to be precise). Imview is not part of IM - it is a stand-alone image viewer with some basic features one of which is to allow you to apply on-the-fly color mappings to images. The feature request was to have IM's display have a similar capability. Maybe a -clut option for display?

Re: display with color mapping

Posted: 2011-07-12T12:53:51-07:00
by fmw42
I don't know enough about the display process, but it seems that it only supports one-image processing functions. see http://www.imagemagick.org/script/display.php The IM developers would have to comment about any modifications or limitations.

In principle, convert image1 lutimage -clut show: should work the way you want.

If you can get it to work with jpg, then it should work fine with png. But as I said before, PNG has been under development and your version of IM may have some bug and need an upgrade.

Re: display with color mapping

Posted: 2011-07-12T13:10:53-07:00
by zxcvq
fmw42 wrote:If you can get it to work with jpg, then it should work fine with png. But as I said before, PNG has been under development and your version of IM may have some bug and need an upgrade.
The interesting thing is that png handling is fine with a standard convert:

Code: Select all

convert in.png lutfile -clut out.png
The problem arises with show: and I have now verified it doesn't work with gif's either. jpg and ppm do work.

Code: Select all

convert in.gif lutfile -clut show:
gives the same error as before, for example.