Page 1 of 1

having problem in changing color of tshirt

Posted: 2011-03-23T03:16:17-07:00
by ratneshsoni
I have attach the image of tshirt, when i change the color of tshirt it is blinking.
code to change the color of tshirt is
exec("convert 01.png \( -clone 0 +level-colors black,yellow \) -draw 'color floodfill' tshirtnewt.gif")
please help me solving this problem.Thanks in advance
Image

Re: having problem in changing color of tshirt

Posted: 2011-03-23T09:56:18-07:00
by fmw42
exec("convert 01.png \( -clone 0 +level-colors black,yellow \) -draw 'color floodfill' tshirtnewt.gif")
Your command does not make sense to me. What is the -draw for? You have not even specified the color you want with -fill somecolor? How are you merging the original with the processed clone?


However, this works fine for me on IM 6.6.8.6 Q16 Mac OSX Tiger.

convert 01.png -colorspace gray +level-colors black,yellow 01_yellow.gif

However, quality will be better with png as output, since it supports 8-bit transparency and gif only supports binary transparency.

convert 01.png -colorspace gray +level-colors black,yellow 01_yellow.png

Please note that PNG has been under quite a bit of development and you should upgrade to the latest release.

Re: having problem in changing color of tshirt

Posted: 2011-03-24T23:27:03-07:00
by anthony
It flashed because you generated two images (second is from +clone) but you don't merge them.
As such you get a GIF animation!

Simplify

Code: Select all

  convert 01.png +level-colors black,yellow  shirt.gif
WARNING: PNG has anti-aliased pixels along the edge. GIF images only contains boolean transparency!!!
http://www.imagemagick.org/Usage/formats/#boolean_trans