News for hackers. Stuff that matters.
Re:PNG Is Back by qwertfisch on Wednesday June 25, 2025 @08:22AM (#44376468)
Seems a bit too late? And also, JPEG XL supports all the features and uses already advanced compression (finite-state entropy, like ZStandard). It offers lossy and lossless compression, animated pictures, HDR, EXIF etc.

There is just no need for a PNG update, just adopt JPEG XL.

Re:PNG Is Back by bmn__ on Wednesday June 25, 2025 @12:09PM (#44378892)
> just

https://caniuse.com/jpegxl

No one can afford to "just". Five years later and it's only one browser! Crazy.

Browser vendors must deliver, only then it's okay to admonish an end user or Web developer to adopt the format.

Re:PNG Is Back by Dylan16807 on Wednesday June 25, 2025 @03:58PM (#44381279)
Adopt it anyway. Add a decoder. Don't let google bully you out of such a good format.
Re:PNG Is Back by Aachen on Wednesday June 25, 2025 @08:55AM (#44376756)
> advanced compression (finite-state entropy, like ZStandard)

I've not tried it on images, but wouldn't zstandard be exceedingly bad at gradients? It completely fails to compress numbers that change at a fixed rate

Bzip2 does that fine, not sure why https://chaos.social/@luc/114531687791022934 The two variables (inner and outer loop) could be two color channels that change at different rates. Real-world data will never be a clean i++ like it is here, but more noise surely isn't going to help the algorithm compared to this clean example

Re:PNG Is Back by adgjlsfhk1 on Wednesday June 25, 2025 @10:06AM (#44377519)
the FSE layer isn't responsible for finding these sorts of patterns in an image codec. The domain modeling turns that sort of pattern into repeated data and then the FSE goes to town on the output.
Re:PNG Is Back by Retr0id on Wednesday June 25, 2025 @09:17AM (#44376987)
zlib/deflate already has the same issue. It is mitigated somewhat by PNG row filters.
Re:PNG Is Back by wongarsu on Wednesday June 25, 2025 @02:19PM (#44380331)
PNG's basic idea is to store the difference between the current pixel and the pixel above it, left of it or to the top-left (chosen once per row), then apply standard deflate compression to that. The first step basically turns gradients into repeating patterns of small numbers, which compress great. You can get decent improvements by just switching deflate for zstd
Re:PNG Is Back by Aachen on Thursday June 26, 2025 @02:20PM (#44389908)
> You can get decent improvements by just switching deflate for zstd

Maybe I sounded too critical of zstd. To be clear: I use it for general-purpose compression where available, the only exception would be where eeking out the last % gain is important and slow decompression is acceptable and it has one of these patterns that Bzip2 does better in the first place

That it's better than deflate (afaik aka gzip and zlib, just with different header fields) is not surprising since that was iirc the defined goal of Zstandard project

Re:PNG Is Back by spider-mario on Tuesday July 01, 2025 @10:37AM (#44434325)
JPEG XL is not “apply zstd to the pixel data”. What the parent comment meant is that JPEG XL, like zstd, happens to use ANS among its set of techniques. It handles gradients just fine.
Re:PNG Is Back by illiac786 on Wednesday June 25, 2025 @09:35AM (#44377176)
I really don’t get it. Why, but why? It’s already confusing as hell, why create yet another standard (variant) with no unique selling point?
Re:PNG Is Back by pmarreck on Wednesday June 25, 2025 @11:00AM (#44378143)
JPEG XL is not a "variant", it is a completely new algorithm that is also fully backwards-compatible with every single JPEG already out there, of which there are probably billions at this point.

It also has pretty much every feature desired in an image standard. It is future-proofed.

You can losslessly re-compress a JPEG into a JPEG-XL file and gain space.

It is a worthy successor (while also being vastly superior to) JPEG.

Re:PNG Is Back by BobaFloutist on Wednesday June 25, 2025 @11:22AM (#44378359)
Is there any risk that if I open a JPEG-XL in something that knows what a JPEG is but not what a JPEG-XL is and then save it, it'll get lossy compressed? Backwards compatibility is awesome, but I know that if I save/upload/share/copy a PNG, it shouldn't change without explicit edits, right?
Re:PNG Is Back by illiac786 on Wednesday June 25, 2025 @11:38AM (#44378533)
a sw that does not know what jpeg xl is, will not be able to open jxl files. How would it?

Not sure what the previous poster meant with “backward compatible” here. jxl is a different format. It can include every information a jpeg includes, which then maybe qualifies as “backward compatible” but it still is a different format.

Re:PNG Is Back by liuliu on Wednesday June 25, 2025 @12:28PM (#44379111)
JPEG XL has the mode that in layman's word, allow bit-by-bit round-trip with JPEG.

Original JPEG -> JPEG XL -> Recreated JPEG.

Sha256(Original JPEG) == Sha256(Recreated JPEG).

That's what people meant by "backward compatible".

Re:PNG Is Back by colejohnson66 on Wednesday June 25, 2025 @12:56PM (#44379451)
That’s not “backwards compatible”, but “round tripable” or “lossless reencode”
Re:PNG Is Back by illiac786 on Monday June 30, 2025 @05:43AM (#44421291)
exactly, it is absolutely not backward compatible. It is lossless-at-bit-level conversion of JPEG, but that doesn’t help older SW in any way.
Re:PNG Is Back by BobaFloutist on Wednesday June 25, 2025 @01:44PM (#44379945)
Ah, got it. I assumed it was a losselessly compressed JPEG with metadata telling modern software not to compress differently but that older software would open as a normal JPEG, but I guess they meant something else with "backward compatible".
Re:PNG Is Back by pmarreck on Friday June 27, 2025 @09:50AM (#44396806)
I guess I meant losslessly round-trippable. In other words, you can go from jpeg -> jxl -> jpeg without any loss in quality, potentially (although with jxl -> jpeg -> jxl, you will lose space while it is a jpeg, and you'd probably have to pick a high compression quality in order to not lose information... you may also lose information such as metadata that jxl accommodates but jpeg does not, like transparency)

So backwards-compatible in the sense that the jpeg-xl algorithm spec can read jpg and store the same pixel data more efficiently as jxl if you like. You gain space and lose nothing (except perhaps encode/decode speed).

Re:PNG Is Back by dylan604 on Wednesday June 25, 2025 @11:28AM (#44378429)
> You can losslessly re-compress a JPEG into a JPEG-XL file and gain space.

Is that gained space enough to account for the fact you now have 2 files? Sure, you can delete the original jpg on the local system, but are you going to purge your entire set of backups?

Re:PNG Is Back by illiac786 on Wednesday June 25, 2025 @11:35AM (#44378510)
if you do not want to delete the original jpeg, there is no point in converting them to jpeg xl I would say.

Unless serving jxl and saving bandwidth, while increasing your total storage, is worth it to you.

Re:PNG Is Back by account42 on Thursday June 26, 2025 @06:02AM (#44385844)
Yes the whole point of lossless re-compression is that you do not need to keep the original JPEGs. Of course you don't need to "purge" backups, just let them rotate out normally.

Also backup storage is usually cheaper than something that needs to have fast access speeds.

Re:PNG Is Back by dylan604 on Thursday June 26, 2025 @12:13PM (#44388781)
For people that shoot digital cameras saving as JPEG, it will a very cocky suggestion to tell them to toss out their camera original files!

You'll know JPEG-XL if real when camera manufactures allow for XL acquisition instead of legacy JPEG only.

Re:PNG Is Back by spider-mario on Tuesday July 01, 2025 @10:20AM (#44434164)
> For people that shoot digital cameras saving as JPEG, it will a very cocky suggestion to tell them to toss out their camera original files!

But they can recover them from the JXL files, so are they really “tossed out”? It’s not really different than any other form of lossless compression.

Re:PNG Is Back by illiac786 on Wednesday June 25, 2025 @11:02AM (#44378163)
I was referring to the new PNG, not to JPEG XL.
Re:PNG Is Back by sdenton4 on Wednesday June 25, 2025 @11:30AM (#44378454)
Looking at TFA, it's placing in the spec a few things that are already widely stacked onto the format (such as animation). This is a very sensible update, and backwards compatible with existing PNG.
Re:PNG Is Back by illiac786 on Wednesday June 25, 2025 @11:39AM (#44378545)
Not sure expanding PNG capabilities is sensible, looking at the overall landscape of image formats.
Re:PNG Is Back by dveditz_ on Wednesday June 25, 2025 @03:39PM (#44381140)
The capabilities are already expanded in most common implementations. This update is largely blessing those features as officially "standard".
Re:PNG Is Back by mikae1 on Wednesday June 25, 2025 @12:21PM (#44379025)
> There is just no need for a PNG update, just adopt JPEG XL.

Tell that to Google. They gave up on XL in Chrome[1] and essentially killed its adoption.

[1] https://issues.chromium.org/issues/40168998#comment85

Re:PNG Is Back by rhet0rica on Wednesday June 25, 2025 @05:48PM (#44382114)
From reading that, "gave up" seems to mean "deliberately killed it so their own WebP2 wouldn't have competition." Behold the monopoly at the apex of its power.
Re:PNG Is Back by account42 on Thursday June 26, 2025 @06:05AM (#44385856)
The really weird part is that both webp and jxl developments were largely funded by Google so its not Google killing a competitors format over their own but someone in one part of Google killing the format someone elsewhere in Google developed over their pet favorite.
Re:PNG Is Back by rhet0rica on Thursday June 26, 2025 @06:11PM (#44391989)
There's no form of cloak-and-dagger BS more vicious than internecine BS.
Re:PNG Is Back by spauldo on Thursday June 26, 2025 @12:53PM (#44389120)
PNG went through that when Microsoft kept throwing incomplete and buggy support for it in IE. Hopefully something will come along to buck Chrome's monopoly and JPEG-XL will have its chance.
Re:PNG Is Back by pezezin on Thursday June 26, 2025 @02:46AM (#44384817)
On the other hand, more and more software are adding support for JPEG XL. Photoshop just added it in the latest patch (https://helpx.adobe.com/photoshop/using/whats-new/2025-6.htm...), Apple has included it in the iPhone 16, it is easily available on Windows (https://apps.microsoft.com/detail/9mzprth5c0tb?hl=en-US&gl=U...), most major Linux distros already support it...

It is only a matter of time until the Chrome team has to reverse their decision.

Re:PNG Is Back by Dwedit on Thursday June 26, 2025 @03:07AM (#44384951)
If JPEG-XL decompressed faster, I'd use it more. For now, I'm sticking with WEBP for lossless, and AVIF for lossy. AVIF's CDEF filter (directional deringing) works wonders, and it's too bad that JPEG-XL lacks such a filter.

JPEG-XL's lossy modular mode is a very unique feature which needs a lot more exposure than it has. It is well-suited to non-photographic drawings or images that aren't continuous, and have never touched any JPEG-like codecs. It has different kinds of artifacts than what you typically see in a DCT image codec. Rather than ringing, you get slight pixellation.

Re:PNG Is Back by stgn on Thursday June 26, 2025 @03:53PM (#44390664)
> and it's too bad that JPEG-XL lacks such a filter

JPEG XL has an edge-preserving filter ("EPF") for the purpose of reducing ringing.