Page 1 of 1
converting one color to another with command line - didn't w
Posted: 2012-05-11T12:24:29-07:00
by psydev
Hi, guys. Hoping you could help with a problem I'm having
I am trying to convert certain colors in a picture to another color. When I tried the convert command nothing happened, however. I tried this as a simple test, to convert black to white, but it didn't do anything:
convert test.png -fill "#000000" -opaque "#ffffff" test2.png
Can anyone tell me what I'm doing wrong?
Thanks,
Re: converting one color to another with command line - didn
Posted: 2012-05-11T13:19:15-07:00
by fmw42
your image is probably not uniform colors, so you probably need to use -fuzz XX% to catch similar (or near) colors.
it would really help if you could post a link to your input image. it would make it easier to help pinpoint the issue.
Re: converting one color to another with command line - didn
Posted: 2012-05-11T14:42:36-07:00
by psydev
Hey,
Here is the image. It seems pretty uniform in the blackness. I wanted to test changing the black to white since it would be dramatic and noticeable. I wanted to change the reds to some yellows.
http://i.imgur.com/sDE32.png
Re: converting one color to another with command line - didn
Posted: 2012-05-11T14:53:21-07:00
by fmw42
This command works perfectly fine for me on IM 6.7.6.9 Q16 Mac OSX Snow Leopard:
convert sDE32.png -fill white -opaque black sDE32_proc.png
The black is converted to white.
Your comand was backwards, that is, trying to convert white to black and there is no pure white in your image. The brightest gray was 252 and only 42 pixels at that value.
What version of IM are you using? If old, perhaps upgrade.
Re: converting one color to another with command line - didn
Posted: 2012-05-11T21:04:08-07:00
by psydev
haha, thanks so much! Works great now. What a useful program!