RSS/Atom feed Twitter
Site is read-only, email is disabled

Save for Web for GIF Animations?

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

5 of 5 messages available
Toggle history

Please log in to manage your subscriptions.

Save for Web for GIF Animations? Aviziel 24 Aug 07:16
  Save for Web for GIF Animations? Steve Kinney 25 Aug 05:36
   Save for Web for GIF Animations? Kevin Brubeck Unhammer 25 Aug 07:08
   Save for Web for GIF Animations? Ofnuts 25 Aug 21:09
  Save for Web for GIF Animations? Kevin Brubeck Unhammer 29 Aug 10:00
2013-08-24 07:16:58 UTC (over 11 years ago)
postings
1

Save for Web for GIF Animations?

I've done a fair share of looking around, and I've found a few "Save for Web" plug-ins that allow me to use sliders to change settings and thus the output file size, and most (all?) of them work with GIFs.

But so far I've found no way of getting any of them to work on Animated GIFs. This wouldn't be such an issue, but trying to get these images all under a certain file size can become a lot of trial and error, so I would greatly appreciate it if someone could help me out with this.

Steve Kinney
2013-08-25 05:36:51 UTC (over 11 years ago)

Save for Web for GIF Animations?

On 08/24/2013 03:16 AM, Aviziel wrote:

I've done a fair share of looking around, and I've found a few "Save for Web" plug-ins that allow me to use sliders to change settings and thus the output file size, and most (all?) of them work with GIFs.

But so far I've found no way of getting any of them to work on Animated GIFs. This wouldn't be such an issue, but trying to get these images all under a certain file size can become a lot of trial and error, so I would greatly appreciate it if someone could help me out with this.

Hey,

Here's some basics about animated GIF files and the GIMP.

Each "frame" of the animation is treated as a layer in the GIMP.

When a multi-layer image is exported as a GIF file, a dialog opens asking if you want to "flatten" the image or save it as an animation. This is fairly self explanatory.

Note that the frame rate, i.e. duration for which each layer is displayed in the finished animation, is one of the options in the export dialog.

To radically reduce the file size of an animated GIF, use the command Filters > Animation > Optimize (for GIF). This will create a new image, with everything that does NOT change from one frame to the next, deleted from the next frame, from the bottom of the layer stack (first frame) to the top (last frame).

For a lot more detail, see:

http://www.gimp.org/tutorials/Simple_Animations/ http://www.gimp.org/tutorials/Using_GAP/ http://www.gimp.org/tutorials/Advanced_Animations/

Hot tip: The menu at Image > Mode will allow you to convert from Indexed (GIF native format) to RGB (a much more flexible format). When you have to edit the content of GIF frames, make sure the image is set to RGB format; many filters and tools either don't work, or work very badly, in Indexed mode. The GIMP will convert an RGB image to Indexed format when you export it as a GIF file.

Have fun!

:o)

Steve

Kevin Brubeck Unhammer
2013-08-25 07:08:22 UTC (over 11 years ago)

Save for Web for GIF Animations?

Steve Kinney writes:

To radically reduce the file size of an animated GIF, use the command Filters > Animation > Optimize (for GIF). This will create a new image, with everything that does NOT change from one frame to the next, deleted from the next frame, from the bottom of the layer stack (first frame) to the top (last frame).

But always try exporting both with and without "Optimize (for GIF)". When I try optimising, it typically makes the GIF file about 2 % larger rather than smaller (example: http://filebin.net/oagzulb65w).

I've also tried ImageMagick's "convert -layers Optimize" on GIMP-exported gifs. This either makes the file larger (regardless of if I've used "Optimize (for GIF)" in GIMP first), or crashes with

convert: malloc.c:2369: sysmalloc: Assertion `(old_top == (((mbinptr) (((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >= (unsigned long)((((__builtin_offsetof (struct malloc_chunk, fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) - 1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) == 0)' failed. Aborted (core dumped)

What does have a major effect, however, is doing Image→Mode→Indexed and selecting some low number of colours. (This is where "Save for Web" is handy, since it lets you type in numbers and press TAB and get a quick preview of indexing. "Save for Web" doesn't save animations though, so it's _only_ useful for that preview.)

Kevin Brubeck Unhammer

GPG: 0x766AC60C
Ofnuts
2013-08-25 21:09:59 UTC (over 11 years ago)

Save for Web for GIF Animations?

On 08/25/2013 07:36 AM, Steve Kinney wrote:

Hot tip: The menu at Image > Mode will allow you to convert from Indexed (GIF native format) to RGB (a much more flexible format). When you have to edit the content of GIF frames, make sure the image is set to RGB format; many filters and tools either don't work, or work very badly, in Indexed mode. The GIMP will convert an RGB image to Indexed format when you export it as a GIF file. Have fun! :o) Steve

IMHO the real hot tip is to not edit GIFs...

Converting the image to RGB loses the colormap, and, if you introduce new colors with your processing, and export to GIF with the defaults, Gimp will create a new color map, and some of the old colors not in the new color map will be approximated with some other color, which can severely degrade the image quality (this often leads to jaggy lines).

If you don' t want introduce new colors, first export the colormap to a palette(*), then convert to RGB, and, before exporting, explicitly convert to indexed using the saved palette/colormap.

When you mix two images, all bets are off if they combined colormaps total more than 256 colors.

(*) In the Palettes list, right click, "Import palette", and select "Image" source.

Kevin Brubeck Unhammer
2013-08-29 10:00:26 UTC (about 11 years ago)

Save for Web for GIF Animations?

On a somewhat related note, https://gist.github.com/unhammer/6376239 is a tiny command-line (bash 4) script that creates animated SVG's from whatever images you feed it. Might be useful (I've gotten smaller size images with better colours than GIF can give with it).

Kevin Brubeck Unhammer

Never attribute to malice that which is adequately explained by
incompetence or laziness.