Page 1 of 1

unrecognized color 'rgb(50,129,75)'

Posted: 2012-12-14T09:57:31-07:00
by luckyluca
First of all thank you for imagemagick, I'm making use of it I think it's a wonderful software.

I've recently bumped into a warning I'm not sure whether I'm doing something wrong, perhaps I'm building the string wrong using python, I'm not sure.
Basically the string below runs fine except it gives me a warning (also below), any ideas on what I'm doing wrong / how to solve it ?
Thanks Luca

"C:\Program Files\ImageMagick-6.7.3-Q16\convert" tmp\INPUT_Helsinki_15_17.dds -normalize -fuzz 60% -fill black -opaque 'rgb(50,129,75)' tmp\INPUT_Helsinki_15_17_0.tga

Magick: unrecognized color `'rgb(50,129,75)'' @ warning/color.c/QueryMagickColorCompliance/2670.

Re: unrecognized color 'rgb(50,129,75)'

Posted: 2012-12-14T10:05:58-07:00
by snibgo
The Windows version doesn't like single quotes around the colour. Use double quotes, or leave them off entirely.

Code: Select all

"C:\Program Files\ImageMagick-6.7.3-Q16\convert" tmp\INPUT_Helsinki_15_17.dds -normalize -fuzz 60% -fill black -opaque "rgb(50,129,75)" tmp\INPUT_Helsinki_15_17_0.tga

Code: Select all

"C:\Program Files\ImageMagick-6.7.3-Q16\convert" tmp\INPUT_Helsinki_15_17.dds -normalize -fuzz 60% -fill black -opaque rgb(50,129,75) tmp\INPUT_Helsinki_15_17_0.tga

Re: unrecognized color 'rgb(50,129,75)'

Posted: 2012-12-14T10:58:49-07:00
by luckyluca
thanks for the quick reply.
with " I get a black image and no warning.

with \" I get the intended result but get the warning too
Magick: unrecognized color `"rgb(255,255,255)"'

with no quotes I get a black image and no warning.

I think I'll convert the rgb value to hexadecimal and sort it out that way

snibgo wrote:The Windows version doesn't like single quotes around the colour. Use double quotes, or leave them off entirely.

Code: Select all

"C:\Program Files\ImageMagick-6.7.3-Q16\convert" tmp\INPUT_Helsinki_15_17.dds -normalize -fuzz 60% -fill black -opaque "rgb(50,129,75)" tmp\INPUT_Helsinki_15_17_0.tga

Code: Select all

"C:\Program Files\ImageMagick-6.7.3-Q16\convert" tmp\INPUT_Helsinki_15_17.dds -normalize -fuzz 60% -fill black -opaque rgb(50,129,75) tmp\INPUT_Helsinki_15_17_0.tga

Re: unrecognized color 'rgb(50,129,75)'

Posted: 2012-12-14T11:39:52-07:00
by snibgo
I'm not quite sure what you intend. The command will change to black any pixels that are within 60% of rgb(50,129,75). 60% is a wide margin, so many pixels will turn black. As you've specified a green value of 129, and 60% of 255 is 153, all the pixels will become black (if I understand the options correctly).

Re: unrecognized color 'rgb(50,129,75)'

Posted: 2012-12-14T12:02:50-07:00
by fmw42
"C:\Program Files\ImageMagick-6.7.3-Q16\convert" tmp\INPUT_Helsinki_15_17.dds -normalize -fuzz 60% -fill black -opaque 'rgb(50,129,75)' tmp\INPUT_Helsinki_15_17_0.tga
On Windows try using double quotes around your rgb(...)

Re: unrecognized color 'rgb(50,129,75)'

Posted: 2017-11-11T06:20:58-07:00
by luckyluca
sorry for the super late reply!

ironically I like the result I get with the warning, I wonder what color ends up being used instead of 'rgb(50,129,75)' when imagemagick returns the warning?

Re: unrecognized color 'rgb(50,129,75)'

Posted: 2017-11-11T06:38:07-07:00
by snibgo
You could try it in a "-fill" and see what you get. Windows CMD syntax:

Code: Select all

convert xc: -fill 'rgb(50,129,75)' -colorize 100 txt:
On a more recent version, v6.9.5-3, this is an error, not merely a warning.

Re: unrecognized color 'rgb(50,129,75)'

Posted: 2017-11-12T03:02:44-07:00
by luckyluca
I'm aware of the change from warning to error, I'm currently using an older version of imagemagick.

I'm revisiting my code in an attempt to remove these issues, I'd like to figure out what the current value returns ( the one with the warning ), i can't get your example code to work though. what do xc: and txt: represent?

thanks
Luca

what I'm doing is converting orthophotos to night-time by filtering colors. i convert greens and browns to black and then using resulting masks to create lighting around roads and houses.