Page 1 of 1

Can't merge a gif image with a png image.

Posted: 2018-03-18T22:53:50-07:00
by bkstorm
I have two image: a GIF image and a PNG image.
the PNG image:
Image
the GIF image:
Image

I use the command below to merge two images:

Code: Select all

convert banana-bg.png null: \
\( banana.gif -coalesce \) -compose DstOver -layers Composite null: \
-set loop 0 -layers RemoveDups -layers RemoveZero \
finish.gif
and here is the result:
Image
As what you see, it's not what I expect.

I try this command with another GIF image, it works fine.
Image

Image

What's the problem?
Version: ImageMagick 7.0.7-25 Q16 x86_64 2018-03-04 http://www.imagemagick.org
Copyright: © 1999-2018 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib

Re: Can't merge a gif image with a png image.

Posted: 2018-03-18T23:17:13-07:00
by fmw42
try this

Code: Select all

convert banana-bg.png  \
null: \
\( banana.gif -coalesce \) \
-compose DstOver -layers Composite \
-set dispose previous \
-layers RemoveDups \
-layers RemoveZero \
-layers optimize \
-loop 0 \
finish.gif