Live data from Hacker News

A new PNG spec

programmax.net

511–520 of 622 posts

Re: A new PNG spec

#511
post #5

So animated GIFs can be replaced by Animated PNGs with alpha blending with transparent backgrounds and lossless compression! Some nostalgia from 2000s websites can be revived and relived :) Curious if Animated SVGs are also a thing. I remember seeing some Javascript based SVG animations (it was a animated chatbot avatar) - but not sure if there is any standard framework.

> So animated GIFs can be replaced by Animated PNGs with alpha blending with transparent backgrounds and lossless compression!

Not progressively though unless browsers add a new mime type for it which they did not bother to do with animated webp.

Re: A new PNG spec

#512

Earlier quoted context omitted.

> Curious if Animated SVGs are also a thing. Yes. Relevant animation elements: • • • • See https://www.w3schools.com/graphics/svg_animation.asp

Overshadowed by CSS animations for almost all use cases.

*in browsers

Most other SVG renderers don't support much CSS.

Re: A new PNG spec

#513
post #5

So animated GIFs can be replaced by Animated PNGs with alpha blending with transparent backgrounds and lossless compression! Some nostalgia from 2000s websites can be revived and relived :) Curious if Animated SVGs are also a thing. I remember seeing some Javascript based SVG animations (it was a animated chatbot avatar) - but not sure if there is any standard framework.

I was under the impression many gifs these days are actually served as soundless videos, as those basically compress better. Can animated PNG beat av1 or whatever?

Soundless videos cannot be used in environments that expect an image like embeds in forums and similar.

It's a shame that browser vendors didn't add silent looping video support to the img tag over (imo) baseless concerns.

Re: A new PNG spec

#514
post #44

Earlier quoted context omitted.

APNG would be for lossless compression, and probably especially for animations without a constant frame rate. Similar to the original GIF format, with APNG you explicitly specify the duration of each individual frame, and you can also explicitly specify looping. This isn’t for video, it’s more for Flash-style animations, animated logos/icons [0], or UI screen recordings. [0] like for example these old Windows animati…

All valid points, however AV1 also supports lossless compression and is almost certainly going to win the file size competition against APNG every time. https://trac.ffmpeg.org/wiki/Encode/AV1#Losslessencoding

> is almost certainly going to win the file size competition against APNG every time

For video content maybe. Pixel-art gifs are not something video codecs do well at without introducing lots of artifacts.

Re: A new PNG spec

#515

Earlier quoted context omitted.

Its also because people like to "pause" animations, and that is not really an option with apng & gif.

why not? that's up to the program displaying the animation, not the animation itself -- i'm sure a pausable gif or apng display program is possible

Browsers used to support pausing GIFs by pressing the escape key.

Re: A new PNG spec

#516
post #120

Earlier quoted context omitted.

> Animated PNGs can't beat GIF nevermind video compression algorithms. Not entirely true, it depends on what's being displayed, see a few simple tests specifically constructed to show how much better APNG can be vs GIF and {,lossy} webp: http://littlesvr.ca/apng/gif_apng_webp.html Of course I don't think it generalizes all that well…

You're correct and I was considering adding a footnote that if you use indexed colors like a GIF then PNG can beat GIF due to better compression algorithms. But when most people think of APNG they think of lossless compression rather than lossy compression.

Indexed can be lossless when the source already uses few colors, e.g. because you want to improve the compression of an existing GIF or limit colors for stylistic choice (common in pixel art).

Re: A new PNG spec

#517
post #159
post #120

Earlier quoted context omitted.

> Animated PNGs can't beat GIF nevermind video compression algorithms. Not entirely true, it depends on what's being displayed, see a few simple tests specifically constructed to show how much better APNG can be vs GIF and {,lossy} webp: http://littlesvr.ca/apng/gif_apng_webp.html Of course I don't think it generalizes all that well…

I tried these examples on ezgif, and indeed apng manages to be smaller than webp every single time. Weird, I was under the impression that webp was almost always smaller? Is this because GIF images are already special, or apng uses better compression than png? edit: using the same ezgif webp and apng on a H.264 source, apng is suddenly 10x the size than webp. It seems apng is only better if the source is gif

Almost like video codecs and animated images are different niches that optimize for different content.

Re: A new PNG spec

#518
post #314

Earlier quoted context omitted.

It's absolutely possible. Browsers even routinely pause playback when images aren't visible on screen. They just don't have a proper UI and JS APIs exposed, and there's nothing stopping them from adding that. IMO browsers are just stuck with tech debt, and maintainin a no-longer-relevant distinction between "animations" and "videos". Every supported codec should work wherever GIF/APNG work and vice versa. It's not ev…

> They just don't have a proper UI and JS APIs exposed, and there's nothing stopping them from adding that. Browsers should just allow animated gifs and apngs in

More important would be to allow (silent) videos in .

Re: A new PNG spec

#519
post #314

Earlier quoted context omitted.

It's absolutely possible. Browsers even routinely pause playback when images aren't visible on screen. They just don't have a proper UI and JS APIs exposed, and there's nothing stopping them from adding that. IMO browsers are just stuck with tech debt, and maintainin a no-longer-relevant distinction between "animations" and "videos". Every supported codec should work wherever GIF/APNG work and vice versa. It's not ev…

I wish browsers still paused all animations when the user hits the Esc key. It's hard to read when there are distracting animations all over most pages.

[deleted]

Re: A new PNG spec

#520

Earlier quoted context omitted.

For animations with lots of regions of solid color it could do very well.

So do most other video formats. I'm not really seeing any advantages, and I see a lot of disadvantages vs h264 and friends.

Not without lots of artifacts.
Post reply on HN