HNHacker News
TopNewBestAskShowJobs

JyrkiAlakuijala

1,179 karma · joined June 29, 2016

submissionscomments
JyrkiAlakuijala··on Jpegli: A new JPEG coding library
https://twitter.com/jyzg/status/1622890389068718080

Some earlier results. Perhaps these were with XYB color space, I don't remember ...

JyrkiAlakuijala··on Jpegli: A new JPEG coding library
Chrome advised and inspired this work in their position about JPEG XL.

Here: https://www.mail-archive.com/blink-dev@chromium.org/msg04351...

"can we optimize existing formats to meet any new use-cases, rather than adding support for an additional format"

It's a yes!

Of course full JPEG XL is quite a bit better still, but this helps old compatible JPEG to support HDR without 8-bit banding artefacts or gainmaps, gives a higher bit depth for other uses where more precision is valuable, and quite a bit better compression, too.

JyrkiAlakuijala··on Jpegli: A new JPEG coding library
No denoising or deartifacting was used. They are an option for future improvements at low quality JPEG decoding.
JyrkiAlakuijala··on Jpegli: A new JPEG coding library
From a purely theoretical viewpoint 10+ bits encoding will lead into slightly better results even if rendered using a traditional 8 bit decoder. One source of error has been removed from the pipeline.
JyrkiAlakuijala··on Jpegli: A new JPEG coding library
I designed WebP lossless and implemented the first encoder for it. Zoltan who did most of the implementation work for jpegli wrote the first decoder.
JyrkiAlakuijala··on Jpegli: A new JPEG coding library
It was just easiest to develop in libjxl repo. All test workers etc. are already setup there. This was done by a very small team...
JyrkiAlakuijala··on Jpegli: A new JPEG coding library
We insert/extract about 2.5 bits more info from the 8 bit jpegs, leading to about 10.5 bits of precision. There is quite some handwaving necessary here. Basically it comes down to coefficient distributions where the distributions have very high probabilities around zeros. Luckily, this is the case for all smooth noiseless gradients where banding could be otherwise observed.
JyrkiAlakuijala··on Jpegli: A new JPEG coding library
Yes!
JyrkiAlakuijala··on Jpegli: A new JPEG coding library
I believe guetzli is slightly more robust around quality 94, but jpegli likely better at or equal at lower qualities like below 85. Jpegli is likely about 1000x faster and still good.
JyrkiAlakuijala··on JPEG XL Is a Stupid Name
The original names of the related tech was pik and huif. Also Guetzli, Brotli, Butteraugli, XYB, Brunsli, SSIMULACRA, FLIF, FUIF are related names.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
AVIF, AV1, WebP lossy and Opus use traditional arithmetic coding.

JPEG XL, Brunsli, Draco 3D and ZStd use table-based arithmetic coding (ANS).

JPEG, Deflate, Brotli, MP3, WebP lossless and the fastest mode of JPEG XL lossless use prefix coding.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
Jpegli has the possibility of using XYB. By default as by being just a replacement of mozjpeg or libjpeg-turbo it doesn't.

I believe Jon has compared jpegli without XYB. If you turn XYB on, you get about 10 % more compression.

Jpegli is great even without XYB. It has many other methods for success (largely copied over from JPEG XL adaptive quantization heuristics, more precise intermediate calculations, as well as the guetzli method for variable dead-zone quantization).

disclaimer: I created the XYB colorspace, most of the JPEG XL VarDCT quality-affecting heuristics, and scoped jpegli. Zoltan (from WOFF2/Brotli fame!) did the actual implementation and made it work so well.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
Yes, if local tone mapping is done by the operating system (windowing system or the monitor itself), then there is a chance that borders of windows are done appropriately within their spatial context.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
This depends on the quality you are aiming for.

You just cannot reach the best quality with 8 bits, not in SDR, not in HDR, not with gainmap HDR. Sometimes you don't care for a particular use case, and then 8 bits becomes acceptable. Many use cases remain where degradation by a compression system is unacceptable or creates too many complications.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
I think both approaches have advantages.

Requiring every game, photo viewing app, drawing program, ... every application to decide how to do it's HDR->SDR seems unnecessary complication due to poor abstractions.

The locality of local tone mapping (the ideal approach to HDR->SDR mapping) would expose the window boundaries. Two photos or two halves of the same photo in different windows (as opposed to being in the same window) would create an artificial discontinuity for the correction fields being artificially contained within each window instead of spanning the users visual field as best as possible.

Every local tone mapping needs to make an assumption of the surrounding colors: is the window surrounded by black, gray, colored or bright light should influence how the tone mapping is done at borders. This information is not available for an app: it can only be done at the windowing system level or in the monitor.

The higher the quality of the HDR->SDR mapping in a system, the more opportunity there is to limit the maximum brightness, and thus also the opportunity for energy savings.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
I didn't try it out, but I don't see the 9 bit coming. I feel it gives about 7.5 bits.

Mixing two independent quantization sources will lead to more error.

Some decoding systems such as traditional jpeg does not specify results exactly so bit-perfect quantization-aware compensation is not going to be possible.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
You could start with relatively good jpegli as a codec and then lossless recompress that with jpeg xl. Naturally some entity (server side, app, content encoding etc.) needs to unpack the jpeg xl jpeg into a usual jpeg before it can be consumed by a legacy system.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
It would be nice if everything was non tone-mapped HDR all the time for software, and the windowing system or the monitor would do the (local) tone mapping.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
Do you have a link? Or was it a private communication?
JyrkiAlakuijala··on JPEG XL and the Pareto Front
Companies and economies who optimize the cost of clients as if their own can see diffuse benefits from it. Even if they consider 0.01 % of that cost it can lead to better decisions. If that will make the website load faster or allow for more realistic product pictures, it can lead to faster growth or less returns etc.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
Another group of incompatibility with PNG was 16 bit coding. I had a plan to add it as simply sending two 8 bit images where the second image containing the 8 least significant bits would be predicted to be the same as the first. That way it would not be perfect, but it would be 100x better than how PNG deals with it. WebP had another plan for layers and tiles that never realized, and as a consequence WebP is stuck at 8 bits.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
We have been active on wasm implementations of jpeg xl but it doesn't really work with progressive rendering, HDR canvas was still not supported, threadpools and simd had hickups etc. etc. Browser wasn't and still isn't ready for high quality codecs as modules. We are continually giving gentle guidance for these but in the heart our small team is an algorithm and data format research group, not a technology lobbyist organization — so we haven't yet been successful there.

In the current scenario jpeg xl users are most likely to emerge outside of the web, in professional and prosumer photography, and then we will have — unnecessarily — two different format worlds. Jpeg xl for photography processing and a variety of web formats, each with their problems.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
People don't use blurry low quality images in the web. These low qualities don't matter outside of compression research.

Average/median quality of images is between 85 to 90 depending how you calculate it.

There, users' waiting time is worth during image formats life time for about 3 trillion USD. If we can reduce 20 % of it we create wealth of 600 billion USD distributed to the users. More savings come from data transfer costs.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
I designed the WebP lossless format, wrote the spec, and implemented the first encoder.

The constraint was in WebP lossy to facilitate exact compatibility with VP8 specification and hoping that it would allow hardware decoding and encoding of WebP images using VP8 hardware.

Hardware encoding and decoding were never used, but the limitation stuck.

There was no serious plan to do hardware lossless, but the constraint was copied for "reducing confusion".

I didn't and don't like it that much as more PNG images couldn't be represented as WebP lossless as a result of that.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
I believe JPEG XL binary size is about one third of AVIF binary size. It is relatively compact. It is easy to write a small encoder: libjxl-tiny is just 7000 lines of code.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
Or replace/ldconfig the jpeg library with the jpegli library. It is API/ABI compatible with libjpeg-turbo and mozjpeg.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
https://opensource.googleblog.com/2021/09/using-saliency-in-... can be interesting
JyrkiAlakuijala··on JPEG XL and the Pareto Front
That feels a little sad. If qoi had anything good (fast single-threaded decoding speed for photographic content) adding bz2 most certainly removed it. They could have just used WebP lossless and it would have been faster and smaller.
JyrkiAlakuijala··on JPEG XL and the Pareto Front
No bitstream changes. In JPEG XL we have a 3-bit control field for each 8x8 square to guide which pixels participate in smoothing.

The heuristics (here https://github.com/libjxl/libjxl/blob/main/lib/jxl/enc_ar_co...) for choosing that value are quite primitive and produces only two values: no smoothing and some smoothing (values 0 and 4).

If we replace those heuristics with a search that tries out which of the values is closest to the original, we should get better quality, especially at the lowest bitrates where smoothing is important.

JyrkiAlakuijala··on JPEG XL and the Pareto Front
WebP near-lossless is very far in compression density against that kind of visually lossless. Still 2-3x more bits I think. No reason to compare. The near-lossless (at settings 60 and 80) is closer to pixel perfect no matter how much you zoom, whereas Jon's "visually lossless" is what I'd rather call usual very high quality lossy without pixel precision guarantees.
← PreviousPage 4 of 13Next →