News for hackers. Stuff that matters.
Re:PNG Is Back by fc417fc802 on Wednesday June 25, 2025 @03:58AM (#44374716)
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

Re:PNG Is Back by meindnoch on Wednesday June 25, 2025 @04:50AM (#44375025)
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

Re:PNG Is Back by pornel on Wednesday June 25, 2025 @11:04AM (#44378181)
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.

Re:PNG Is Back by meindnoch on Wednesday June 25, 2025 @01:42PM (#44379922)
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/...

Re:PNG Is Back by pornel on Thursday June 26, 2025 @10:17PM (#44393200)
AVIF 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.

Re:PNG Is Back by meindnoch on Friday June 27, 2025 @11:39AM (#44397658)
Show me any of the popular image conversion tools (avifenc, imagemagick, photoshop, ffmpeg, whatever...) that does the identity matrix hack when asking for lossless AVIF. None of them do it. Many people have been burned by "lossless" AVIF, where they converted their images in the mistaken belief that the result will be bit-identical to the original, only to find out that this wasn't the case, after they've deleted the original files.
Re:PNG Is Back by fc417fc802 on Friday June 27, 2025 @04:54PM (#44400131)
That's shifting the goalposts from what the standard supports to the current state of the ecosystem. It's certainly an interesting point though. If common implementations all have bugs regarding lossless encoding that's a pretty bad situation.
Re:PNG Is Back by account42 on Thursday June 26, 2025 @05:28AM (#44385663)
> 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:PNG Is Back by fc417fc802 on Thursday June 26, 2025 @01:35PM (#44389491)
Artifacts? We're talking about lossless compression here. There aren't any artifacts by definition.