Live data from Hacker News

A Polymer element for flexible GIF playback

geelen.github.io

81–82 of 82 posts

Re: A Polymer element for flexible GIF playback

#81
post #78
post #35

Earlier quoted context omitted.

Everything that http://gfycat.com/about says about GIFs is also true of APNGs. For things that are actually video (i.e. not a pixel-precise hand-drawn three-frame 32-bit image loop), using a video codec is just better in every way.

I agree that for most uses of GIF nowadays, a video codec would be superior, but better in every way? What about decoder overhead? For certain sizes of GIF, the combination of GIF + GIF "codec" (a trivial XOR) will consume less memory than, say, h264 + h264 codec - in some cases far less. A modern video codec is not at all trivial, and also is optimised for filesize, not CPU load.

> For certain sizes of GIF, the combination of GIF + GIF "codec" (a trivial XOR) will consume less memory than, say, h264 + h264 codec - in some cases far less.

Memory, maybe. But CPU?

I keep this snippet[1] at hand at all times, because pages with multiple animated GIFs peg my CPU and make my fan spin up for as long as they're open (even when they're in hidden tabs! even when the GIFs are scrolled off the screen!) This doesn't happen with elements.

I think the problem is that web browsers never bothered to move GIF decoding/rendering/compositing to the GPU. It's especially bad if a GIF is animating while it has CSS image-scaling applied to it, which leads me to believe that--since the GIF "codec" must be re-applied on each frame--the browser doesn't cache the decoded frames, and thus can't cache the scaled decoded frames.

[1] https://gist.github.com/tsutsu/9289a7e52351a3c947cf

Re: A Polymer element for flexible GIF playback

#82
post #58
post #27

Earlier quoted context omitted.

> which is literally what a video is People don't really want GIFs; what people want are filesize-limited, auto-playing-but-only-while-visible, auto-looping, and silent-by-default videos. Let's call these "animated images." The problem is thus: you're designing a piece of forum software, and you're considering whether to allow people to embed various elements in their posts. There's problems with allowing people to e…

WebP matches the criteria. It just lacks widespread adoption. https://developers.google.com/speed/webp/faq?hl=fr#why_shoul...

If there was better tooling, maybe there might be a few animated WebP images out there.
Post reply on HN