display with color mapping

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
zxcvq
Posts: 4
Joined: 2011-07-11T21:05:31-07:00
Authentication code: 8675308

display with color mapping

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: display with color mapping

Post by fmw42 »

on unix, you can do:

convert infile.png gradient.ppm -clut show:

see http://www.imagemagick.org/Usage/files/#show
zxcvq
Posts: 4
Joined: 2011-07-11T21:05:31-07:00
Authentication code: 8675308

Re: display with color mapping

Post 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? :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: display with color mapping

Post 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.
zxcvq
Posts: 4
Joined: 2011-07-11T21:05:31-07:00
Authentication code: 8675308

Re: display with color mapping

Post 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?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: display with color mapping

Post 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.
zxcvq
Posts: 4
Joined: 2011-07-11T21:05:31-07:00
Authentication code: 8675308

Re: display with color mapping

Post 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.
Post Reply