5 ms·
I've noticed that gifs are made into videos too. I wonder if apng's will be efficient. I would think a small animated image like a .gif would be more optimized
by Keverw 10y ago
I've noticed that gifs are made into videos too. I wonder if apng's will be efficient. I would think a small animated image like a .gif would be more optimized than a full on video file but I guess not.
- ehsankia 10y agoOnce you understand how videos are encoded, it's pretty obvious why gif (and apng) are not and will never be as small as videos. Videos use temporal data. You have one key frame (where the whole image is stored) and the following frames are encoded as delta (difference) from the previous frame. So a still video could basically be the size of a single image. Animated images aren't that smart, they're just a bunch of images, so you're storing every single frame.
- tyingq 10y agoIt's not quite that stark. You can have the non changing background solely in the first frame, and have subsequent frames (smaller frames even, placed at offsets) composed solely of "sprite like" things that overlay. And there are tools like imagemagick that can optimize existing animated gifs in that way. It is crude, but it's more than just a plain sequence of unrelated full size frames .
- 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...
- ardaozkal 10y agoDisagreed, BPG (better portable graphics) is based on H265, but aimed at animated/nonanimated pictures. From my tests it runs really well.
- DaiPlusPlus 10y agoIf you have a hardware H.265 decoder, sure - I'd wager a GIF or APNG runs better in single-thread, CPU-only environments.
- ardaozkal 10y agoKind of an old reply, but I should honestly test that- encoding on a CPU only environment compared to one with a GPU with specialized support takes around 4-5x more, but I didn't test decoding yet on a CPU only environment yet.