Page 1 of 1

Gif with transparent color

Posted: 2012-09-07T12:25:38-07:00
by Granular
Hello! I tried to create an animation with transparent background using the utility "convert" and saw the problem.

Code: Select all

convert.exe -transparent red  -delay 20 *.bmp 3.gif
1.bmp - Image
2.bmp - Image
3.gif - Image

The second picture shows without erasing the first. Please tell me the solution to this problem. :)

Re: Gif with transparent color

Posted: 2012-09-07T13:55:24-07:00
by fmw42
jpg does not have a solid red color, so you need to use -fuzz. second, the -transparent should be after the input images. third you need to set the disposal method.

try

convert -dispose background -delay 50 1.jpg 2.jpg -fuzz 20% -transparent red -loop 0 3.gif


see
http://www.imagemagick.org/Usage/anim_basics

Re: Gif with transparent color

Posted: 2012-09-07T14:22:55-07:00
by Granular
Thank you :)

Re: Gif with transparent color

Posted: 2012-09-09T18:41:07-07:00
by anthony
You also need to set the appropriate disposal.

See IM Examples GIF Animation Basics, Displosals
http://www.imagemagick.org/Usage/anim_basics/#dispose

NOTE that all frames are disposed of completely at the end of the loop, before looping. The last frames disposal setting is thus irrelevant.