Converting custom color map to grayscale?

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
blaklite
Posts: 2
Joined: 2013-02-12T16:44:32-07:00
Authentication code: 6789

Converting custom color map to grayscale?

Post by blaklite »

I'm working on a project that requires converting 16-bit images to 8-bit grayscale. The problem is that the original images are data sets that use color to indicate the amplitude of the data points. I need to convert those colors to grayscale so that 255 (white) is the max and 0 (black) is the min. The color map used in the original data sets is very custom. For example, a low intensity is indicated by red colors from almost white to full red. Higher intensity is indicated by blue, then green, etc.

Is there a good way with ImageMagick to map the custom color map to a standard grayscale map? Any help is appreciated!

Thank you very much!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting custom color map to grayscale?

Post by fmw42 »

An example image would help to understand your problem.

But see
http://www.imagemagick.org/Usage/color_mods/#clut

and

viewtopic.php?f=1&t=24193
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Converting custom color map to grayscale?

Post by fmw42 »

If on unix you could also try my script mapcolors at the link below, though it may be slow.
Post Reply