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.
unrecognized color 'rgb(50,129,75)'
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: unrecognized color 'rgb(50,129,75)'
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
snibgo's IM pages: im.snibgo.com
Re: unrecognized color 'rgb(50,129,75)'
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
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
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: unrecognized color 'rgb(50,129,75)'
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).
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: unrecognized color 'rgb(50,129,75)'
On Windows try using double quotes around your rgb(...)"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)'
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?
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?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: unrecognized color 'rgb(50,129,75)'
You could try it in a "-fill" and see what you get. Windows CMD syntax:
On a more recent version, v6.9.5-3, this is an error, not merely a warning.
Code: Select all
convert xc: -fill 'rgb(50,129,75)' -colorize 100 txt:
snibgo's IM pages: im.snibgo.com
Re: unrecognized color 'rgb(50,129,75)'
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.
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.