News for hackers. Stuff that matters.
Re:Chromium: Add support for Animated PNG by Keverw on Tuesday March 14, 2017 @08:03PM (#13872710)
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.
Re:Chromium: Add support for Animated PNG by ehsankia on Tuesday March 14, 2017 @08:58PM (#13872990)
Once 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.

Re:Chromium: Add support for Animated PNG by tyingq on Tuesday March 14, 2017 @10:15PM (#13873260)
It'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 .
Re:Chromium: Add support for Animated PNG by dlubarov on Tuesday March 14, 2017 @10:31PM (#13873328)
> 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.

Re:Chromium: Add support for Animated PNG by ehsankia on Wednesday March 15, 2017 @01:04PM (#13877687)
Are 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.
Re:Chromium: Add support for Animated PNG by versteegen on Wednesday March 15, 2017 @07:07PM (#13880771)
Use 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/ [1] http://www.imagemagick.org/Usage/anim_opt/#compress_opt [2] https://engineering.tumblr.com/post/80003435120/who-doesnt-l...

Re:Chromium: Add support for Animated PNG by dlubarov on Wednesday March 15, 2017 @02:09PM (#13878357)
I think most GIF optimizers would do it, although I haven't tried any. E.g. https://ezgif.com/optimize says they do it ("makes unchanged parts of the following frames transparent").
Re:Chromium: Add support for Animated PNG by ardaozkal on Tuesday March 14, 2017 @11:02PM (#13873489)
Disagreed, BPG (better portable graphics) is based on H265, but aimed at animated/nonanimated pictures. From my tests it runs really well.
Re:Chromium: Add support for Animated PNG by DaiPlusPlus on Tuesday March 14, 2017 @11:21PM (#13873572)
If you have a hardware H.265 decoder, sure - I'd wager a GIF or APNG runs better in single-thread, CPU-only environments.
Re:Chromium: Add support for Animated PNG by ardaozkal on Monday March 27, 2017 @06:59AM (#13966613)
Kind 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.