having problem in changing color of tshirt

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
ratneshsoni
Posts: 38
Joined: 2010-12-14T03:56:10-07:00
Authentication code: 8675308

having problem in changing color of tshirt

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: having problem in changing color of tshirt

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: having problem in changing color of tshirt

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply