JPEG XL

Info

rules 57
github 35276
reddit 647

JPEG XL

tools 4225
website 1655
adoption 20712
image-compression-forum 0

General chat

welcome 3810
introduce-yourself 291
color 1414
photography 3435
other-codecs 23765
on-topic 24923
off-topic 22701

Voice Channels

General 2147

Archived

bot-spam 4380

jxl

Anything JPEG XL related

Jyrki Alakuijala
2025-03-02 07:19:11
but it seems I have made a mistake that makes (at least in some cases, if not most) the better approach to behave worse
2025-03-02 07:19:33
I don't want to guess what it is, I don't know enought and I want to keep the most open and humble mind for debugging
BlueSwordM
Jyrki Alakuijala previously I used ad hoc systems (basically very strange functions that appeared in my head) to decide the smoothing
2025-03-02 07:19:35
Oh, so it's mostly an issue related to post filters, not actual image coding. Is there a bistream analyzer that can analyze a JPEG-XL image? I'd love to work more on JXL ever since I've picked up more skills in video codec development.
Jyrki Alakuijala
2025-03-02 07:19:48
but it is 100 % clear that it is on my plate
2025-03-02 07:20:44
JPEG XL Rust decoder would likely need more hands
2025-03-02 07:21:05
or if you like, I could debug this together with you -- I could show how I'd approach it and what I would try in fixing it
2025-03-02 07:21:27
I'll try to avoid rollbacking it because it is just far better approach as is
2025-03-02 07:21:59
the heuristic is L2 related if I remember, and does the matching based on L2 (or perhaps L4, not sure, need to dive into the code again)
veluca
BlueSwordM Oh, so it's mostly an issue related to post filters, not actual image coding. Is there a bistream analyzer that can analyze a JPEG-XL image? I'd love to work more on JXL ever since I've picked up more skills in video codec development.
2025-03-02 07:22:35
If you want to write Rust you're very welcome!
BlueSwordM
2025-03-02 07:22:49
Hello Luca, it's been a while ๐Ÿ˜„
veluca
2025-03-02 07:23:12
I still need to find enough time in a row to put together the main skeleton of the modular decoder, there's already a good amount of stuff to do but that would unblock even more ๐Ÿ™‚
Jyrki Alakuijala
2025-03-02 07:23:19
The JPEG XL Rust community is lively, intelligent and things are happening with speed -- and it is less mysterious than encoder quality topics ๐Ÿ˜„
2025-03-02 07:27:08
is it common knowledge here that Microsoft seemed to have published a JPEG XL plugin https://apps.microsoft.com/detail/9mzprth5c0tb?hl=en-US&gl=CH
couleur
2025-03-02 07:27:53
hi bluesword!!
BlueSwordM
2025-03-02 07:28:10
Hi couleur.
A homosapien
BlueSwordM Oh, so it's mostly an issue related to post filters, not actual image coding. Is there a bistream analyzer that can analyze a JPEG-XL image? I'd love to work more on JXL ever since I've picked up more skills in video codec development.
2025-03-02 07:34:00
The image coding did definitely change though, it seems like 0.8 uses smaller block sizes compared to newer versions. Left 0.8 right 0.11, same bpp.
2025-03-02 07:34:19
2025-03-02 07:34:20
This might be relevant, although I'm not sure if it's the cause of the regression
BlueSwordM
A homosapien The image coding did definitely change though, it seems like 0.8 uses smaller block sizes compared to newer versions. Left 0.8 right 0.11, same bpp.
2025-03-02 07:34:25
What tool are you using?
A homosapien
2025-03-02 07:34:44
the java decoder, jxlatte
jonnyawsom3
BlueSwordM Oh, so it's mostly an issue related to post filters, not actual image coding. Is there a bistream analyzer that can analyze a JPEG-XL image? I'd love to work more on JXL ever since I've picked up more skills in video codec development.
2025-03-02 07:41:15
Most internal libjxl debug views are currently broken due to changes over the years, however jxl-oxide allows viewing hidden frames, metadata and chunk offsets using `jxl-oxide -I --all-frames --with-offset input.jxl` jxlatte allows debug views of VarDCT block selection with `jxlatte.jar --draw-varblocks input.jxl VarDCT.png`
A homosapien The image coding did definitely change though, it seems like 0.8 uses smaller block sizes compared to newer versions. Left 0.8 right 0.11, same bpp.
2025-03-02 07:46:41
Looking at that, it seems like large blocks were outright disabled in 0.8, so there should be room for both quality and density improvements between them
A homosapien
2025-03-02 07:47:04
Ah yes, I forgot about that
BlueSwordM
A homosapien The image coding did definitely change though, it seems like 0.8 uses smaller block sizes compared to newer versions. Left 0.8 right 0.11, same bpp.
2025-03-02 08:12:23
What I want to see specifically is how the large blocks are quantized. Larger blocks don't necessarily have lower fidelity.
_wb_
2025-03-02 08:22:51
Don't forget that large blocks get some of their AC coeffs encoded as part of the LF image already. E.g. a 32x32 block has 4x4 LF coeffs, so not just the DC but also 15 low freq AC coeffs. The quantization of all LF is the same. Adaptive quantization only applies to the rest of the coeffs, only the HF.
A homosapien
BlueSwordM What I want to see specifically is how the large blocks are quantized. Larger blocks don't necessarily have lower fidelity.
2025-03-02 08:33:32
No such tool exists yet
_wb_
2025-03-02 08:34:22
Libjxl can visualize the adaptive quantmap
2025-03-02 08:35:20
benchmark_xl has some option to get debug images
jonnyawsom3
Most internal libjxl debug views are currently broken due to changes over the years, however jxl-oxide allows viewing hidden frames, metadata and chunk offsets using `jxl-oxide -I --all-frames --with-offset input.jxl` jxlatte allows debug views of VarDCT block selection with `jxlatte.jar --draw-varblocks input.jxl VarDCT.png`
2025-03-02 08:35:59
Assuming they still work... I can't get any output from benchmark_xl anymore, even just output images
_wb_
2025-03-02 08:38:16
Yeah you might need to edit some code to make it work again.
juliobbv
A homosapien
2025-03-02 10:33:11
I don't think these two issues are directly related to each other. In AV1 specifically, 64pt transforms only retain the first 32 coefficients (as a hardware saving measure), so for e.g. a 64x64 TX, the encoder only considers 1/4 of the coeffs (upper left quadrant), truncating the rest. Therefore these larger transforms are a bit "blurry" by design. AFAIK, JPEG XL considers all coefficients during quant/dequant no matter the transform size. Please let me know if I'm wrong.
DZgas ะ–
couleur is it possible to convert jpeg to jxl, and convert it back to jpeg bit perfectly?
2025-03-02 10:36:49
back to jpeg? from jpeg xl? no
Orum
2025-03-02 10:38:36
uhhh, it should be
jonnyawsom3
2025-03-02 10:46:22
```cjxl derpy.jpg derpy.jxl JPEG XL encoder v0.11.0 0185fcd [AVX2,SSE2] Note: Implicit-default for JPEG is lossless-transcoding. To silence this message, set --lossless_jpeg=(1|0). Encoding [JPEG, lossless transcode, effort: 7] Compressed to 21296 bytes including container djxl derpy.jxl reconstructed.jpg JPEG XL decoder v0.12.0 3d7cec2 [AVX2,SSE2] Reconstructed to JPEG. 910 x 461, 6.315 MP/s [6.31, 6.31], 0.415 MB/s [0.42, 0.42], 1 reps, 16 threads. 27,593 derpy.jpg 21,296 derpy.jxl 27,593 reconstructed.jpg```
2025-03-02 10:46:24
Yes
DZgas ะ–
2025-03-02 10:54:11
no way <:monkaMega:809252622900789269>
HCrikki
2025-03-02 11:19:21
its a unique capability no other media format has. normally youre supposed to either end up with a much larger lossless output, OR or a degraded quality output thats not even guaranteed to have a smaller filesize AND still takes long to encode (you can lower the target quality until it becomes smaller, but it worsens generational loss further)
Demiurge
2025-03-03 12:32:02
I would rather have a grainy-looking type of blur that preserves texture and grit and high-frequency spectrum energy... than just play-doh smooth or blocky/smearing blur that is so typical and jarring in current libjxl and most other notoriously poor codecs
2025-03-03 12:32:48
Like in really bad hardware AV1 coders or early versions of libaom
2025-03-03 12:34:02
grain and high-frequency energy does a good job of masking blur and other artifacts.
couleur
```cjxl derpy.jpg derpy.jxl JPEG XL encoder v0.11.0 0185fcd [AVX2,SSE2] Note: Implicit-default for JPEG is lossless-transcoding. To silence this message, set --lossless_jpeg=(1|0). Encoding [JPEG, lossless transcode, effort: 7] Compressed to 21296 bytes including container djxl derpy.jxl reconstructed.jpg JPEG XL decoder v0.12.0 3d7cec2 [AVX2,SSE2] Reconstructed to JPEG. 910 x 461, 6.315 MP/s [6.31, 6.31], 0.415 MB/s [0.42, 0.42], 1 reps, 16 threads. 27,593 derpy.jpg 21,296 derpy.jxl 27,593 reconstructed.jpg```
2025-03-03 11:42:53
do the checksums match?
RaveSteel
2025-03-03 11:44:52
Yes, if no error occured
BlueSwordM
Demiurge I would rather have a grainy-looking type of blur that preserves texture and grit and high-frequency spectrum energy... than just play-doh smooth or blocky/smearing blur that is so typical and jarring in current libjxl and most other notoriously poor codecs
2025-03-03 03:44:29
Unfortunately, getting that kind of blur is very hard.
jonnyawsom3
2025-03-03 03:59:23
`--photon_noise_iso 250000`
Mine18
Jyrki Alakuijala is it common knowledge here that Microsoft seemed to have published a JPEG XL plugin https://apps.microsoft.com/detail/9mzprth5c0tb?hl=en-US&gl=CH
2025-03-03 04:50:24
it was posted here recently, so a fair number of active users would be aware of it https://discord.com/channels/794206087879852103/803574970180829194/1345719825552511046
Traneptora
BlueSwordM What tool are you using?
2025-03-03 08:18:00
jxlatte has `--draw-varblocks`
2025-03-03 08:18:14
still gotta fix a few known bugs though
Demiurge
BlueSwordM Unfortunately, getting that kind of blur is very hard.
2025-03-03 08:34:11
Not really, dct was basically designed to make it easy to preserve spectral energy while lowering the precision at the same time
2025-03-03 08:37:17
Instead of totally wiping away high frequency information with blurring and smearing, it can be preserved with lower precision dct residuals
2025-03-03 08:38:10
That's why dct is good at preserving grit and texture. When done right. There's no excuse for ugly smearing.
2025-03-03 08:39:32
dct's typical weakness is ugly block artifacts. Not blurring/smearring
2025-03-03 08:42:44
DCT is a very good tool for preserving sharpness and grit and texture especially at typical viewing distances where the blocks are harder to notice
_wb_
2025-03-03 08:44:02
It all depends on how steep your quant matrices are, you can make them steeper and be more blurry but less blocky/bandy, or you can make them flatter and get blocky before you get blurry
2025-03-03 08:44:39
(where with steep I mean the higher frequencies get much coarser quantization than the lower freqs)
2025-03-03 08:45:23
The default quant tables of jxl are quite ok
Demiurge
2025-03-03 08:45:26
Someone had to intentionally design the encoder to blur and discard high frequency information instead of attempting to preserve it at low precision. Like you said, steep quant matrices where the high freq coeffs are 0
_wb_
2025-03-03 08:46:03
One of the weaknesses of avif/av1 is that you cannot really do custom quant tables, you can only pick from 15 presets or so iirc
Demiurge
2025-03-03 08:46:35
Block boundary artifacts can be harder to notice through a lot of high frequency noise
2025-03-03 08:46:48
Especially if it's spread around
2025-03-03 08:47:13
Call it "blue noise blurring" if you wanna sound cool and fancy ๐Ÿ˜Ž
BlueSwordM
Demiurge Instead of totally wiping away high frequency information with blurring and smearing, it can be preserved with lower precision dct residuals
2025-03-03 08:47:13
The problem is that retaining the same general **form** of grain is hard.
Demiurge
2025-03-03 08:49:23
Macroblocking artifacts can potentially be psychovisually "masked" with noise
2025-03-03 08:50:01
Macroblocking is a combination of low frequency and high frequency distortion
2025-03-03 08:50:52
Since its at regular intervals centered on the edge of blocks
AccessViolation_
2025-03-03 09:03:59
out of curiosity, was the idea of customizable predictors ever explored? as in, you could signal one of the predefined predictors in an MA tree leaf, *or* you could define your own as a simple arithmetic equation using these available pixel positions. like for example if the encoder wanted to make it `(NW + NE) / 2`, it could
2025-03-03 09:09:50
I guess this would make the search space too large for the encoder to actually make use of it, and be very slow during decode
lenscap
2025-03-03 09:31:21
<@794205442175402004> just saw your bluesky post about an upcoming paper on JXL. Definitely interested, have any links to it?
monad
lenscap <@794205442175402004> just saw your bluesky post about an upcoming paper on JXL. Definitely interested, have any links to it?
2025-03-03 09:34:59
this one? https://discord.com/channels/794206087879852103/822105409312653333/1346162085289267292
lenscap
monad this one? https://discord.com/channels/794206087879852103/822105409312653333/1346162085289267292
2025-03-03 09:36:21
maybe... am unsure. Didn't have any specifics... but thought whatever it was would be worth reading. ๐Ÿ™‚ I'll check out the one you mentioned. Thanks!
AccessViolation_
lenscap maybe... am unsure. Didn't have any specifics... but thought whatever it was would be worth reading. ๐Ÿ™‚ I'll check out the one you mentioned. Thanks!
2025-03-03 09:43:41
that's the one yeah :)
_wb_
2025-03-03 10:24:40
Yep that's the one
juliobbv
_wb_ One of the weaknesses of avif/av1 is that you cannot really do custom quant tables, you can only pick from 15 presets or so iirc
2025-03-03 10:29:30
I've done some recent work on understanding AV1 QMs, and it turns out they're surprisingly challenging to improve on
2025-03-03 10:30:54
despite those having unusual properties that you don't see in other QMs, removing those properties tends to harm subjective and/or objective quality
2025-03-03 10:32:17
so in practice, the preset QMs tend to be good enough -- you just need to pick the right level
2025-03-03 10:34:07
I suspect the original author (from Thor) authored those QMs by factoring in modern video codec prediction modes to fit like a glove
jonnyawsom3
AccessViolation_ out of curiosity, was the idea of customizable predictors ever explored? as in, you could signal one of the predefined predictors in an MA tree leaf, *or* you could define your own as a simple arithmetic equation using these available pixel positions. like for example if the encoder wanted to make it `(NW + NE) / 2`, it could
2025-03-03 10:50:33
At first I thought you had re-invented JXL art, but I don't *think* that was. The existing predictors can already cover most cases that mixing them would be useful
AccessViolation_
2025-03-03 10:55:37
yeah that's fair. i guess with it usually only using two predictors in most cases anyway, using more than the dozen or so that are available wouldn't really be worthwhile probably
jonnyawsom3
2025-03-04 12:00:35
As a refresher ```if [property] > [value:int] (THEN BRANCH) (ELSE BRANCH) Both the THEN branch and the ELSE branch can either be another decision node or a leaf node. The following properties can be used in a decision node: c: the channel number, where 0=R, 1=G, 2=B, 3=A (if Alpha was enabled in the header) g: the group number (useful in case the image is larger than one group). Modular group numbers usually start with 21. x, y: coordinates N: value of pixel above (north) W: value of pixel to the left (west) |N|: absolute value of pixel above (north) |W|: absolute value of pixel to the left (west) W-WW-NW+NWW: basically the error of the gradient predictor for the pixel on the left W+N-NW: value of gradient predictor (before clamping) W-NW: left minus topleft, i.e. error of the N predictor for the pixel on the left NW-N: topleft minus top, i.e. error of W predictor for the pixel above N-NE: top minus topright, i.e. error of W predictor for pixel on top right N-NN: top minus toptop, i.e. error of N predictor for pixel above W-WW: left minus leftleft, i.e. error of W predictor for the pixel on the left WGH: signed max-absval-error of the weighted predictor Prev: the pixel value in this position in the previous channel PPrev: the pixel value in this position in the channel before the previous channel PrevErr: the difference between pixel value and the Gradient-predicted value in this position in the previous channel PPrevErr: like PrevErr, but for the channel before that PrevAbs, PPrevAbs, PrevAbsErr, PPrevAbsErr: same as the above, but the absolute value (not the signed value)```
2025-03-04 12:00:39
```Leaf nodes are of the following form: - [predictor] +-[offset:int] The following predictors are supported in leaf nodes: Set: always predicts zero, so effectively sets the pixel value to [offset] W: value of pixel on the left N: value of pixel above NW: value of topleft pixel NE: value of topright pixel WW: value of pixel to the left of the pixel on the left Select: predictor from lossless WebP Gradient: W+N-NW, clamped to min(W,N)..max(W,N) Weighted: weighted sum of 4 self-correcting subpredictors based on their past performance (warning: not clamped so can get out of range) AvgW+N,AvgW+NW,AvgN+NW,AvgN+NE: average of two pixel values AvgAll: weighted sum of various pixels: (6 * top - 2 * toptop + 7 * left + 1 * leftleft + 1 * toprightright + 3 * topright + 8) / 16 Edge cases: If x=y=0, W is set to 0. Otherwise, if x=0, W is set to N. If y=0, N is set to W. If x=0 or y=0, NW is set to W. Similarly, NE and NN fall back to N and WW falls back to W.```
Naksu
2025-03-04 02:08:44
Hi, I see that Microsoft has made its JPEG XL extension public. Is this finally a way to get thumbnails on Windows, or were there other solutions before?
username
Naksu Hi, I see that Microsoft has made its JPEG XL extension public. Is this finally a way to get thumbnails on Windows, or were there other solutions before?
2025-03-04 02:12:02
https://github.com/saschanaz/jxl-winthumb
Traneptora
2025-03-04 02:12:07
now we just need discord to support JPEG XL!
2025-03-04 02:12:18
since it's based on electron, which is based on chromium....
2025-03-04 02:12:19
hm.
username
2025-03-04 02:12:55
Discord recently added "support" for AVIF via converting them to WebP for display
2025-03-04 02:13:11
I guess the same could be done for JXL ๐Ÿคท
lonjil
2025-03-04 02:13:39
Discord only added support for uploading and displaying webp images a couple of years ago even though it's been in chromium for over a decade ๐Ÿ˜†
Naksu
username https://github.com/saschanaz/jxl-winthumb
2025-03-04 02:15:03
Thanks! I guess it's better than the official solution?
2025-03-04 02:54:22
Hmm, that doesn't seem to work for me.
username
2025-03-04 02:55:22
Microsoft store one or GitHub one?
Naksu
2025-03-04 02:55:33
Github one
username
2025-03-04 02:56:45
did it say something like this at any point?
Naksu
2025-03-04 02:57:58
Yep
username
2025-03-04 03:02:50
hmm maybe restart Windows? oh also the DLL needs to stay in the same place/location that you ran the commend on it. If none of that works then I'm not sure what the problem is however if you are on Win11 then the Microsoft store one should work fine enough
Naksu
2025-03-04 03:06:14
It's been 42 days since I last restarted it, so it shouldn't hurt. Otherwise, yeah, I'm on W11, but an older version that's not compatible with Microsoft's plugin.
couleur
Traneptora since it's based on electron, which is based on chromium....
2025-03-04 04:28:57
there might be a vencord plugin for that
Traneptora
2025-03-04 04:30:35
eh, unless vanilla supports it im not able to upload jxl
Demiurge
2025-03-04 05:00:19
Discord requires webp to work
2025-03-04 05:00:48
Almost every bitmap is in webp format
2025-03-04 05:01:20
If you disable webp, discord breaks, even if you remove it from http accept headers
2025-03-04 05:09:49
No one should ever actually consider installing the official discord election app... but if they wanted to support jxl they could use the existing js polyfill, that's probably the simplest way for them to do it until Chrome bends the knee... https://github.com/niutech/jxl.js
2025-03-04 05:14:42
Or, alternatively, they could just add support only to their thumbnail/preview generator lilliput.
2025-03-04 05:18:53
That is required for previews to work like with other image formats
Quackdoc
2025-03-04 06:16:57
if you use chrome with better discord you can install a teivally modified embed more formats extension. but I just use dissent which supports jxl
2025-03-04 06:17:27
there is a webapp called fshcord which also embeds jxl
Demiurge
2025-03-04 06:57:57
Fishcord?
Quackdoc
2025-03-05 01:42:17
https://github.com/fsh-org/Fshcord
2025-03-05 01:42:20
fsh
couleur
Quackdoc https://github.com/fsh-org/Fshcord
2025-03-05 02:40:14
got screenshots?
Quackdoc
2025-03-05 03:01:46
not off hand
2025-03-06 09:03:21
Out in New Brunswick now, stuck on road at 5 am, anybody who says that JXL is useless, is quite frankly an idiot. JXL is coming in clutch with out 400kbps internet
CrushedAsian255
Quackdoc Out in New Brunswick now, stuck on road at 5 am, anybody who says that JXL is useless, is quite frankly an idiot. JXL is coming in clutch with out 400kbps internet
2025-03-06 09:04:25
Wouldnโ€™t AVIF be better for that kind of ultra low bandwidth at least right now with current encoders?
Quackdoc
2025-03-06 09:04:54
I want it to still look good tho
2025-03-06 09:06:24
prog decoding king
A homosapien
2025-03-06 09:08:18
progressive decoding still matters in 2025
username
2025-03-06 09:12:12
it always has. people who say it doesn't probably have fiber, live next to data centers, only go to centralized websites, and never go on the internet outside a city or something
Quackdoc
2025-03-06 09:16:32
I used to be in sticks but not like this, thankfully tommorow I will have starlink, but for now, low speed unlimited data for now with 1 bar lol
Orum
2025-03-06 09:20:38
๐Ÿ‡จ๐Ÿ‡ฆ: "We hate everything from the ๐Ÿ‡บ๐Ÿ‡ธ and won't buy it!" meanwhile, someone in ๐Ÿ‡จ๐Ÿ‡ฆ: "Yes I'll take Starlink please."
Mine18
username it always has. people who say it doesn't probably have fiber, live next to data centers, only go to centralized websites, and never go on the internet outside a city or something
2025-03-06 09:21:19
even then, its nice to have the image load partially so you can actually look at it quicker, so prog decoding would benefit everyone who looks at stuff
Quackdoc
Orum ๐Ÿ‡จ๐Ÿ‡ฆ: "We hate everything from the ๐Ÿ‡บ๐Ÿ‡ธ and won't buy it!" meanwhile, someone in ๐Ÿ‡จ๐Ÿ‡ฆ: "Yes I'll take Starlink please."
2025-03-06 09:28:27
hey, I don't care what whoever does, if I get faster then 512kbps I'm happy
2025-03-06 09:29:09
I have dealt with dialup internet as late as 2014, it is pain
Rasky
2025-03-06 09:34:36
In upgrading a commercial software that used jpg internally for data storage to use jxl instead for higher quality / smaller size, we noticed an issue that I don't know if it's expected or not. It seems that recompressing the same image multiple times the same jxl with the same settings, progressively introduces more and more artifacts into the image. This wasn't the case with jpg. Now this can be categorized as a bug in our software, but in any case bugs happen and once the images are destroyed, they are destroyed. I wonder if this is something that it's expected of the JXL format or not, and it's expected to behave (much) worse than JPG in this regard
Demiurge
CrushedAsian255 Wouldnโ€™t AVIF be better for that kind of ultra low bandwidth at least right now with current encoders?
2025-03-06 09:59:17
No, since it needs to download the entire image first before you can even begin decoding, then you have to wait for the decoder to finish completely before an image can be displayed.
2025-03-06 10:00:02
With JXL you can start decoding while it's still downloading and get a good preview with less than 1/10th of the image downloaded.
2025-03-06 10:00:24
There's no comparison with AVIF at all
2025-03-06 10:00:39
For limited bandwidth connections
CrushedAsian255
2025-03-06 10:02:48
ahh i forgot about progressive decoding
Demiurge
Rasky In upgrading a commercial software that used jpg internally for data storage to use jxl instead for higher quality / smaller size, we noticed an issue that I don't know if it's expected or not. It seems that recompressing the same image multiple times the same jxl with the same settings, progressively introduces more and more artifacts into the image. This wasn't the case with jpg. Now this can be categorized as a bug in our software, but in any case bugs happen and once the images are destroyed, they are destroyed. I wonder if this is something that it's expected of the JXL format or not, and it's expected to behave (much) worse than JPG in this regard
2025-03-06 10:03:01
Older versions of the libjxl encoder were designed to be more resistant to generation loss. There are still some encoder settings you can adjust to reduce generation loss, ask one of the other encoder experts here. I don't remember all the flags or effort-levels off the top of my head, but the important ones are disabling gaborish and epf
2025-03-06 10:03:37
Some JPEG1 encoders are extremely resilient to generation loss too. That's why you're noticing less generation loss there.
2025-03-06 10:04:02
I think jpegli (included with libjxl) might also be very resilient to generation loss
2025-03-06 10:04:22
Hope this helps explain what you're seeing :)
Rasky
2025-03-06 10:05:07
yes, thanks even just the "generation loss" term helps ๐Ÿ™‚
2025-03-06 10:05:44
i'll wait if someone can suggest encoder settings, we might have to patch something in untill we devise a proper solution
Demiurge
Rasky yes, thanks even just the "generation loss" term helps ๐Ÿ™‚
2025-03-06 10:07:09
Yes, also it's usually very discouraged to subject images to multiple rounds of "lossy" transformations where small errors can accumulate. a lossless encoder is recommended as the best tool for images that will be subjected to transformation and compression multiple times.
username
Rasky i'll wait if someone can suggest encoder settings, we might have to patch something in untill we devise a proper solution
2025-03-06 10:07:35
what encode settings are being used currently? additionally what version of libjxl and also what was being used for JPEG encoding (library/encoder and encode settings)?
2025-03-06 10:07:49
for the most part only the first question of mine matters
Demiurge
2025-03-06 10:08:11
For lossy JXL you should disable EPF and gabor filters, or try a lower effort setting (default effort level is 7)
Rasky
2025-03-06 10:08:46
Demiurge
2025-03-06 10:08:49
in cjxl, if you set distance = zero, you have lossless mode
Rasky
2025-03-06 10:09:00
just a small sample of the artifacts
2025-03-06 10:09:45
this is originally a cad generated image so it's vector graphics so to speak
username
2025-03-06 10:11:26
are all images that go through this software from cad or just this sample?
Demiurge
2025-03-06 10:11:28
`--epf 0 --gaborish 0` for lossy mode will help, if you are using cjxl.
Rasky
2025-03-06 10:11:32
no not all of them
2025-03-06 10:11:37
it's one specific use case though
2025-03-06 10:11:42
others are pictures taken with cameras
2025-03-06 10:12:08
we know which is which btw so we could use different encoder settings of course
2025-03-06 10:12:13
i'm tring to see what we use now exactly
Demiurge
2025-03-06 10:12:58
If you are using lossless mode, and you find lossless compression is too slow, lower the effort value to 2 for example.
Rasky
2025-03-06 10:13:08
we are using a slightly lossy mode
A homosapien
Demiurge `--epf 0 --gaborish 0` for lossy mode will help, if you are using cjxl.
2025-03-06 10:13:15
Gaborish is the primary source of generation loss, EPF is fine as far as I know
Demiurge
2025-03-06 10:13:15
`--distance 0 --effort 2` is extremely fast and good.
Rasky
2025-03-06 10:13:19
quality 95 i think
2025-03-06 10:14:46
we use libjxl directly (not spawning cjxl)
A homosapien
Rasky quality 95 i think
2025-03-06 10:14:50
Try quality 95.6 (mapped to a distance of =>0.5). It disables Gaborish by default and should reduce generation loss
Demiurge
A homosapien Gaborish is the primary source of generation loss, EPF is fine as far as I know
2025-03-06 10:15:06
epf is a pre/post filter in the same category as gaborish. I doubt it has no effect on generation loss.
CrushedAsian255
2025-03-06 10:15:16
For high quality CAD and other synthetic images, lossless is quite often (i would probably say almost akways) a better pick over lossy.
username
A homosapien Try quality 95.6 (mapped to a distance of =>0.5). It disables Gaborish by default and should reduce generation loss
2025-03-06 10:15:34
*in newer versions of libjxl (I forget the date exactly)
Demiurge
Rasky we use libjxl directly (not spawning cjxl)
2025-03-06 10:16:02
no problem, the api provides nearly identical options and knobs as cjxl.
A homosapien
Demiurge epf is a pre/post filter in the same category as gaborish. I doubt it has no effect on generation loss.
2025-03-06 10:16:21
It's mostly Gaborish, not epf https://github.com/libjxl/libjxl/issues/3458
CrushedAsian255
2025-03-06 10:16:23
cjxl is basically just a wrapper for libjxl
Rasky
2025-03-06 10:17:38
i think we're using JxlEncoderDistanceFromQuality() and then JxlEncoderSetFrameDistance
2025-03-06 10:17:57
i'm still looking to confirm if we provide 95 to JxlEncoderDistanceFromQuality but I think so
Demiurge
A homosapien It's mostly Gaborish, not epf https://github.com/libjxl/libjxl/issues/3458
2025-03-06 10:17:58
wow. Are you sure epf is enabled in that video?
2025-03-06 10:18:07
If so I'm very impressed
2025-03-06 10:19:08
It's best to explicitly disable gaborish if you are worried about generation loss, but even better to use lossless mode.
A homosapien
2025-03-06 10:19:44
Or hear me out, lossy modular <:Stonks:806137886726553651>
Rasky
2025-03-06 10:19:49
unfortunately we need the additional size gain; we shouldn't recompress images in principle but it turns out we need to fix a few bugs
2025-03-06 10:20:39
ok so i'll try the 95.6 trick and/or explicitly disabling gaborish
username
2025-03-06 10:23:21
in the future when the libjxl encoder is tweaked/improved more then lossy modular might be a really good option for the CAD style images
Demiurge
2025-03-06 10:27:25
https://libjxl.readthedocs.io/en/latest/api_encoder.html#_CPPv424JxlEncoderFrameSettingId
2025-03-06 10:44:31
For example: ```c if (JxlEncoderFrameSettingsSetOption(*frame_settings, JXL_ENC_FRAME_SETTING_GABORISH, 0) == JXL_ENC_SUCCESS) ```
2025-03-06 10:55:43
Same thing with `if (JXL_ENC_SUCCESS == JxlEncoderSetFrameLossless(*frame_settings, JXL_TRUE))` If lossless is too slow try setting `JXL_ENC_FRAME_SETTING_EFFORT` to `2`
Rasky ok so i'll try the 95.6 trick and/or explicitly disabling gaborish
2025-03-06 11:09:23
At a distance less than or equal to 0.5, Gabor filter is automatically disabled, according to `lib/jxl/enc_frame.cc`
2025-03-06 11:10:09
No need to use `JxlEncoderDistanceFromQuality()`
2025-03-06 11:10:30
Just use `0.5` directly as the distance value
2025-03-06 11:10:53
Or, you can use any distance you want, and just disable gabor manually.
2025-03-06 11:11:17
with `JxlEncoderFrameSettingsSetOption()`
2025-03-06 11:11:49
Then you can continue using the same distance/quality settings but still have better resilience to generation loss
2025-03-06 11:12:02
:)
2025-03-06 11:13:02
But still, if you can afford it, might as well use lossless. Lossless mode can be extremely, ridiculously, insanely fast if you use effort 1 or 2
Traneptora
2025-03-06 01:46:59
also you're likely going to want low distance anyway if you're trying to be resilient against generation loss
2025-03-06 01:47:04
or lossless in general
monad
2025-03-06 02:33:06
best to explicitly disable gaborish instead of relying on encoder quirks which could change between versions
jonnyawsom3
2025-03-06 04:58:03
Ya know... I *think* Foxless wants people to use effort 2 lossless :P https://discord.com/channels/794206087879852103/794206170445119489/1347148914104598569 https://discord.com/channels/794206087879852103/794206170445119489/1347149958326784101 https://discord.com/channels/794206087879852103/794206170445119489/1347150029579616327 https://discord.com/channels/794206087879852103/794206170445119489/1347151510253080626 https://discord.com/channels/794206087879852103/794206170445119489/1347160716980912140 https://discord.com/channels/794206087879852103/794206170445119489/1347165072975462431 Hard to know though
2025-03-06 05:38:01
Also, I wonder if 0.8's higher quality means less generation loss with gaborish disabled
couleur
2025-03-08 10:33:24
https://www.iso.org/standard/85066.html
2025-03-08 10:33:27
why is this so expensive
2025-03-08 10:33:36
are there other jpeg xl papers out there
0xC0000054
couleur why is this so expensive
2025-03-08 10:41:13
ISO standards are always crazy expensive.
Demiurge
2025-03-08 10:46:15
Because ISO is a scam
2025-03-08 10:46:57
Sorry lol <:kekw:808717074305122316>
2025-03-08 10:47:14
But it's true lol
Tirr
2025-03-08 10:48:18
there's community draft in <#1021189485960114198>
jonnyawsom3
couleur https://www.iso.org/standard/85066.html
2025-03-08 10:48:21
https://discord.com/channels/794206087879852103/1021189485960114198/1256224842894540831
Tirr
https://discord.com/channels/794206087879852103/1021189485960114198/1256224842894540831
2025-03-08 10:48:43
this is the direct link
Orum
2025-03-08 10:49:40
apparently the reference implementation is more of a standard than the standard itself though
Demiurge
2025-03-08 10:50:58
It's a multinational bureaucracy of trade cartels. You can't expect any better...
Tirr
2025-03-08 10:51:12
libjxl is part of the spec (18181-4)
2025-03-08 10:51:47
the difference is that there's no paywall
Demiurge
Orum apparently the reference implementation is more of a standard than the standard itself though
2025-03-08 10:51:54
Uh, no... the reference implementation is pretty hard to read. jxl-oxide is actually much cleaner and legible
Tirr
2025-03-08 10:52:14
(I never thought jxl-oxide is legible enough)
Demiurge
2025-03-08 10:52:50
the reference, libjxl, is... well, it hasn't aged well.
2025-03-08 10:53:30
I mean granted they did fix some important issues like making it return errors instead of merely calling abort()
2025-03-08 10:54:10
Not to say that it hasn't improved in a lot of ways. But as far as readability goes, nooooo.
Orum
Demiurge Uh, no... the reference implementation is pretty hard to read. jxl-oxide is actually much cleaner and legible
2025-03-08 10:54:44
I never said it was easy to read, just that it's more authoritative than the spec itself
Demiurge
2025-03-08 10:54:56
Oh, so that's what you mean
2025-03-08 10:56:15
Not necessarily. It depends on if it's less risky to change libjxl or to change the spec
2025-03-08 10:57:21
It might be too risky to change libjxl if there is a bug that would make existing files corrupted in a way that was impossible to reliably detect
2025-03-08 10:57:59
That's the only case where the spec would be changed to match incorrect libjxl behavior
Tirr
2025-03-08 10:58:18
mainly this one https://github.com/libjxl/libjxl/issues/3356
2025-03-08 10:58:47
this is an unfortunate one, it's obviously libjxl bug but fixing libjxl introduces bitstream incompatibility
2025-03-08 10:59:01
so spec is modified to match libjxl
Orum
2025-03-08 11:01:22
yeah but changing the spec had other advantages
CrushedAsian255
Orum yeah but changing the spec had other advantages
2025-03-08 11:01:41
making people buy the second edition?
Orum
2025-03-08 11:02:01
I said *advantages*
CrushedAsian255
2025-03-08 11:02:15
that is an advantage (to the ISO)
Orum
2025-03-08 11:02:36
well I don't think anyone here is affiliated with ISO <:kkomrade:896822813414011002>
jonnyawsom3
2025-03-08 11:02:50
No one here likes the ISO, it was only done to be 'official', hence the free draft copy here
Orum
2025-03-08 11:04:31
I wonder how much money ISO makes by selling specs...
Demiurge
Tirr mainly this one https://github.com/libjxl/libjxl/issues/3356
2025-03-08 11:05:11
Although, with that bug, maybe there would in fact be an unintuitive way to reliably detect the problem in existing files. I have a proposal.
Orum
2025-03-08 11:05:22
like surely all 3 people that bought it aren't enough to justify paywalling it
MSLP
2025-03-08 11:05:48
I don't know how it works inside ISO, but does JXL being ISO standard gives it any leverage in applying its support into PDF (which is also ISO standard) over AVIF (which isn't ISO standard)?
Orum
2025-03-08 11:06:12
does PDF support either?
MSLP
2025-03-08 11:06:53
at the moment none, but they are in the process of choosing format for HDR images
Orum
2025-03-08 11:07:14
JXL makes more sense
CrushedAsian255
2025-03-08 11:07:20
I feel even without that, JPEG XL would be the obvious choice, as it supports good lossless, JPEG transcoding, HDR, and a bunch of other features
Tirr
Demiurge Although, with that bug, maybe there would in fact be an unintuitive way to reliably detect the problem in existing files. I have a proposal.
2025-03-08 11:07:28
I once tried to find a way to detect such image and implement that in jxl-oxide, but failed https://github.com/libjxl/libjxl/issues/3356#issuecomment-1984036235
CrushedAsian255
2025-03-08 11:08:29
AVIF's features are just: HDR (which jxl also has), efficient at very low bitrates (not as helpful for a pdf), (terrible) lossless support
Orum
2025-03-08 11:08:51
yeah, JXL is really the only sensible choice
Demiurge
2025-03-08 11:08:57
In the case of this bug, it's a bug with lz77 encoding, so existing files can be fixed and corrected after detection. As far as detection goes... all you have to affirm is that it was encoded with a version of libjxl released before a certain date or commit that fixes the behavior.
MSLP
Orum JXL makes more sense
2025-03-08 11:09:14
yep, but browsers support is may also be a consideration - eg. currently browsers include Javascript JPEG2000 decoder, since JPEG2000 can be embedded in PDFs and browsers don't support it natively
CrushedAsian255
2025-03-08 11:09:44
solution: also support jxl in the browser!
Orum
2025-03-08 11:09:45
just one more reason browsers need to add support for JXL then
Demiurge
2025-03-08 11:10:34
If you know the quirks of the libjxl encoder, you can detect if the image was encoded by a version of libjxl before a certain commit, if the commit that fixes the old behavior also changes an unrelated quirk.
2025-03-08 11:11:44
It's an unintuitive solution but I think that is the way to detect how old the libjxl version is.
2025-03-08 11:12:16
libjxl has a lot of identifiable quirks that form a fingerprint when encoding a file
MSLP
2025-03-08 11:12:45
this might break when other encoder than libjxl would emerge
Demiurge
2025-03-08 11:13:54
True, but, depending on the quirks you choose to look for, you can make it highly unlikely to match a different encoder, like a fingerprint.
CrushedAsian255
2025-03-08 11:13:54
it's already changed, too late to try to revert it now I would say
Demiurge
CrushedAsian255 it's already changed, too late to try to revert it now I would say
2025-03-08 11:15:31
Not necessarily. The situation is basically the same, the only difference is that everyone became aware of the problem and decided maybe it would be easier to change the spec.
2025-03-08 11:16:08
It's just a decision, I'm just pointing out what the possibilities are.
2025-03-08 11:16:57
My about me page says "anything is possible" :)
jonnyawsom3
MSLP at the moment none, but they are in the process of choosing format for HDR images
2025-03-08 11:18:00
https://discord.com/channels/794206087879852103/803574970180829194/1340711274824204350
MSLP
https://discord.com/channels/794206087879852103/803574970180829194/1340711274824204350
2025-03-08 11:20:03
And since PDF/R is a subset of full-PDF, then they need to add it to main spec first, right?
Demiurge
2025-03-08 11:20:05
Since it's a lz77 related problem existing files can potentially be repaired, losslessly
jonnyawsom3
2025-03-08 11:20:42
<https://github.com/libjxl/libjxl/issues/3356#issuecomment-1984036235> > if a group has only one LZ77 repeat symbol at the end of the stream, both spec and libjxl method will end up in identical final bitstream and entropy-coded stream state, but they will have completely different image.
CrushedAsian255
2025-03-08 11:20:45
can someone download the pdf and send it here? I can't access it due to vpn blocking
jonnyawsom3
MSLP And since PDF/R is a subset of full-PDF, then they need to add it to main spec first, right?
2025-03-08 11:21:55
Scroll down a little and check the survey. They ask if it should be a PDF/R exclusive
CrushedAsian255
2025-03-08 11:23:04
what do yall think? should it be PDF/R only or main spec?
Demiurge
Scroll down a little and check the survey. They ask if it should be a PDF/R exclusive
2025-03-08 11:23:34
Regardless, if it's added to pdf/r at all, the chances of it getting added to pdf next are much better
jonnyawsom3
Demiurge Not necessarily. The situation is basically the same, the only difference is that everyone became aware of the problem and decided maybe it would be easier to change the spec.
2025-03-08 11:23:44
I originally wanted the spec way for the better compression, but apparently it was a few bytes at most if anything. So, why go the spec way?
Demiurge
I originally wanted the spec way for the better compression, but apparently it was a few bytes at most if anything. So, why go the spec way?
2025-03-08 11:24:16
Stubbornness or the joy of solving impossible problems.
2025-03-08 11:24:32
:)
jonnyawsom3
CrushedAsian255 what do yall think? should it be PDF/R only or main spec?
2025-03-08 11:24:56
I said both, since I'm not in a commercial environment so only interact with regular PDF
Demiurge
2025-03-08 11:24:57
No other real form of justification
MSLP
Scroll down a little and check the survey. They ask if it should be a PDF/R exclusive
2025-03-08 11:27:26
so the main spec inclusion would still remain uncertain, although it wouldn't have much sense to have AVIF in main spec, and additionaly JXL in PDF/R
2025-03-08 11:28:09
do you know if PDF/R is widely used?
Demiurge
2025-03-08 11:28:29
Regardless of the outcome it would be good for <:JXL:805850130203934781>
CrushedAsian255
2025-03-08 11:28:35
what even is the difference between main PDF and PDF/R
MSLP
2025-03-08 11:30:06
"PDF/R, short for "PDF for Raster Images," is a specialized subset of the Portable Document Format (PDF) designed for multi-page documents primarily composed of raster images, such as scanned documents." "The "R" in PDF/R stands for "raster." - from <https://www.pdf2go.com/dictionary/pdf_r>
Orum
2025-03-08 11:30:48
so it's like webm is to mkv? ๐Ÿค”
MSLP
2025-03-08 11:31:19
here's a more detailed description https://www.loc.gov/preservation/digital/formats/fdd/fdd000493.shtml
CrushedAsian255
2025-03-08 11:31:27
so it's just worse pdf?
Orum
2025-03-08 11:32:37
more limited, it seems
MSLP
2025-03-08 11:32:41
simplyfing - yes. but probably easier to implement in embedded devices like scanners
Demiurge
2025-03-08 11:38:02
So it's djvu
2025-03-08 11:39:44
I love the <:JXL:805850130203934781> community. Very peaceful and cool.
CrushedAsian255
Demiurge I love the <:JXL:805850130203934781> community. Very peaceful and cool.
2025-03-08 11:40:16
avif jumpscare
Orum
2025-03-08 11:40:31
>AVIF.png
Demiurge
2025-03-08 11:40:33
๐Ÿ˜น
CrushedAsian255
2025-03-08 11:41:19
Demiurge
2025-03-08 11:41:45
Something wrong with discord-lilliput, the colors change when the preview becomes full size
Tirr
2025-03-08 11:41:55
progressive loading animation of that image, with jxl and avif
MSLP
2025-03-08 11:42:03
Behold
Orum
2025-03-08 11:42:05
oooooooooooooh, thank god I'm not the only person experiencing this
2025-03-08 11:42:38
I uploaded an image the other day and discord's preview image had its colors messed up
2025-03-08 11:43:14
though I think they were messed up in the full size preview too
Demiurge
2025-03-08 11:43:23
Yeah, it's because their lilliput backend server generates a webp preview of every image
Orum
2025-03-08 11:43:39
yeah, but why would the colors get messed up?
Demiurge
2025-03-08 11:43:40
And the colors in that webp always look weird because webp is atrocious
Orum
2025-03-08 11:43:50
this wasn't just a webp thing
2025-03-08 11:44:11
it's a very vanilla image, sRGB, SDR, etc.
Demiurge
2025-03-08 11:44:38
Lilliput converts every image to webp. When you request the full size image you usually get the original.
Orum
2025-03-08 11:44:53
well when I opened it in firefox it looked fine
2025-03-08 11:45:07
so something on lilliput really screws up the colors
Demiurge
2025-03-08 11:45:36
Yeah it has a history of doing that too, because it doesn't interpret the colors correctly a lot of the time when doing the conversion
MSLP
Demiurge So it's djvu
2025-03-08 11:45:50
I'd consider djvu more advanced than pdf/r because of all the layer separation stuff, and kinda different if djvu does its own image compression algorithms (which I'm 100% not sure it does) - pdf/r uses existing image compression standards
CrushedAsian255
2025-03-08 11:46:22
<@206628065147748352> by the way I have a jxl that fails to decode in jxl-oxide but succeeds in djxl
Demiurge
MSLP I'd consider djvu more advanced than pdf/r because of all the layer separation stuff, and kinda different if djvu does its own image compression algorithms (which I'm 100% not sure it does) - pdf/r uses existing image compression standards
2025-03-08 11:47:06
djvu has 3 separate codecs that can be mixed and matched and embedded in a single page or multiple page file
2025-03-08 11:47:31
The 3 codecs are specific to djvu but based off existing research and technology
Tirr
CrushedAsian255 <@206628065147748352> by the way I have a jxl that fails to decode in jxl-oxide but succeeds in djxl
2025-03-08 11:47:35
please open an issue or post it at <#1065165415598272582>
CrushedAsian255
Tirr progressive loading animation of that image, with jxl and avif
2025-03-08 11:54:03
Meow
CrushedAsian255
2025-03-08 11:57:26
2025-03-08 11:57:52
Wow Discord can display this
Tirr
CrushedAsian255
2025-03-08 11:57:53
so that's what 96kbps network looks like
Meow
2025-03-08 12:00:51
*JPEG XL.avif* ๐Ÿ‘
Demiurge
Meow Wow Discord can display this
2025-03-08 01:07:56
Very recently lilliput was patched to include libavif support
MSLP Behold
2025-03-08 01:08:56
That's why we get previews... but I'm not sure why this one didn't work?
couleur
https://discord.com/channels/794206087879852103/1021189485960114198/1256224842894540831
2025-03-08 01:12:12
is this the iso.org spec file?
Demiurge
2025-03-08 05:47:02
Yes no-yes
AccessViolation_
Tirr mainly this one https://github.com/libjxl/libjxl/issues/3356
2025-03-08 07:07:00
oh this is interesting
2025-03-08 07:10:01
promoted from bug to feature <:galaxybrain:821831336372338729>
Demiurge
2025-03-09 03:18:55
Shhh
jonnyawsom3
2025-03-09 05:17:47
Not sure if anyone else saw, but maybe someone here has an idea what's wrong https://www.reddit.com/r/jpegxl/comments/1j0txiq/loss_of_color_in_lossless_encoding_getting_dull/
Orum
2025-03-09 05:41:25
my knee-jerk reaction is this is some metadata/viewer problem
spider-mario
2025-03-09 06:05:58
clearly, some linear data is passed where sRGB is expected or vice versa
Nekotekina
2025-03-10 10:18:13
Hello, is alpha-channel compressed by default as lossless? I want transcoded JPG for color channel and lossy compression for alpha, is it possible to achieve easily with command line or python?
Demiurge
2025-03-10 10:24:21
1: idk 2: yes 3: yes
2025-03-10 10:25:25
Idk if it's lossless by default but you can adjust the quality level of the alpha channel independently.
Nekotekina
2025-03-10 10:25:37
thanks
Demiurge
2025-03-10 10:26:43
If you stick around here someone else will probably tell you the exact info. If you need API help I can pull up the info too
2025-03-10 10:27:37
Ah, I just read more carefully what you're asking. You want to start with a transcoded jpeg as the base and then add an alpha channel.
Nekotekina
2025-03-10 10:27:49
Yes, some really stupid command line command would be helpful, I have monochrome pngs I want to embed as alpha channels
Demiurge
2025-03-10 10:29:20
Okay... that will not be possible with the command line. It might be possible with the API? But I'm not sure...
Nekotekina
2025-03-10 10:29:56
okay I also remembered I wanted to squeeze 0-255 to 1-255 to have no fully transparent pixels
Demiurge
2025-03-10 10:30:15
It's theoretically possible but idk if the API is flexible enough to add an extra channel after adding a JPEG frame
Nekotekina
2025-03-10 10:30:54
if it all gets recompressed it's not the end of the world but would be nice to have
Demiurge
Nekotekina okay I also remembered I wanted to squeeze 0-255 to 1-255 to have no fully transparent pixels
2025-03-10 10:31:36
Seems kind of random but ok, that would be done beforehand though since that has nothing to do with encoding to jxl.
Nekotekina
2025-03-10 10:33:24
yes I know
Demiurge
2025-03-10 10:41:34
Eh... looking at the API reference, looks like it's probably possible to do what you're wanting
2025-03-10 10:41:48
https://libjxl.readthedocs.io/en/latest/
2025-03-10 10:46:55
You should try adding a jpeg frame and then adding an extra channel after that.
Nekotekina
2025-03-10 10:50:48
thanks I'll check the docs
Demiurge
2025-03-10 10:51:30
And you won't be able to get the original JPEG back with current software, but you could theoretically with patched or custom software
2025-03-10 10:52:41
Current software won't extract the original JPEG back out even though it's losslessly embedded and 100% feasible and possible
2025-03-10 10:54:04
So you will just have a jxl with the same quality as the original jpeg, until someone writes or patches a decoder with the ability to extract lossless jpeg frames
2025-03-10 10:54:16
:)
2025-03-10 11:07:01
Just keep in mind what you are thinking of doing is uncommon and probably does not get tested as well
2025-03-10 11:07:14
A frankenfile
A homosapien
Nekotekina Hello, is alpha-channel compressed by default as lossless? I want transcoded JPG for color channel and lossy compression for alpha, is it possible to achieve easily with command line or python?
2025-03-10 11:08:00
After libjxl 0.9 Alpha channel by default is lossless
jonnyawsom3
2025-03-10 12:31:43
Alpha channel is stored lossless by default, but invisible pixels depend on settings. So if you do lossy, invisible pixels will be overwritten. If you do lossless, they're kept
2025-03-10 12:31:59
IIRC
Nekotekina
2025-03-10 01:18:33
I figured that I better keep two files separate and do something with them hehe
Demiurge
Alpha channel is stored lossless by default, but invisible pixels depend on settings. So if you do lossy, invisible pixels will be overwritten. If you do lossless, they're kept
2025-03-10 01:33:10
That's adjustable in the public api
Orum
2025-03-10 05:45:28
why is libjxl so bad at pixel art compression <:FeelsSadMan:808221433243107338>
jonnyawsom3
2025-03-10 06:31:10
What settings?
Orum
2025-03-10 07:06:44
-d 0 -e <multiple> --streaming_input --streaming_output
2025-03-10 07:07:06
it just loses to WebP lossless so often
2025-03-10 07:07:43
or even ppm.xz
jonnyawsom3
2025-03-10 07:18:30
Oh, it's probably streaming input. But if not, is the art scaled? Ideally by 2, 4 or 8x
Orum
2025-03-10 07:21:29
streaming input hurts in terms of compression, but not by much
2025-03-10 07:21:59
the art is scaled but there's no consistent scale so I can't simply losslessly downscale and then upscale it back up with NN
2025-03-10 07:22:41
oh, actually, I can do 1/3rd scale
2025-03-10 07:22:57
but some of the art is like 1/6th
2025-03-10 07:26:53
scaling it down made it worse ๐Ÿ˜†
2025-03-10 07:27:35
this is the smallest <:JXL:805850130203934781> I managed to make, in the original (not downscaled) res
2025-03-10 07:32:35
smallest ppm.xz (downscaled losslessly with NN to 720p)
2025-03-10 07:33:32
and the smallest webp, also scaled down
2025-03-10 07:34:26
JXL is 61% larger <:SadOrange:806131742636507177>
Traneptora
Orum smallest ppm.xz (downscaled losslessly with NN to 720p)
2025-03-10 07:48:24
may I suggest https://github.com/Traneptora/xz-pixbuf-loader
Orum
2025-03-10 07:48:46
I know but I want to make cjxl better
Traneptora
2025-03-10 07:48:56
ah you're already familiar, okay <:kek:857018203640561677>
2025-03-10 07:49:06
ideally jxl is just better tho
_wb_
2025-03-10 07:59:55
A better patch detection would blow any 1D dictionary coding away on an image like that...
2025-03-10 08:02:26
WebP and general purpose compression are exploiting the repetitive stuff while jxl isn't really yet. It has coding tools for it, but using them effectively is tricky.
Orum
2025-03-10 08:07:28
I bet
Meow
Orum why is libjxl so bad at pixel art compression <:FeelsSadMan:808221433243107338>
2025-03-11 01:48:25
Even `cjxl -d 0 -e 10 -E 4 -I 100 -g 3` can't beat PNG for screentone images sometimes
jonnyawsom3
Orum and the smallest webp, also scaled down
2025-03-11 04:51:54
Ahh, when you said pixel art, I was thinking of the more traditional type. I actually used Into The Breach to find a small bug with patches. The coordinates don't get scaled with --already_downsampled https://github.com/libjxl/libjxl/issues/2737
2025-03-11 04:55:30
The main issue is the overlapping tiles, no? Like Factorio screenshots. There's a lot of tiles and sprites, but post processing and layering means they can't be detected
Orum
2025-03-11 06:48:39
that would be my assumption
K
2025-03-12 08:54:41
Where is the discord invite link
2025-03-12 08:54:48
Anyone can share?
_wb_
2025-03-12 08:56:22
https://discord.gg/DqkQgDRTFu
K
_wb_ https://discord.gg/DqkQgDRTFu
2025-03-12 09:00:53
Thanks boss
BlueSwordM
2025-03-12 05:26:37
<@794205442175402004> Can we still use the ๐Ÿงˆ API?
_wb_
2025-03-12 06:08:38
The Butteraugli API was removed from libjxl a while ago, see https://github.com/libjxl/libjxl/pull/2576
Nekotekina
2025-03-13 05:41:34
Hello, can JXL save N arbitrary planes? I want to store YUV+depth for example. Not RGB.
2025-03-13 05:41:47
that's hypothetical question
2025-03-13 05:43:04
I won't be able to use it without an extreme PITA anyway
CrushedAsian255
Nekotekina Hello, can JXL save N arbitrary planes? I want to store YUV+depth for example. Not RGB.
2025-03-13 05:53:32
It supports RGB + 4096 arbitrary auxiliary channels (planes)
2025-03-13 05:53:55
You could theoretically use Modular mode and store YUV data but it wouldnโ€™t display correctly unless you have an ICC attached
2025-03-13 05:54:17
As it expects either RGB or XYZ for the main image
2025-03-13 05:55:29
Why canโ€™t the input be RGB though?
Nekotekina
2025-03-13 05:55:55
it seems that converting RGB to something else consumes a lot of resources
CrushedAsian255
2025-03-13 05:56:47
Do you have RGB data? What format is the RAW in
Nekotekina
2025-03-13 05:57:13
idk, just plain 8-bit jpeg or png
CrushedAsian255
2025-03-13 05:57:37
That should be fine then
2025-03-13 05:58:10
PNG is RGB and JPEG XL has first class support for YCbCr (jpeg colourspace)
2025-03-17 03:12:30
~~*456 persons*~~
Meow
2025-03-17 09:07:08
Are dynamic wallpapers theoretically possible with JXL? https://github.com/mczachurski/wallpapper As this repo reveals on macOS they are just HEIC containing JSON
2025-03-17 02:21:08
I tried myself and it's true
2025-03-17 02:21:54
Nothing magical
novomesk
2025-03-17 07:28:24
In GIMP 3, I have problem displaying images with specific ICC profile. I discribed the problem in https://gitlab.gnome.org/GNOME/gimp/-/issues/13139 using a HEIC file. However, I can reproduce it using JXL in GIMP 3 too. http://188.121.162.14/jxl/sky.jxl Is there a way to check if the ICC profile in the image is correct? Or is there a possibility the ICC profile is a new one with some CICP tag that is not parsed by some applications?
VcSaJen
2025-03-17 07:53:49
Try opening it in Krita, if colors are fine, then ICC is fine
Meow
2025-03-18 10:16:39
Hmm nobody knows if dynamic wallpapers are technically doable via JXL?
CrushedAsian255
Meow Hmm nobody knows if dynamic wallpapers are technically doable via JXL?
2025-03-18 10:18:28
from a technological perspective there is no reason why not
Orum
2025-03-18 10:24:22
dynamic wallpaper?
RaveSteel
2025-03-18 10:24:24
Depends on the project, there are some which depend on the user providing multiple images which get switched at certain times. Since you use mac, why not try replacing your wallpaper with a JXL and see if it changes around?
Meow
RaveSteel Depends on the project, there are some which depend on the user providing multiple images which get switched at certain times. Since you use mac, why not try replacing your wallpaper with a JXL and see if it changes around?
2025-03-18 10:27:32
I'm not the author of "wallpapper"
Demiurge
2025-03-18 10:31:52
It's just metadata
RaveSteel
Meow I'm not the author of "wallpapper"
2025-03-18 10:32:27
I know, but you could still try my suggestion
Meow
2025-03-18 10:33:07
Just don't know how to do
RaveSteel
2025-03-18 10:33:59
In the case of mac (or any OS), there is a wallpaper located in some directory. Have a look at thet file and replace it with a JXL encoded in a similar manner. Then see if it works or not
Demiurge
Nekotekina Hello, can JXL save N arbitrary planes? I want to store YUV+depth for example. Not RGB.
2025-03-18 10:34:34
You can have up to 4096 extra channels, in addition to 3 channels for yuv/rgb/xyb
2025-03-18 10:35:01
It can be depth, alpha, thermal, spectral bands, whatever.
AccessViolation_
2025-03-18 10:39:57
by the way, how many frames (not channels) can you have in a JXL?
Meow
RaveSteel In the case of mac (or any OS), there is a wallpaper located in some directory. Have a look at thet file and replace it with a JXL encoded in a similar manner. Then see if it works or not
2025-03-18 10:41:44
Dynamic wallpapers are actually just one container
RaveSteel
2025-03-18 10:48:35
Yes, "Appearance.heic" I believe they are called. Try recreating that file as a JXL
jonnyawsom3
2025-03-18 11:20:04
Well that's not a good sign https://www.reddit.com/r/jpegxl/s/Cpjzz2IaDA
2025-03-18 11:20:26
Great embed, thanks Reddit
2025-03-18 11:21:01
>>> https://youtu.be/SzsM4HMKmEI?t=1m34s avif just has more details and more compatibility than jxl, I think I will go for avif ๐Ÿ˜…
2025-03-18 11:22:55
Ah, 200KB, that'll do it
Demiurge
2025-03-18 12:04:55
Here we see an example where libjxl's steep quantmatrices and aggressive smoothing bites it in the ass, where it actually looks more vaselined compared to avif, leading to bad publicity.
2025-03-18 12:06:48
If quality gets tuned in a future libjxl release, and libjxl gets better at preserving grain in the future, I suggest writing a press release or blog post of some kind, to bring more attention and publicity to quality/rdo enhancements.
2025-03-18 12:07:45
That way, if/when libjxl improves, people might be more likely to forget about this embarrassing performance in the past.
2025-03-18 12:08:13
And brush it off as "just a problem with the old version, fixed in the new release"
2025-03-18 12:09:10
I don't want people to get a bad impression of the format because of problems with the reference encoder...
2025-03-18 12:15:38
I should note, that even in this video, the avif file being compared looks even worse than the jxl in a lot of other parts of the image. Even worse blurring in some parts of the foliage too.
Meow
RaveSteel Yes, "Appearance.heic" I believe they are called. Try recreating that file as a JXL
2025-03-18 12:55:21
So the attempt results in a HEIF disguised as .jxl
2025-03-18 12:56:53
I just wonder if "real" JXL could implement something like that
Well that's not a good sign https://www.reddit.com/r/jpegxl/s/Cpjzz2IaDA
2025-03-18 01:06:11
So OP is just an AVIF spy inside the JXL subreddit
2025-03-18 01:07:13
2025-03-18 01:09:00
If people want to investigate my self-made Dynamic Wallpapers for research https://files.catbox.moe/d9jtqt.heic
Demiurge
2025-03-18 01:24:50
https://www.reddit.com/r/jpegxl/comments/1j9o9g4/comment/mhn0rmz/
2025-03-18 01:25:18
> I tried XL Convert, AVIF looks better than lossy JPEG XL to me, at the same size. JPEG XL looks more blurry, is that normal?
Orum
2025-03-18 01:29:11
people that only ever do LQ encoding baffled JXL's existence <:kekw:808717074305122316>
Demiurge
2025-03-18 01:29:34
So it's not just that video. OP actually tried codepoems XL Convert and compared jxl with avif and saw the excessive blurring. Recent versions of libaom no longer have the same terrible smearing and blurring from before, while libjxl has mostly remained the same and still lacks automatic noise detection/synthesis
Orum
2025-03-18 01:30:08
well JXL's grain synthesis is pretty awful
jonnyawsom3
2025-03-18 01:31:22
I was trying to replicate the video results, but all I did was find the desaturation regression instead
2025-03-18 01:33:26
Main vs 0.8
Demiurge
2025-03-18 01:34:58
Are you sure it's a regression? Even in really old versions of the encoder, it has similar change in color and saturation
jonnyawsom3
2025-03-18 01:35:23
0.8 is still worse than the AVIF, but better than main for saturation
Demiurge
2025-03-18 01:36:28
Jyrki said a while back it's because the color quantization scaling factor is too naive and aggressive.
2025-03-18 01:38:09
But I don't think anyone's tried tuning or correcting it yet
2025-03-18 01:38:43
It mostly affects yellow/orange/red yes?
jonnyawsom3
2025-03-18 01:39:49
Looks like it
Traneptora
2025-03-18 03:06:17
It appears djpegli is overwriting EXIF orientation as 1 for JPG -> PNG
2025-03-18 03:06:31
but otherwise attaching the EXIF buffer. this can't be intentional, right?
2025-03-18 03:06:49
I figure this is leftover information from JXL -> PNG, because you usually don't want to write the orientation tag for JXL
2025-03-18 03:07:05
but djpegli isn't actually orienting the jpeg so I figure it should
DZgas ะ–
2025-03-19 12:37:25
good. 548 megapixels can be encoded and opened without any problems having 8 gigabytes of RAM in total
jonnyawsom3
2025-03-19 12:39:54
Huh, effort 1 seems slower than I'd expect
DZgas ะ–
DZgas ะ– good. 548 megapixels can be encoded and opened without any problems having 8 gigabytes of RAM in total
2025-03-19 12:42:27
XnView can not open such file...
Huh, effort 1 seems slower than I'd expect
2025-03-19 12:43:50
yes, it is slower than png, considering that standard png out 722 mb
2025-03-19 12:44:52
and -e 2 is worse
DZgas ะ– good. 548 megapixels can be encoded and opened without any problems having 8 gigabytes of RAM in total
2025-03-19 12:46:48
I was hasty in saying that there were no problems with opening.
jonnyawsom3
DZgas ะ– yes, it is slower than png, considering that standard png out 722 mb
2025-03-19 12:46:59
Can you try with this? https://discord.com/channels/794206087879852103/803645746661425173/1348643193734037514
DZgas ะ– I was hasty in saying that there were no problems with opening.
2025-03-19 12:48:47
No cropped or chunked decoding in libjxl currently, as far as I'm aware. You could try decoding with jxl-oxide using `--crop`, to see a region at a time without memory limits
DZgas ะ–
Can you try with this? https://discord.com/channels/794206087879852103/803645746661425173/1348643193734037514
2025-03-19 12:49:23
username
DZgas ะ– I was hasty in saying that there were no problems with opening.
2025-03-19 12:49:25
try updating your version of Paint.NET maybe? the newest version is 5.1.6 and has somewhat improved JXL support
2025-03-19 12:49:36
https://getpaint.net/roadmap.html
jonnyawsom3
2025-03-19 12:50:27
Strange that the bpp is higher, I was getting identical results. Guess something changed between those versions
DZgas ะ–
username try updating your version of Paint.NET maybe? the newest version is 5.1.6 and has somewhat improved JXL support
2025-03-19 12:50:50
this can't be a problem in any form. the decoder must comply with the stantatd legacy, or something was broken here from the beginning
username try updating your version of Paint.NET maybe? the newest version is 5.1.6 and has somewhat improved JXL support
2025-03-19 12:52:37
I want to note that XnView also does not work. There is a memory jump and an opening error.
jonnyawsom3
2025-03-19 12:52:40
The image is around 1.5 GB just in memory, with decoding overhead it's likely hitting memory limits
DZgas ะ–
The image is around 1.5 GB just in memory, with decoding overhead it's likely hitting memory limits
2025-03-19 12:53:42
and yet there is no problem in opening the original png image
jonnyawsom3
2025-03-19 12:54:32
PNG has very little decompression overhead, and streams the data
DZgas ะ–
The image is around 1.5 GB just in memory, with decoding overhead it's likely hitting memory limits
2025-03-19 12:54:41
Jpeg XL lossless is divided into blocks. They are decoded independently, so where could be the problem?
The image is around 1.5 GB just in memory, with decoding overhead it's likely hitting memory limits
2025-03-19 01:00:30
with djxl there is no problem at all. and the memory used is not higher than when encoding
jonnyawsom3
2025-03-19 01:00:53
Oh, interesting
DZgas ะ–
2025-03-19 01:04:36
bruh. the bug
jonnyawsom3
2025-03-19 01:06:13
Yeah, for some reason `--disable_output` uses more resources than just outputting to `nul` with ppm
DZgas ะ–
2025-03-19 01:09:15
ok. the jxl image was good encoded, although I don't know how to open it, except for djxl decoding
2025-03-19 01:09:37
<:JXL:805850130203934781> I hope in 5 years when I open it, it will open
Oh, interesting
2025-03-19 01:15:36
VarDCT opens without any problems
DZgas ะ– bruh. the bug
2025-03-19 01:16:52
One more bug
2025-03-19 01:17:28
why every time i use jxl once in half a year it is always broken somewhere<:PepeHands:808829977608323112>
2025-03-19 01:22:13
-d 20.1 and more caused a complete memory leak
2025-03-19 01:23:49
-d 19.9 used 4 gb max
jonnyawsom3
DZgas ะ– -d 20.1 and more caused a complete memory leak
2025-03-19 01:28:33
`-d 20` enables resampling, but currently it uses a very expensive and 10x slower downsampling method. I fixed it to use the faster version in this binary (And made `-d 10` resample with varying results)
DZgas ะ–
2025-03-19 01:29:12
-e 9, -e 8, -e 7, -e 6
2025-03-19 01:29:26
why
2025-03-19 01:30:06
Well I just can't use its. What are these leaks?
2025-03-19 01:30:22
VarDct
jonnyawsom3
2025-03-19 01:30:26
The expensive resampling I mentioned is enabled at effort 7 and above
DZgas ะ–
2025-03-19 01:30:43
in Modular mode there are no such problems
The expensive resampling I mentioned is enabled at effort 7 and above
2025-03-19 01:31:40
ok. let's assume. why does resampling take 5 times more memory than the original image?
2025-03-19 01:32:01
I donwscale the image by 2 times, this encoding is 11424 x 12000
jonnyawsom3
2025-03-19 01:32:07
It even has a comment saying to disable it <https://github.com/libjxl/libjxl/blob/main/lib/jxl/enc_frame.cc#L714>
2025-03-19 01:32:33
So, I did <https://github.com/libjxl/libjxl/blob/2cd93c8b2a2f1eb1e290a6a8c2f7cc40e7954f73/lib/jxl/enc_frame.cc#L718>
DZgas ะ–
`-d 20` enables resampling, but currently it uses a very expensive and 10x slower downsampling method. I fixed it to use the faster version in this binary (And made `-d 10` resample with varying results)
2025-03-19 01:33:35
Can Is it optionally disabled?
`-d 20` enables resampling, but currently it uses a very expensive and 10x slower downsampling method. I fixed it to use the faster version in this binary (And made `-d 10` resample with varying results)
2025-03-19 01:36:08
Almost works
2025-03-19 01:36:58
-e 8 and -e 9 not
jonnyawsom3
2025-03-19 01:38:20
What about with `--patches 0`
DZgas ะ–
What about with `--patches 0`
2025-03-19 01:39:18
๐Ÿ’€
2025-03-19 01:40:04
-e 6 -e 7 -e 8/9
2025-03-19 01:41:59
I freed up some memory, but it still used to be about 2-3 times more, so I'll have to make do with -e 7 Which at least works on your cjxl ๐Ÿ‘
A homosapien
2025-03-19 01:43:04
<@238552565619359744> Nice to know that we are seeing real world examples where our changes are improving libjxl
DZgas ะ–
2025-03-19 01:49:12
<@238552565619359744> --resampling=1 -d 10 -e 7 --resampling=1 -d 10 -e 6
2025-03-19 01:49:26
sad
jonnyawsom3
DZgas ะ– <@238552565619359744> --resampling=1 -d 10 -e 7 --resampling=1 -d 10 -e 6
2025-03-19 01:52:26
Chunked encoding is also disabled under these circumstances: * When the image is smaller than 2048x2048. * Lossless Jpeg transcoding. * VarDCT at distances โ‰ฅ20. * Effort 7 VarDCT at distances โ‰ฅ3.0. * Effort 8 VarDCT at distances >0.5. * Efforts 8 & 9 VarDCT at distances >0.5.
2025-03-19 01:52:49
No clue why
DZgas ะ–
Chunked encoding is also disabled under these circumstances: * When the image is smaller than 2048x2048. * Lossless Jpeg transcoding. * VarDCT at distances โ‰ฅ20. * Effort 7 VarDCT at distances โ‰ฅ3.0. * Effort 8 VarDCT at distances >0.5. * Efforts 8 & 9 VarDCT at distances >0.5.
2025-03-19 01:55:18
cjxl_jonnyawsom3.exe -d 10 -e 7 cjxl_jonnyawsom3.exe -d 9 -e 7
`-d 20` enables resampling, but currently it uses a very expensive and 10x slower downsampling method. I fixed it to use the faster version in this binary (And made `-d 10` resample with varying results)
2025-03-19 01:55:49
yep
2025-03-19 01:56:02
only for d 10-20 works
jonnyawsom3
2025-03-19 01:56:23
It's an improvement, but doesn't fix everything
DZgas ะ–
2025-03-19 01:58:07
the bullshit
2025-03-19 01:58:55
there is no point in doing any resampling at all, has anyone tested this? where are the tests? where are the graphs? Who said resampling makes jxl better?
2025-03-19 02:06:08
I've always used -e 6 because of the better speed/quality tradeoff, but the fact that -e 7 forces resampling on low-quality -- is another argument for not using anything other than -e 6
jonnyawsom3
2025-03-19 02:06:53
e7 just enables the slow and memory hungry resampler, it's still enabled at all effort settings
2025-03-19 02:08:27
Though, I have been contemplating moving the threshold to distance 15 instead, since at 10 it's best for photographic images but non-photographic struggles still
DZgas ะ–
e7 just enables the slow and memory hungry resampler, it's still enabled at all effort settings
2025-03-19 02:08:50
damn
Though, I have been contemplating moving the threshold to distance 15 instead, since at 10 it's best for photographic images but non-photographic struggles still
2025-03-19 02:09:46
Returning to my previous questions - why not just disable resampling on all qualities ?
jonnyawsom3
2025-03-19 02:10:27
Because it gives a significant quality increase at a size decrease
DZgas ะ–
Because it gives a significant quality increase at a size decrease
2025-03-19 02:10:53
No, it doesn't
jonnyawsom3
2025-03-19 02:10:58
https://github.com/libjxl/libjxl/pull/4147
2025-03-19 02:11:55
https://discord.com/channels/794206087879852103/804324493420920833/1348640701361160286
A homosapien <@238552565619359744> Nice to know that we are seeing real world examples where our changes are improving libjxl
2025-03-19 02:13:46
Well, some of them at least
DZgas ะ–
2025-03-19 02:15:08
some