5 ms·
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 whate
by riffraff 1y ago
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?
- josephg 1y agoI doubt it, given png is a lossless compression format. For video thats almost never what you want.
- layer8 1y agoAPNG 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-animations/ https://www.randomnoun.com/wp/2013/10/27/windows-shell32-ani...
- fc417fc802 1y agoAll 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 https://trac.ffmpeg.org/wiki/Encode/AV1#Losslessencoding
- meindnoch 1y agoFalse, 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 https://aomediacodec.github.io/av1-spec/av1-spec.pdf
- pornel 1y agoAV1 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.
- meindnoch 1y agoFalse. 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/2016/06/Malvar_Sullivan_YCoCg-R_JVT-I014r3-2.pdf https://www.microsoft.com/en-us/research/wp-content/uploads/...
- pornel 1y agoAVIF supports 10 and 12 bit encoding, which losslessly fits the 9-bit rotation of 8-bit data. It's also possible to directly encode RGB (channels ordered as GBR) when you set identity matrix coefficients, it's just less efficient. I've implemented this in my AVIF encoder, so I know what I'm saying.
- armada651 1y ago> Can animated PNG beat av1 or whatever? Animated PNGs can't beat GIF nevermind video compression algorithms.
- jeroenhd 1y agoOnce you add more than 256 different colours in total, GIF explodes in terms of file size. It's great for small, compact images with limited colour information, but it can't compete with APNG when the image becomes more detailed than what you'd find on Geocities.
- pornel 1y agoNo, APNG explodes in size in that case. In APNG it's either the same 256 colors for the whole animation, or you have to use 24-bit color. That makes the pixel data 3 times larger, which makes zlib's compression window effectively 3 times smaller, hurting compression. OTOH GIF can add 256 new colors with each frame, so it can exceed 256 colors without the cost of switching all the way to 16.7 million colors.
- Aissen 1y ago> 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 http://littlesvr.ca/apng/gif_apng_webp.html Of course I don't think it generalizes all that well…
- deleted 1y ago[deleted]
- bmacho 1y agoI 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
- fc417fc802 1y ago> many gifs these days are actually served as soundless videos That's not really true. Some websites lie to you by putting .gif in the address bar but then serving a file of a different type. File extensions are merely a convention and an address isn't a file name to begin with so the browser doesn't care about this attempt at end user deception one way or the other.
- faceplanted 1y agoYou said that's not really true and the described exactly how it's true, what did you mean?
- fc417fc802 1y agoI parsed the comment as something along the lines of clever hackers somehow stuffing soundless videos into gif containers which is most certainly not what is going on. I was attempting to convey that they have nothing to do with gifs. Gifs are not involved anywhere in the process. I'm not sure why people disagree so strongly with what I wrote. Worst case scenario is that it's a slightly tangential but closely related rant about deceptive web design practices. Best case scenario is that someone who thought some sort of fancy trick involving gifs was in use learns something new.
- bawolff 1y agoIts also because people like to "pause" animations, and that is not really an option with apng & gif.
- bigfishrunning 1y agowhy 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
- pornel 1y agoIt'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 even a performance or complexity issue, e.g. browsers support AVIF "animations" as images, even though they're literally fully-featured AV1 videos, only wrapped in a "pretend I'm an image" metadata.
- joquarky 1y agoI 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 1y ago[deleted]
- nextaccountic 1y ago> 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 <video>
- 1y ago
- account42 1y agoSoundless 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.