Green becomes yellow problem

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
Cobra_Fast
Posts: 6
Joined: 2012-04-20T07:48:21-07:00
Authentication code: 13

Green becomes yellow problem

Post by Cobra_Fast »

Greetings folks!

let's start right away; I'm having a quite specialized Problem.
I am remapping images (mainly photographs) to the eight 'base colors' (which are #000/black, #fff/white, #f00/red, #0f0/green, #00f/blue, #ff0/yellow, #0ff/cyan and #f0f/magenta) in order to roughly index present colors and color ratios of an image for archiving in a database.
After some tweaking I already worked out that I would need to brighten or darken the images a tad respectively to its overall brightness and increase the saturation a notch to let IM find a good amount of color so the remapping works well.

One problem is, though, that brighter green tones (like grass or palm leaves) often get mapped to yellow instead of green. (Which results in getting green pictures when browsing the archive for yellow ones and missing some pictures when browsing for green ones)
So the real question after all is, can I increase the intensity of the green colorchannel in a simple, yet natural (without tainting the entire image) manner so it would map those yellowish greens to green?
(Alternatively, decreasing the red channel if there is a sufficient ammount of green could work, too.)

I know it's not the ultimate solution for indexing images by color, but it works (except the above "problem").
I'd greatly appreciate anyone's help or thoughts, though!
tomriddle
Posts: 2
Joined: 2012-06-01T07:36:24-07:00
Authentication code: 13
Location: Ipswich

Re: Green becomes yellow problem

Post by tomriddle »

Hmm... have you maybe tried supplying RGB values instead of hex?
Cobra_Fast
Posts: 6
Joined: 2012-04-20T07:48:21-07:00
Authentication code: 13

Re: Green becomes yellow problem

Post by Cobra_Fast »

tomriddle wrote:Hmm... have you maybe tried supplying RGB values instead of hex?
Oh I'm sorry if my palette confused you.
I'm passing an image with those colors to -remap, not hex values.
The palette image is 8 pixels wide and 1 pixel high, it only contains those eight mentioned colors.
Post Reply