Page 1 of 1

problem in changing color

Posted: 2011-05-20T10:12:45-07:00
by ratneshsoni
Hello
i also ask the solution of this in my previous post, but i dont get to it now i am making it fresh. in below there is two image one is original and another is color changed.
Image

in above image u see that original is clear but when i change the color of image it not clear it sumthing become jaggy.

i am using following command change the color. In this first i change the image color into gray and then change into requested color.

exec("convert newimage.gif -colorspace Gray images/colorchg/new_gray.gif");
exec("convert images/colorchg/new_gray.gif -fill '#ff0000' -tint 200 images/colorchg/newclr.gif");
it also happen sumtime that when i resize the image then also this happen.
please tell the me prefect solution for changing the color of its urgent.

Re: problem in changing color

Posted: 2011-05-20T10:50:49-07:00
by fmw42
I don't think there is a perfect solution. When you resize and/or have anti-aliased pixels, then the recoloring affects the anti-aliased pixels part one way and part the other way. Thus the aliasing returns.

try

convert image -colorspace gray +level-colors somecolor,white newimage.gif

or

convert image -colorspace gray +level-colors black,somecolor newimage.gif

or

convert image -colorspace gray -fuzz XX% -fill somecolor -opaque black newimage.gif

Post a link to your original image so others can try various potential solutions.