←back to thread

A new PNG spec

(www.programmax.net)
616 points bluedel | 7 comments | | HN request time: 1.127s | source | bottom
Show context
albert_e ◴[] No.44373786[source]
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.

replies(10): >>44373806 #>>44373868 #>>44374146 #>>44374225 #>>44374312 #>>44374556 #>>44374786 #>>44376132 #>>44379316 #>>44385628 #
riffraff ◴[] No.44373868[source]
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?

replies(6): >>44374218 #>>44374256 #>>44374550 #>>44374739 #>>44375571 #>>44385655 #
1. layer8 ◴[] No.44374256[source]
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 animations: https://www.randomnoun.com/wp/2013/10/27/windows-shell32-ani...

replies(1): >>44374716 #
2. fc417fc802 ◴[] No.44374716[source]
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

replies(2): >>44375025 #>>44385663 #
3. meindnoch ◴[] No.44375025[source]
False, or misleading.

The AV1 spec [1] does not allow RGB color spaces, therefore AV1 cannot preserve RGB animations in a bit-identical fashion.

[1] https://aomediacodec.github.io/av1-spec/av1-spec.pdf

replies(1): >>44378181 #
4. pornel ◴[] No.44378181{3}[source]
AV1 supports YCoCg, which encodes RGB losslessly.

It is a bit-reversible rotation of the RGB cube. It makes the channels look more like luma and chroma that the codec expects.

replies(1): >>44379922 #
5. meindnoch ◴[] No.44379922{4}[source]
False.

8-bit YCoCg (even when using the reversible YCoCg-R [1] scheme) cannot represent 8-bit RGB losslessly. The chroma channels would need 9 bits of precision to losslessly recover the original 8-bit RGB values.

[1] https://www.microsoft.com/en-us/research/wp-content/uploads/...

6. account42 ◴[] No.44385663[source]
> 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.

replies(1): >>44389491 #
7. fc417fc802 ◴[] No.44389491{3}[source]
Artifacts? We're talking about lossless compression here. There aren't any artifacts by definition.