3 ms·
> Animated images aren't that smart, they're just a bunch of images, so you're storing every single frame. GIF89a has a sort of limited delta encoding via the
by dlubarov 10y ago
> Animated images aren't that smart, they're just a bunch of images, so you're storing every single frame.
GIF89a has a sort of limited delta encoding via the "do not dispose" option. If you write a frame with "do not dispose" and then write a frame with some transparent pixels, the transparent pixels will retain the colors from the previous frame.
It's rather primitive but it's better than nothing.
- ehsankia 10y agoAre there tools that take existing normal gifs and convert it to make use of that? Because manually creating such gifs are generally a huge pain.
- dlubarov 10y agoI think most GIF optimizers would do it, although I haven't tried any. E.g. https://ezgif.com/optimize https://ezgif.com/optimize says they do it ("makes unchanged parts of the following frames transparent").
- versteegen 10y agoUse gifsicle. It's excellent and very fast, I don't think there's anything that produces smaller gifs than it. [0] You can also use ImageMagick to produce optimised gifs (it has about 4 different options for that, eg -layers OptimizeTransparency). See [1]. But in my own tests, gifsicle always beats it (often by a huge margin) and is vastly faster. That ImageMagick page may be out of date. Also, Tumblr contracted the author of gifsicle, Dr. Eddie Kohler, to make some improvement for them, hopefully that made it back into gifsicle [2]. [0] https://www.lcdf.org/gifsicle/ https://www.lcdf.org/gifsicle/ [1] http://www.imagemagick.org/Usage/anim_opt/#compress_opt http://www.imagemagick.org/Usage/anim_opt/#compress_opt [2] https://engineering.tumblr.com/post/80003435120/who-doesnt-love-animated-gifs-believe-it-or https://engineering.tumblr.com/post/80003435120/who-doesnt-l...