Broken output animations

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Urban

Broken output animations

Post by Urban »

Hi, recently ran into a problem while resizing some animated GIFs with ImageMagic. I've always used the following command-line options:

convert.exe -coalesce -resize 320x320 -alpha set +repage -layers optimize source.gif converted.gif

But now I got a large number of files that can not be properly processed. My output files look a bit strange:

Image

I tried to resave this source file with PhotoScape (without applying any changes e.g. resize, crop etc.), and the problem dissapeared :shock: Howevevr, the filesize increased significantly. The problem is that I need to resize about 2000+ files, so there is no way to resave each source file manually :?

Here you can dl the source and resaved files, and output images for both of them: http://rghost.ru/3464934 Maybe someone can help? :(

P.S. Sorry for my bad english.
User avatar
GreenKoopa
Posts: 457
Joined: 2010-11-04T17:24:08-07:00
Authentication code: 8675308

Re: Broken output animations

Post by GreenKoopa »

I notice that you are using the old syntax. For more information see http://www.imagemagick.org/Usage/basics/#why

The new syntax would be more like
convert.exe source.gif -coalesce -resize 320x320 -alpha set +repage -layers optimize converted.gif

This may not be your only problem, but I don't see anything obvious.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Broken output animations

Post by anthony »

Urban wrote:convert.exe -coalesce -resize 320x320 -alpha set +repage -layers optimize source.gif converted.gif
Other than reading the source image first....
-alpha set is not needed and +repage is already done by -coalesce (it is part of its defined operation, convert all frames to full images without offsets.

So trying
convert source.gif -coalesce -resize 320x320 miff:- | animate -
Perfect resize!
try optimize....
convert source.gif -coalesce -resize 320x320 -layers optimize miff:- | animate -
No problems
try GIF image file format
convert source.gif -coalesce -resize 320x320 -layers optimize gif:- | animate -
now problems.
Save to a gif and use web broswer to view -- no problems.

I can't see anything wrong.

How old is your IM? Should be new enough as you used -layers optimize
Perthas you have a specific version that had some bad bug in it that was later fixed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply