Imagemagick gif叠加在背景上保留alpha [英] Imagemagick gif overlay preserves alpha on background
问题描述
我正在使用此代码从一系列pngs构建动画gif:
convert -dispose previous -resize 400x400 -delay 10 * .png -loop 0 -coalesce -layers Optimize output.gif。
I am using this code to build an animated gif from a sequence of pngs: convert -dispose previous -resize 400x400 -delay 10 *.png -loop 0 -coalesce -layers Optimize output.gif.
它创建了一个具有透明度的gif,但是当我将它覆盖在jpg背景上时,我得到一个奇怪的结果,在我移动的gif下的最终图像中保留了透明框但是结束了jpg。从我的测试来看,这似乎是我构建原始gif的方式的一个问题,但我不知道。此外,我使用GoDaddy的ImageMagick内置版本,这是6.2.8并且很糟糕......所有帮助和支持似乎都适用于更新版本。有没有人有任何想法?
it creates a gif with transparency, but when I overlay it over a jpg background, I get a weird result where a transparent box remains in the final image under my moving gif but over the jpg. From my tests, it seems this is a problem with the way I am building the original gif, but I have no idea. Also, I am stuck using GoDaddy's built in version of ImageMagick, which is 6.2.8 and sucks...all help and support seem to be for much newer versions. Does anyone have any ideas?
覆盖代码:
convert background.jpg overlay.gif -layers优化output.gif
code to overlay: convert background.jpg overlay.gif -layers Optimize output.gif
产生以下图像:
which produces the following image:
推荐答案
以下适用于GoDaddy的imagemagick 6.2.8
The following works with GoDaddy's imagemagick 6.2.8
转换overlay.gif -coalesce -draw'图像Dst_Over 0,0 0,0背景。 jpg'-lalay优化output.gif
convert overlay.gif -coalesce -draw 'image Dst_Over 0,0 0,0 background.jpg' -layers Optimize output.gif
这篇关于Imagemagick gif叠加在背景上保留alpha的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!