Quantcast
Channel: WP快站
Viewing all articles
Browse latest Browse all 233

ImageMagick: Combine animated GIF with PNG frame

$
0
0

I have an animated GIF of a fixed size (600x200):Animated GIF

I am trying to combine this GIF with a PNG frame:Frame

The frame is larger than the GIF (640x260) but has a designated 600x200 space - the GIF just needs to be placed behind the PNG at a position of 20/20 pixels from the top left. The result should look like this, but preserve the GIF animation:

Non-animated result

How can I achieve this using ImageMagick?

EDIT: The closest I got was using this command (ImageMagick 7 on Windows):

magick testgif.gif -repage 610x232+5+5 -transparent white -coalesce -draw "image over 0,0 0,0 frame3.png" -transparent white out.gif

The result (which is also 2.79 mb large, too large to upload here, while the original GIF is 213 kb) shows some artefacts. I added -dispose none following this question, but the artefacts are the same. They look like this:

GIF artefacts


Viewing all articles
Browse latest Browse all 233

Trending Articles