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

kkourin
2024-02-24 11:51:33
on windows, it uses the display profile you set in OS settings
damian101
2024-02-24 11:52:12
I thought that feature was not here yet?
kkourin
2024-02-24 11:52:14
and I think you need to set `gfx.color_management.mode` to 1 or else it will only use it for tagged images
username
2024-02-24 11:52:16
iirc Firefox doesn't really have that much stuff needed to target displays or color spaces however it will properly color manage images with embedded icc profiles
Quackdoc
kkourin on windows, it uses the display profile you set in OS settings
2024-02-24 11:54:23
sometimes™️
2024-02-24 11:55:27
on OSX to get colormanagement you need to use https://addons.mozilla.org/en-CA/firefox/addon/extended-color-management/
2024-02-24 11:55:38
on windows, you can try and use it and pray I guess
kkourin
username iirc Firefox doesn't really have that much stuff needed to target displays or color spaces however it will properly color manage images with embedded icc profiles
2024-02-24 11:56:07
it has had a full color management pipeline based on icc for a while
Quackdoc
2024-02-24 11:58:41
isn't firefox's ICC handling a bit of a joke? last I saw it, it was
kkourin
2024-02-24 11:59:51
what are the issues?
2024-02-25 12:02:35
video support?
2024-02-25 12:05:10
yeah I meant only for images. I think they have made progress on video recently but not sure how much
Quackdoc
2024-02-25 12:07:15
not just videos, I can't remeber exactly what the issue with qcms was but I remeber looking into it recently and it was super limiting in what it can do
username
2024-02-25 12:10:02
one of the tests here fails: https://littlecms.com/blog/2020/09/09/browser-check/
kkourin
2024-02-25 12:11:37
v4 support?
username
2024-02-25 12:12:44
firefox supports v4 but apparently rejects some valid v4 profiles
kkourin
2024-02-25 12:13:40
yeah that was my second guess
2024-02-25 12:13:59
for flaws of firefox color management
2024-02-25 12:14:17
that said, how widely adopted is icc v4?
Quackdoc
2024-02-25 12:14:23
I hope when servo lands it has good color management support T.T
kkourin
2024-02-25 12:16:12
also I'm reading it does not support cLUTs... which is a bit strange. I thought it did...
username
2024-02-25 12:16:52
sorta off-topic but does anyone know if there are any programs that do multi monitor color managed rendering besides the classic/old Windows Photo Viewer?
kkourin
2024-02-25 12:17:48
I think chrome might have support for that
username
2024-02-25 12:18:24
didn't seem to work when I tested it
kkourin
2024-02-25 12:20:03
oh interesting. I thought I remembered seeing some code for that a long time ago
2024-02-25 12:20:20
maybe it only works on video or something...
username
2024-02-25 12:22:29
classic Windows Photo Viewer will literally split it's rendering across every monitor on the same image, so for example if you have an image open in a single windows that's being displayed on like 4 monitors at once each section of the image will have different colors
lonjil
kkourin it has had a full color management pipeline based on icc for a while
2024-02-25 12:24:40
only for 8 bit images. It doesn't manage 10 bit images AFAIK.
kkourin
2024-02-25 12:26:43
yeah, I have no idea how it handles anything 10-bit or HDR related
lonjil
2024-02-25 12:27:25
IME 8-bit HDR-tagged JPEGs get tonemapped fairly well
2024-02-25 12:27:46
but a 10-bit AVIF just, won't be color managed at all
username
lonjil IME 8-bit HDR-tagged JPEGs get tonemapped fairly well
2024-02-25 12:33:03
isn't this just automatic? like in the sense that Firefox doesn't really have to do anything at all to get a tonemapped result?
lonjil
2024-02-25 12:33:30
without color management they look completely wrong
username isn't this just automatic? like in the sense that Firefox doesn't really have to do anything at all to get a tonemapped result?
2024-02-25 12:35:59
for example, look at this image: https://cdn.lonjil.xyz/fdbcefe61c89d335/pfW9ODQ.jpg
2024-02-25 12:37:09
when discord generates the preview image, the ICC profile is stripped but the color data is kept as is, so it's interpreted as sRGB, and looks washed out. But Firefox's tonemapping makes it look like this:
2024-02-25 12:37:35
far from perfect, but it is actually doing tone mapping
Traneptora
username sorta off-topic but does anyone know if there are any programs that do multi monitor color managed rendering besides the classic/old Windows Photo Viewer?
2024-02-25 01:32:56
anything based on libplacebo should
_wb_
2024-02-25 12:07:55
Firefox is not doing tone mapping, that's just the normal ICC profile handling you're seeing
2024-02-25 12:08:09
the SDR image is using Rec2020 primaries in that image
2024-02-25 12:08:39
ignoring the icc profile like discord does will make it look desaturated
2024-02-25 12:09:13
Firefox is not ignoring the icc profile, but it is ignoring the HDR gain map
2024-02-25 12:10:11
on the left: firefox on the right: safari
2024-02-25 12:10:51
both are only rendering an SDR image, but firefox shows just the fallback SDR image, while safari does interpret the HDR gain map and then tone maps it down to SDR again
2024-02-25 12:11:00
and Chrome shows it in actual HDR
paperboyo
2024-02-25 12:24:10
I must be an idiot, but I can’t see gainmap via exiftool in pfW9ODQ.jpg (~~and Photoshop and CameraRaw looks like Firefox~~*). But indeed, Chrome looks like this:
damian101
_wb_ Firefox is not doing tone mapping, that's just the normal ICC profile handling you're seeing
2024-02-25 12:30:59
well, the simple "clip" tonemapping is tonemapping as well I think... Just not very good one, as it destroys all detail in the highlights.
paperboyo
paperboyo I must be an idiot, but I can’t see gainmap via exiftool in pfW9ODQ.jpg (~~and Photoshop and CameraRaw looks like Firefox~~*). But indeed, Chrome looks like this:
2024-02-25 12:43:20
Sorry, setting Photoshop’s Precise Colour Management for HDR… makes it look better on a HDR display (still bad on SDR). If I’m correct (?), and there is no “UltraHDR”-like gainmap here, why Chrome looks so different to Firefox and Photoshop SDR? Would that be what Eric Chan cites as argument for “UltraHDR” (“Provide consistency and predictability for how HDR content is displayed across apps, devices, and platforms”)? Is tone mapping to SDR that inconsistent? Or is it just that Firefox and Photoshop SDR haven’t **yet** built support for what Chrome has and it will be consistent one day?
spider-mario
2024-02-25 12:44:29
the Firefox rendering looks like plain clipping
2024-02-25 12:45:24
and the ICC profile (“Rec. ITU-R BT.2100 PQ”, copyright Apple Inc.) has a CICP tag
2024-02-25 12:45:52
interestingly, it shows as HDR in the Discord app for iOS
damian101
2024-02-25 12:58:37
apps on Android and iOS are much more likely to use shared system libraries for lots of stuff
lonjil
2024-02-25 01:01:26
Maybe the Discord app is loading the full size image? The preview image Discord generates simply strips the ICC profile, and so can't be displayed correctly no matter what.
damian101
2024-02-25 01:02:43
right...
lonjil
2024-02-25 01:06:17
the preview is this webp image
paperboyo
spider-mario and the ICC profile (“Rec. ITU-R BT.2100 PQ”, copyright Apple Inc.) has a CICP tag
2024-02-25 01:09:30
So this CICP tag in the ICC profile signals something that Firefox doesn’t see (yet)? Like range or transfer function? Do you know how can I see what this CICP contains in this JPEG’s ICC profile (ColorSync Utility, exiftool won’t print its contents out…)?
spider-mario
2024-02-25 01:10:30
not sure about a convenient way to extract it, but libjxl will read it 😶 so maybe compressing it to jxl and running `jxlinfo` on the result?
lonjil
2024-02-25 01:11:00
that's kinda funny, I got that image by putting an HDR JXL on my iPad and then exporting it as a jpeg
spider-mario
2024-02-25 01:11:22
(I’m not fully sure we read it when recompressing jpegs losslessly, so you might have to compress it lossily)
_wb_
well, the simple "clip" tonemapping is tonemapping as well I think... Just not very good one, as it destroys all detail in the highlights.
2024-02-25 01:12:03
It's not quite doing that, it's ignoring the gain map. In this case the SDR image looks like a clip tone mapped image, but it could be anything else (with the gain map adjusted to keep the HDR the same).
2024-02-25 01:13:25
Oh, I didn't actually check, maybe it's not a gain map jpeg but just a regular one?
lonjil
2024-02-25 01:17:36
pretty sure it isn't a gainmap jpeg
paperboyo
lonjil that's kinda funny, I got that image by putting an HDR JXL on my iPad and then exporting it as a jpeg
2024-02-25 01:21:55
Pure curiosity: how did you export it? (just want to know which app is so clever to write this CICP only Chrome seems to correctly (?) interpret)
lonjil
2024-02-25 01:23:26
I think it's the OS's media framework. I just tried using the JXL in a context where it isn't supported, just like how HEIC photos on an iPhone become JPEGs when you try to share them on social media. In this case I used a reddit app and used the "post an image" feature and selected the JXL file.
Orum
2024-02-25 03:31:09
so, --streaming_input is supposed to have larger output compared to not using it, right?
2024-02-25 03:31:34
it's 2B larger than not using it, at least for this image I'm testing it with
2024-02-25 03:42:27
well, for other images they're the same 🤔
2024-02-25 03:43:31
not using it only takes about 36% more memory, too (when doing lossy)
veluca
2024-02-25 03:46:28
what size of images are you using?
Orum
2024-02-25 03:48:21
well, first test was with 4K UHD (so 3840x2160), where the streaming one was 2B larger, but with a 16K image (15360x8640) their output is identical in size
2024-02-25 03:48:52
actually the memory use is only ~30% worse when using lossless without --streaming_input
veluca
2024-02-25 03:49:33
weird...
2024-02-25 03:49:34
input format?
Orum
2024-02-25 03:49:37
ppm
2024-02-25 03:50:13
are they supposed to produce identical output?
2024-02-25 03:51:01
ooooooh, wait
2024-02-25 03:51:13
does it embed the output file name in the file itself, as metadata?
veluca
2024-02-25 03:51:34
no no
2024-02-25 03:51:45
ah, I see
2024-02-25 03:51:59
what changes filesize is actually `--streaming_output`
2024-02-25 03:52:13
streaming input should have very minimal impact
Orum
2024-02-25 03:52:23
well 2B is very small (considering that image was 4.1 MB when compressed losslessly with `-e 9`)
veluca
Orum actually the memory use is only ~30% worse when using lossless without --streaming_input
2024-02-25 03:52:27
what memory usage are you seeing?
Orum
2024-02-25 03:54:11
for 16K, lossless, with no streaming, e 7, peak mem (as reported by `time`) was: `1,670,552 KB` exact same thing, but with `--streaming_input`, was: `1,284,436 KB`
2024-02-25 03:55:55
I haven't played around with `--streaming_output` but that's next <:PepeOK:805388754545934396>
veluca
Orum for 16K, lossless, with no streaming, e 7, peak mem (as reported by `time`) was: `1,670,552 KB` exact same thing, but with `--streaming_input`, was: `1,284,436 KB`
2024-02-25 04:07:55
Weird, I'd expect less ... How big is the output file?
Orum
2024-02-25 04:09:36
101,280,678 bytes
2024-02-25 04:26:24
using both `--streaming_input` and `--streaming_output` gets the lowest memory use: 775,844 KB
2024-02-25 04:27:03
and any combination of those (i.e. none, just input, just output, or both) all results in the same file output size
veluca
2024-02-25 04:34:26
same file output size is odd
2024-02-25 04:34:32
but I will not complain about it
2024-02-25 04:35:10
700ish mb is at least reasonably close to what I saw before
2024-02-25 04:35:29
unsure why we use 500mb to store a 100mb file though...
Orum
2024-02-25 04:36:33
yeah, even uncompressed the file is only ~400 MB
_wb_
2024-02-25 04:39:55
There's also the constant cost of the code itself, I guess. Libjxl and other dependencies of cjxl, are they included in the numbers `time` reports?
Orum
2024-02-25 04:46:32
I believe so, but they're not 400 MB: ```ldd `which cjxl` | cut -d' ' -f 3 | sort | uniq | xargs stat -c %s 216192 1948832 75608 728120 15 22 28 22 16 965016 26 30 30 19 19 11 24 21 21 20 29 16 24```
2024-02-25 04:48:54
and cjxl is only 164984 bytes... so add that all up and you get ~4MB and some change
2024-02-25 04:54:18
in any case, we're talking about a difference with everything the same except for two params, so the code size shouldn't matter whether it's counted or not
_wb_
2024-02-25 05:07:39
Could be worthwhile to do some memory profiling to see where it is going...
Orum
2024-02-25 05:09:40
To be honest, I don't see any reason to *not* use `--streaming_input` or `--streaming_output` so far. Maybe for really small images they don't make sense, but for everything else, they reduce memory, speed up encoding, and carry only a very minor size/BPP penalty (if any)
2024-02-25 05:10:42
I kind of wonder if they should be on by default 🤔
monad
2024-02-25 06:25:17
Streaming output is on by default in 0.10.
Orum
2024-02-26 12:13:53
doesn't appear to be
2024-02-26 12:57:18
`cjxl -h` output: ``` -e EFFORT, --effort=EFFORT Encoder effort setting. Range: 1 .. 9.````cjxl foo.png bar.jxl -e 0` output: `Invalid flag value for --effort: Valid range is {1, 2, ..., 10}.` <:Thonk:805904896879493180>
2024-02-26 12:58:12
10 seems to work, so looks like `-h` is wrong and not the error message
monad
2024-02-26 01:59:14
wat
2024-02-26 01:59:43
I meant version 0.10
Quackdoc
2024-02-26 02:07:10
has anyone tried recording streaming_output vs without it using massif? it would be a neat thing to check
2024-02-26 02:58:27
with the current libjxl-git this is encoding a `7432x3877` png ```ps memusage -p stream.png -t cjxl mona.png stream.jxl -e 7 -d 0.5 --streaming_output memusage -p nostream.png -t cjxl mona.png nostream.jxl -e 7 -d 0.5 memusage -p stream-2thread.png -t cjxl mona.png stream-2thread.jxl -e 7 -d 0.5 --num_threads=2 --streaming_output memusage -p nostream-2thread.png -t cjxl mona.png nostream-2thread.jxl -e 7 -d 0.5 --num_threads=2 ``` PNGs are in order of above
2024-02-26 03:00:37
v0.9.2 had 3098m allocated no matter what, it's worth noting that memusage doesn't monitor full pages so other programs may report differently
CrushedAsian255
2024-02-26 04:27:20
What exactly does streaming do?
Quackdoc
2024-02-26 05:03:23
afaik it writes the output/input as it can instead of storing it in memory, it doesn't really seem to change much for me
2024-02-26 05:04:31
nostream vs streaming with `memusage -p {nostream,stream}-0.10.0.png -t cjxl windwaker35xnative.jpg windwaker.jxl --lossless_jpeg=0 { ,--streaming_output} -e 5 -d 0.5`
2024-02-26 05:04:43
`cjxl windwaker35xnative.jpg windwaker-no.jxl --lossless_jpeg=0 -e 5 -d 0.5 230.81s user 38.20s system 729% cpu 36.857 total`
2024-02-26 05:05:13
this is neat, libjxl-git can now actually encode this `23164x18480` jpeg without reconstruction without OOMing
2024-02-26 05:05:21
basically this is kinda massive image lol
monad
2024-02-26 06:01:19
guys ... e7 compresses better than e11
_wb_
2024-02-26 06:36:55
That is unexpected but not impossible
2024-02-26 06:38:01
Doing local tree learning (as is needed when doing streaming encode) gives different results than doing it globally (which we used to always do, and now only at e10+)
2024-02-26 06:39:17
In principle global trees can be better, but considering that in both cases greedy search is used, which does not find optimal solutions, it can go either way.
monad
2024-02-26 06:49:06
it's a 64x64 px image, so something else
2024-02-26 07:08:55
ok only v0.9 e7 compresses better than v0.9 e10 (v0.10 produces smaller output ... but I still consider this a victory <:PeepoDiamondSword:805394101340078092>)
yoochan
2024-02-26 07:09:51
I think that the corelation between size and effort is meant to be "on average". You will always find samples which do not follow the rule
monad
2024-02-26 07:10:21
yes
2024-02-26 07:11:21
but e11 is stupidly resource intensive, so when it fails, it's phenomenal
Orum
monad I meant version 0.10
2024-02-26 07:52:12
yes, in 0.10.0
monad
2024-02-26 07:56:25
if you're on some random pre-release version, you need the latest release
Orum
2024-02-26 08:23:44
there were pre-release versions?
monad
2024-02-26 09:06:10
git master
Orum
2024-02-26 10:59:12
I only use tagged releases
2024-02-26 11:00:17
does anyone have a image that compresses losslessly better by cwebp than any effort of cjxl 0.10?
2024-02-26 11:10:18
nvm, I found one
yoochan
2024-02-26 11:36:29
@Orum this sheet can help you find what you are looking for : https://docs.google.com/spreadsheets/d/1ju4q1WkaXT7WoxZINmQpf4ElgMD2VMlqeDN2DuZ6yJ8/edit
Orum
2024-02-26 12:30:19
this is pretty old, but as I said, I already found such an image
yoochan
2024-02-26 12:33:17
if you want another one 😄
JendaLinda
2024-02-26 06:29:15
I see there is a new encoding effort 10. Were there any changes to previous efforts? -e 9 seems to yield the same results as before. Was the old hidden -e 10 just split into new 10 and 11?
veluca
2024-02-26 06:33:54
no no, -e 9 is much faster now
2024-02-26 06:34:00
-e 10 is the old -e 9, more or less
JendaLinda
2024-02-26 07:14:52
When exactly this change took place?
Nyao-chan
2024-02-26 07:17:36
https://github.com/libjxl/libjxl/pull/3248
2024-02-26 07:17:51
https://github.com/libjxl/libjxl/pull/3337
JendaLinda
2024-02-26 07:27:37
I'm using settings -d 0 -e 9 -I 100 -E 3 -g 3, the latest build produces the exact same files as build from January. Do the other arguments override the changes done to -E 9? Anyhow, -d 0 -e 10 -I 100 -E 3 -g 3 produces smaller files.
Nyao-chan
2024-02-26 07:39:43
Where are you getting the builds? #3337 was just merged, it made `-e 9` way faster and worse at compression. And with 0.10.0 `-e 9` does not use global optimisations.
2024-02-26 07:40:08
See https://www.reddit.com/r/jpegxl/comments/1axpyjf/_/ and https://github.com/libjxl/libjxl/issues/3323#issue-2151216970
JendaLinda
2024-02-26 07:45:29
I was testing a build from earlier today. Now there's a new one, I'll give it a try.
2024-02-26 07:53:09
Same results, however it still doesn't include #3337 https://artifacts.lucaversari.it/libjxl/libjxl/latest/
Nyao-chan
2024-02-26 07:55:37
https://github.com/libjxl/libjxl/actions/runs/8054036781
2024-02-26 07:56:42
Should probably work, but haven't tested
JendaLinda
2024-02-26 08:00:02
Thank you, I will try it.
2024-02-26 08:19:11
Ah yes, so now -e 9 is slightly less efficient than before. So now I'm going to be using -e 10, it's more efficient than the previous -e 9 anyway.
Nyao-chan
2024-02-26 08:23:21
try `--patches 1` too with `-e 9`
JendaLinda
2024-02-26 08:43:53
Patches seem to be turned on by default.
Nyao-chan
2024-02-26 09:01:22
for `-e 10` it is, not for `-e 9`, I think
veluca
2024-02-26 09:08:01
Yup
Orum
2024-02-26 09:47:07
the new -e 10 is faster than the old -e 9 anyway
2024-02-26 09:47:25
that MT encoding support <:FeelsAmazingMan:808826295768449054>
2024-02-26 09:49:43
I see little reason for WebP's continued existence, now that cjxl is significantly faster, usually compresses better, and has comparable memory consumption
JendaLinda
2024-02-26 10:49:15
I'd say lossless WebP had good results because PNG is pretty bad.
jonnyawsom3
Orum `cjxl -h` output: ``` -e EFFORT, --effort=EFFORT Encoder effort setting. Range: 1 .. 9.````cjxl foo.png bar.jxl -e 0` output: `Invalid flag value for --effort: Valid range is {1, 2, ..., 10}.` <:Thonk:805904896879493180>
2024-02-26 11:34:41
I'm late but you tried to use `-e 0`? Was that a typo or...? `--streaming_input` can be considered a flat, fixed, memory reduction per input file. It will take away the memory use of the entire image, and only load 2048x2048 areas at a time for encoding In 0.10.0 the encoding is now streaming by default up to `-e 10`, but will keep the entire image loaded at once. The 30% difference you noticed was likely the image data being removed by using `--streaming_input` Others can feel free to correct me, my info is a few PRs behind
monad
Orum I see little reason for WebP's continued existence, now that cjxl is significantly faster, usually compresses better, and has comparable memory consumption
2024-02-26 11:43:32
depends on content ⌨️
JendaLinda
2024-02-27 08:27:26
`--intensity_target=N Upper bound on the intensity level present in the image, in nits. Default is 0, which means 'choose a sensible default value based on the color encoding.` Does anybody know how the intensity target is chosen?
Orum
I'm late but you tried to use `-e 0`? Was that a typo or...? `--streaming_input` can be considered a flat, fixed, memory reduction per input file. It will take away the memory use of the entire image, and only load 2048x2048 areas at a time for encoding In 0.10.0 the encoding is now streaming by default up to `-e 10`, but will keep the entire image loaded at once. The 30% difference you noticed was likely the image data being removed by using `--streaming_input` Others can feel free to correct me, my info is a few PRs behind
2024-02-27 08:49:48
no, the whole point of that message was just to illustrate that `cjxl -h` is wrong about the range of efforts available
2024-02-27 08:50:00
I already submitted an issue on GH about it
Dexrn ZacAttack
2024-02-27 08:50:21
Is this what the dice are meant to look like?
2024-02-27 08:50:30
I'm on Firefox Nightly
2024-02-27 08:50:40
it seems not
_wb_
2024-02-27 08:54:05
Firefox nightly is not handling alpha properly
Dexrn ZacAttack
_wb_ Firefox nightly is not handling alpha properly
2024-02-27 08:54:32
That's what I assumed
_wb_
2024-02-27 08:55:19
There are patches to fix it for two years or so, but Mozilla has no resources to click the merge button.
Dexrn ZacAttack
_wb_ There are patches to fix it for two years or so, but Mozilla has no resources to click the merge button.
2024-02-27 08:56:13
Lmao, hoping one day it'll be supported on most if not all modern browsers
2024-02-27 08:56:26
iirc only Safari has it right (and a few FF forks)
w
2024-02-27 08:56:26
just use safari
Dexrn ZacAttack
w just use safari
2024-02-27 08:56:37
I'm on Windows
2024-02-27 08:56:45
or Linux (fedora) when I need to compile some stuff
Oleksii Matiash
JendaLinda Ah yes, so now -e 9 is slightly less efficient than before. So now I'm going to be using -e 10, it's more efficient than the previous -e 9 anyway.
2024-02-27 09:14:50
I got opposite results, 0.10 -e 10 is always a bit worse than 0.9 -e 9
JendaLinda
2024-02-27 09:30:41
What is the the intensity target anyway? I suppose it has something to do with color profiles.
spider-mario
JendaLinda `--intensity_target=N Upper bound on the intensity level present in the image, in nits. Default is 0, which means 'choose a sensible default value based on the color encoding.` Does anybody know how the intensity target is chosen?
2024-02-27 10:34:26
10 000 for PQ, 1000 for HLG, `whiteLuminance` EXR header if present, otherwise `kDefaultIntensityTarget`
JendaLinda
2024-02-27 10:45:36
So if I understand correctly, PNG input always uses kDefaultIntensityTarget
jonnyawsom3
Orum no, the whole point of that message was just to illustrate that `cjxl -h` is wrong about the range of efforts available
2024-02-27 11:11:18
Ah, my bad, I saw that issue but assumed it was unrelated
Orum
2024-02-27 11:12:06
no worries
spider-mario
JendaLinda So if I understand correctly, PNG input always uses kDefaultIntensityTarget
2024-02-27 11:16:02
not necessarily – PNG is able to signal PQ and HLG thanks to either its new cICP chunk, or the new cicp tag in ICCv4.4
JendaLinda
2024-02-27 11:21:01
I see, so it is color profiles after all, but it has nothing to do with bit depth etc.
spider-mario
2024-02-27 11:32:14
right, it’s pretty much about how bright the image is
Orum
2024-02-27 11:56:03
it's really interesting to see where webp beats all levels of <:JXL:805850130203934781>
2024-02-27 11:57:20
for my screenshot tests, it seems to be largely in pixel art games (e.g. Skul: The Hero Slayer) or games with very fine detail/noise (Age of Empires 2, both the Definitive Edition and the HD Edition)
2024-02-27 11:59:04
Metro 2033 as well, but again, I think that has a lot of fine noise in the images
2024-02-27 12:01:38
I wonder why it does so poorly on pixel art though (or perhaps cwebp is just really good at that 🤔)
afed
2024-02-27 12:06:05
probably because lz77 for the whole image is better for some cases and jxl is limited by block/group size, even though it can reuse the same thing from webp
Orum
2024-02-27 12:06:37
Here's a good example. Best cjxl could do was 81,570 B, more than 43% more than cwebp's best.
veluca
2024-02-27 12:28:16
also patch detection is pretty bad for lossless 😛
yoochan
2024-02-27 12:28:34
nice screenshots, is this the kind of screenshots you have in you corpus ? I heard that webp lossless did some tricks a bit better than jxl, especially on paletisable content (which doesn't mean that the cjxl will not be able to mimic these tricks)
jonnyawsom3
2024-02-27 12:28:55
I can't find the messages, but I know wb has said in the past that WebPs pallete ordering is much better than JXL's simple sorting currently, which has a large effect for pixel art
veluca
2024-02-27 12:29:03
I did manage to do `62442 bytes` with patches though
yoochan
Orum Here's a good example. Best cjxl could do was 81,570 B, more than 43% more than cwebp's best.
2024-02-27 12:29:26
what arguments did you used ?
jonnyawsom3
veluca also patch detection is pretty bad for lossless 😛
2024-02-27 12:30:17
There's an issue open of a Nintendo DS emulator, has both screens showing the same image apart from a text box on one if I recall, but patches only copies about 10 pixels from the corner of a desk out of the entire image xP https://github.com/libjxl/libjxl/issues/3109
Orum
yoochan nice screenshots, is this the kind of screenshots you have in you corpus ? I heard that webp lossless did some tricks a bit better than jxl, especially on paletisable content (which doesn't mean that the cjxl will not be able to mimic these tricks)
2024-02-27 12:30:42
Yeah. The bulk of the screenshots are smallest in JXL (372 of them), but several are still smallest in WebP (50 of them).
yoochan what arguments did you used ?
2024-02-27 12:31:23
`-d 0 -e $c --streaming_input --streaming_output --quiet`
veluca
2024-02-27 12:31:27
maybe I should do lz77-style patch detection at some point
jonnyawsom3
2024-02-27 12:31:46
Huh... Nice idea
veluca
2024-02-27 12:32:10
using say 2x2 pixel areas
username
I can't find the messages, but I know wb has said in the past that WebPs pallete ordering is much better than JXL's simple sorting currently, which has a large effect for pixel art
2024-02-27 12:32:34
is this related? https://discord.com/channels/794206087879852103/794206170445119489/1126433055540785172
jonnyawsom3
2024-02-27 12:34:00
Bit packing is a separate technique, for example putting 4, 2 bit pixels into 1 byte
2024-02-27 12:38:03
Good to know I've been spelling palette wrong this entire time https://discord.com/channels/794206087879852103/794206170445119489/1128666609955909683 https://discord.com/channels/794206087879852103/803663417881395200/1150779618433962104
2024-02-27 12:38:48
But either way, I found the messages
afed
Orum Here's a good example. Best cjxl could do was 81,570 B, more than 43% more than cwebp's best.
2024-02-27 12:39:38
Orum
2024-02-27 12:40:16
still larger 😭
2024-02-27 12:40:46
also that's a lot of manual tweaking to get there... <:KekDog:805390049033191445>
afed
2024-02-27 12:47:14
not that much of tweaking, but there are some settings that may give better compression `-e 11` will probably be able to do even better, sadly that it's not possible to know what settings were used
Orum
2024-02-27 12:54:01
sure, but most people aren't even willing to try more than one effort when compressing an image, let alone tweaking `-I` and `-E`
jonnyawsom3
2024-02-27 12:57:18
A general rule of thumb is to tag on `-E 3 -g 3 -I 100` if you want *generally* the best compression without increasing effort. But for different kinds of images it will naturally have different effects. For instance a while ago I had an image that was half the size at `-g 2` than any other setting
Orum
2024-02-27 01:15:50
oh wow, I have images where the best I got out of cjxl was 347% the size of the cwebp output <:monkaMega:809252622900789269>
2024-02-27 01:17:15
this one, to be specific:
JendaLinda
2024-02-27 01:20:26
JXL could take advantage of patches in tiled graphics like this, then the picture could be compressed to few bytes. Unfortunately the encoder doesn't seem to be smart enough to determine the boundaries of the tiles.
Orum
2024-02-27 01:21:18
yeah <:PepeSad:815718285877444619>
veluca
2024-02-27 01:23:56
yeah that's definitely a great example of improvement opportunities for patches
Orum
2024-02-27 01:24:10
there are some examples where cjxl is noticeably better though, too
afed
2024-02-27 01:24:50
yeah, for any images with repeating patterns or large same pixels areas webp is likely to be better, for now
Orum
2024-02-27 01:25:25
despite being pixel art, this was notably better in <:JXL:805850130203934781>
Quackdoc
JendaLinda JXL could take advantage of patches in tiled graphics like this, then the picture could be compressed to few bytes. Unfortunately the encoder doesn't seem to be smart enough to determine the boundaries of the tiles.
2024-02-27 01:25:30
AI bros are salivating right now
w
2024-02-27 01:25:56
does sound like the job for machine learning
yoochan
Orum oh wow, I have images where the best I got out of cjxl was 347% the size of the cwebp output <:monkaMega:809252622900789269>
2024-02-27 01:27:06
we should open an issue with all pathological files 😄
Orum
2024-02-27 01:27:38
I would agree with you except I think there are already a bunch of issues open for each individual case
Quackdoc
2024-02-27 01:28:11
sounds like the time you make a meta issue
afed
2024-02-27 01:32:55
nn downsizing would be also helpful for pixel art and i even saw a pr for that somewhere
JendaLinda
2024-02-27 01:33:36
Pictures, where all pixels are arranged in 2x2 squares (double pixels) could be losslessly downscaled, although that is a kind of specific case.
Orum
2024-02-27 01:34:35
yeah, a lot of pixel art games actually have non-pixel effects placed on top of them
spider-mario
2024-02-27 01:34:48
if we could have access to the state of the SNES when the screenshot was taken, that would open up a lot of possibilities
2024-02-27 01:34:50
https://cdn.shopify.com/s/files/1/0444/0919/2598/files/pasted_image_0_1_large_927cb3cf-8de9-4527-a5e4-01a1485ef2d3_480x480.png?v=1601875582
Orum
2024-02-27 01:35:12
few can actually be integer scaled down and back up to the screenshot resolution (without any changes)
lonjil
2024-02-27 01:37:46
modern pixel art style games, anyway
2024-02-27 01:38:10
obviously those that were actually created for low resolution systems can't have non-pixel effects on top of their pixel art
afed
afed nn downsizing would be also helpful for pixel art and i even saw a pr for that somewhere
2024-02-27 01:38:12
https://github.com/libjxl/libjxl/pull/2571
jonnyawsom3
2024-02-27 01:51:42
It works well, but is a bit of a hassle to get it to trigger properly sometimes https://github.com/libjxl/libjxl/issues/2738
2024-02-27 01:52:40
I'm sure I had a case where trying to change upsampling resulted in an error, but I was also using GIF animations and had frame blending cause issues too
spider-mario if we could have access to the state of the SNES when the screenshot was taken, that would open up a lot of possibilities
2024-02-27 01:57:45
Sounds like a PR for an emulator will be in order one day
Nyao-chan
Orum for my screenshot tests, it seems to be largely in pixel art games (e.g. Skul: The Hero Slayer) or games with very fine detail/noise (Age of Empires 2, both the Definitive Edition and the HD Edition)
2024-02-27 02:06:26
I have a screenshot of the end from minecraft. like 50% is the skybox, which is extremely noisy it took like 40 minutes, but jxl is by far the best compression for that image: ``` 9545 1.jxl 11179 1.zpaq 11250 1.7z 18112 1.png 20253 1.webp 172801 1.ppm ``` https://www.mediafire.com/view/v8ppwztxuqs5f4v/1.png/file
2024-02-27 02:06:48
10240x5760
Orum
2024-02-27 02:07:02
yeah, it very much depends on the image itself
Nyao-chan
2024-02-27 02:19:32
my bad, webp is actally 20253 K, didn't use `-lossless`. also changed to `-m 6`
2024-02-27 02:22:02
Another fun case: ``` 21K 1.jxl 45K 1.webp 59K 1.7z 106K 1.png 114K 1.zpaq 169M 1.ppm ``` Image scaled down to 1080p
username
Nyao-chan my bad, webp is actally 20253 K, didn't use `-lossless`. also changed to `-m 6`
2024-02-27 02:26:25
should probably use `-z 9` with cwebp to get the max lossless effort because the effort for lossless encoding is based on a combo of `-q` and `-m` with `-z` setting both of them, also I would recommend using `-mt` with cwebp as well since it speeds things up for the same final output.
Nyao-chan
2024-02-27 02:27:28
I did. that's the first time I used cwebp, so if there are other flags, please let me know ` cwebp -mt -z 9 -lossless -o 1.webp -m 6 1.ppm`
2024-02-27 02:28:25
``` zpaq -m511.1 a 1.zpaq 1.ppm 7z a -t7z -m0=lzma2:d1024m -mx=9 -mfb=64 -md=32m -ms=on -mhe 1.7z 1.ppm zopflipng -m 1.png 1.png ```
username
2024-02-27 02:30:38
other useful flags I would say are `-alpha_filter best` and `-metadata icc`
Orum
2024-02-27 02:31:34
The fastest speed I've seen that produced the smallest <:JXL:805850130203934781> image (of any speed, for a given image) is 4 so far, but perhaps most interesting is I've yet to find an image where 5 or 6 were the smallest <:Thonk:805904896879493180>
Nyao-chan
username other useful flags I would say are `-alpha_filter best` and `-metadata icc`
2024-02-27 02:33:23
saves 1 kB on the second image no alpha in the source
jonnyawsom3
Orum The fastest speed I've seen that produced the smallest <:JXL:805850130203934781> image (of any speed, for a given image) is 4 so far, but perhaps most interesting is I've yet to find an image where 5 or 6 were the smallest <:Thonk:805904896879493180>
2024-02-27 02:36:19
On lossy I assume?
Orum
2024-02-27 02:36:53
lossless
2024-02-27 02:38:35
perhaps most notable is I've found an image where `cwebp -z 0` is smaller than any other level of `-z`
2024-02-27 02:39:17
also found some where `-z 2` is the best, which I hadn't found before, but still haven't seen any where `-z 1` is
2024-02-27 02:40:59
very weird how `-e 9` often outperforms `-e 10` though (in terms of compression ratio)
2024-02-27 02:50:57
'Wins' of effort *within* each encoder: ``` cjxl -d 0 --streaming_input --streaming_output -e ... 4: 1 7: 2 8: 22 9: 353 10: 44 cwebp -z ... 0: 2 2: 1 3: 5 4: 20 5: 1 6: 1 7: 16 8: 32 9: 349 ```efforts not listed had 0 wins, and sometimes different efforts would tie, which is why they don't add up to the same totals
Nyao-chan
2024-02-27 02:53:21
that 21k jxl was from 2021/06/07. funny thing is I can't recreate it now on the main branch. `-e 10 -I 100 -E 3 -d 0 -g 2 ` takes like 6 minutes and gives 29K `-e 11` crashes on 32 GB ram
afed
2024-02-27 02:58:10
with git changes `-e 9` should be slightly worse, also `-e 10` doesn't use streaming mode by default, which is the point why it even exists, because it makes efficiency worse on average and `-e 10` is basically `-e 9` without streaming mode
Orum
2024-02-27 02:58:49
still, I don't think e 10 should be both slower and worse ratio than e 9, even if streaming mode is forced
2024-02-27 02:59:17
but hey, that may have already changed, as you said
Nyao-chan
2024-02-27 02:59:23
get the new build
2024-02-27 02:59:38
https://artifacts.lucaversari.it/libjxl/libjxl/latest/
Orum
2024-02-27 02:59:49
I'll stick on stable tags; I have enough work to do without testing every git commit
afed
Orum but hey, that may have already changed, as you said
2024-02-27 03:00:41
yeah, but in the new version so most likely `-e 9` will always be a bit worse than `-e 10`, even with streaming mode
Nyao-chan
2024-02-27 03:00:41
the new one specifically changes `-e 9` to fix that issue
Orum
2024-02-27 03:10:38
also, wins *between* the different encoders: ``` cjxl 7: 2 8: 14 9: 317 10: 40 cwebp 0: 2 2: 1 3: 1 4: 1 7: 4 8: 4 9: 36```
monad
Orum Here's a good example. Best cjxl could do was 81,570 B, more than 43% more than cwebp's best.
2024-02-27 07:25:38
57596B d0e10P0I0g3
2024-02-27 07:25:57
Just use the right parameters for the job.
yoochan we should open an issue with all pathological files 😄
2024-02-27 07:30:03
feel free to help populate this thread https://discord.com/channels/794206087879852103/1187313089612369991
2024-02-27 07:30:40
(I guess the name is outdated by now)
Nyao-chan
monad 57596B d0e10P0I0g3
2024-02-27 09:03:00
did you have to set P0? doesn't E10 "mix everything" and find it itself? I wonder if I need to check that to find the best one
Orum
monad Just use the right parameters for the job.
2024-02-27 09:44:53
I hope you're joking <:KekDog:805390049033191445>
jonnyawsom3
Nyao-chan did you have to set P0? doesn't E10 "mix everything" and find it itself? I wonder if I need to check that to find the best one
2024-02-28 02:12:56
e 10 was moved to e 11 in 0.10
monad
Nyao-chan did you have to set P0? doesn't E10 "mix everything" and find it itself? I wonder if I need to check that to find the best one
2024-02-28 09:42:40
it will build a tree using various predictors including zero, but in this case it's better not to use tree prediction, which the encoder will not figure out until e11.
Orum I hope you're joking <:KekDog:805390049033191445>
2024-02-28 09:46:11
nope, this is standard for scaled pixel art, except patches are usually bad when you don't have text.
2024-02-28 10:34:52
``` mean colors/px | mean patches/no patches images mean MP | | mean e3/e1 | share | share | | | tag 9 37.50% 0.75 37.14% 0.00 1.00 1.84 DirectClass_sRGB 7 29.17% 0.60 23.42% 0.00 1.00 2.41 DirectClass_sRGB_Alpha 7 29.17% 0.86 33.46% 0.00 0.98 1.77 PseudoClass_sRGB 1 4.17% 1.08 5.98% 0.00 1.01 3.15 PseudoClass_sRGB_Alpha 24 100.00% 0.75 100.00% 0.00 1.00 2.04 all 24 100.00% 0.75 100.00% 0.00 1.00 2.04 pixel_art_scaled 12 50.00% 0.75 50.06% 0.00 1.01 2.03 source_imagemagick 12 50.00% 0.75 49.94% 0.00 0.99 2.05 source_web Pareto front for user+system time and size |included in 'all' mean Mpx/(user+system s) || mean bpp mins | best of U· 0.15808231 100.00% 0.0731772 all UA 0.16293870 58.33% 0.36356 cjxl_0.9.0_d0e9P0I0g3modular_palette_colors10000patches0num_threads0 UA 0.16759048 4.17% 0.60918 cjxl_0.9.0_d0e9P0I1g3patches0num_threads0 UA 0.16986516 8.33% 0.82549 cwebp_1.2.4_z9 UA 0.17222839 4.17% 30.9 cwebp_1.2.4_z7 ·A 0.17234923 4.17% 0.46346 cjxl_0.9.0_d0e9P0I100g3patches0num_threads0 U· 0.17480589 ····· 31.9 cwebp_1.2.4_z6 U· 0.17822351 ····· 34.5 cwebp_1.2.4_z4 UA 0.18057047 8.33% 34.5 cwebp_1.2.4_z3 UA 0.18661758 4.17% 40.1 cwebp_1.2.4_z2 ·A 0.19439822 4.17% 0.57685 cjxl_0.9.0_d0e9E3I100g3Y0patches0num_threads0 ·A 0.19771261 4.17% 1.1405 cjxl_0.9.0_d0e9g3num_threads0 U· 0.20444330 ····· 50.8 cwebp_1.2.4_z1 U· 0.40893762 ····· >7.5e+02 original```
Orum
2024-02-28 10:47:17
my point is users shouldn't have to tune 4 different parameters to get a decent result
jonnyawsom3
2024-02-28 10:51:25
Yeah, manual tweaking is just a mitigation, the decisions the encoder makes can always be improved
Demiurge
2024-02-28 11:56:51
It might be cool if the encoder had tuning modes like x264 does
2024-02-28 11:57:08
photo mode vs pixel art mode etc
Nyao-chan
e 10 was moved to e 11 in 0.10
2024-02-28 12:15:51
in the help message, "mix everything" is paired with `-e 9`, so it should now happen with `-e 10`
jonnyawsom3
2024-02-28 12:20:21
Oh, I thought by "find it itself" you meant the brute force mode that tries every combo of settings
fab
2024-02-29 01:41:00
The encoder seems good to me
2024-02-29 02:12:52
24,6% better than webp at e10
2024-02-29 02:13:52
2024-02-29 02:14:06
Fb on some images ard optimized by me still is amazing
diskorduser
2024-02-29 04:21:59
fab is at work again.
Traneptora
2024-02-29 07:03:07
why are fuzzerbugs being tagged as unrelated-to-1.0?
2024-02-29 07:03:11
I feel like those are important bug fixes
2024-02-29 07:03:14
for a final release
Orum
2024-02-29 09:33:05
sometimes I wonder why we even have image codecs 😮‍💨 ```769M ./factorio.ppm 121M ./factorio.ppm.xz 368M ./factorio-8.jxl 366M ./factorio.png```
RockPolish
2024-02-29 09:39:13
that's such a strangely large difference, any way I can download that image and toy with it too?
Traneptora
Orum sometimes I wonder why we even have image codecs 😮‍💨 ```769M ./factorio.ppm 121M ./factorio.ppm.xz 368M ./factorio-8.jxl 366M ./factorio.png```
2024-02-29 09:53:01
possibly relevant: https://github.com/Traneptora/xz-pixbuf-loader
Orum
RockPolish that's such a strangely large difference, any way I can download that image and toy with it too?
2024-02-29 09:54:17
it's because factorio screenshots have a lot of reused sprites (as this image does)
2024-02-29 09:54:39
going to try with patches to see if that can redeem <:JXL:805850130203934781> at all
Traneptora
Orum sometimes I wonder why we even have image codecs 😮‍💨 ```769M ./factorio.ppm 121M ./factorio.ppm.xz 368M ./factorio-8.jxl 366M ./factorio.png```
2024-02-29 09:58:54
in either case, lossless webp is very good at palette detection and that sort of thing, so try doing `cwebp -z 9 factorio.png -o factorio.webp` and see how it goes
Orum
2024-02-29 09:59:18
the image is too large for webp
Traneptora
2024-02-29 09:59:33
oof
2024-02-29 09:59:39
XZ pixbuf loader to the rescue then kekw
afed
2024-02-29 10:02:18
jxl also most likely, but with customized settings and without streaming
Orum
2024-02-29 10:08:06
without streaming is just pain though 💀
2024-02-29 10:08:25
would rather always use xz at that point
afed
2024-02-29 10:14:23
also with P0 it's fast enough without streaming and it's good for images like this, though not always
jonnyawsom3
Orum it's because factorio screenshots have a lot of reused sprites (as this image does)
2024-02-29 10:25:07
This is why Veluca mentioned the idea of lz77 patch detection. So it can find sprites and reuse them across the image
Orum
2024-02-29 10:26:12
yeah that would be very nice <:BlobYay:806132268186861619>
afed
2024-02-29 10:27:44
but it's about 2x2 patches and the like, much smaller than needed for sprites though just improved lz77 could be good too, like in webp
jonnyawsom3
2024-02-29 10:31:00
Well, 2x2 was a suggestion, I'd assume it could be increased or other heuristics used
veluca
2024-02-29 11:35:12
I just meant "start with 2x2 corner, then extend"
Orum
2024-02-29 11:45:16
right, but for sprite-based graphics I'm not sure how much it would help?
afed
2024-02-29 11:48:51
it doesn't matter if it's sprites or not, patches merges all similar patterns
veluca
2024-02-29 11:50:00
why wouldn't it?
Orum
2024-02-29 11:56:32
sprites may not be aligned to the corners
jonnyawsom3
2024-02-29 11:57:32
He means just start in the corner, then expand to (probably) the entire image
veluca
2024-03-01 12:07:16
or the entire sprite
190n
Traneptora why are fuzzerbugs being tagged as unrelated-to-1.0?
2024-03-01 12:07:25
i'm curious about this too
CrushedAsian255
2024-03-01 03:35:23
how is the format pronounced?
2024-03-01 03:35:26
jay peg excel?
2024-03-01 03:35:29
jay excel?
2024-03-01 03:35:45
jeck-sel?
190n
2024-03-01 03:36:02
first 2
CrushedAsian255
2024-03-01 03:37:11
the first for the format name and the second for the file format?
jonnyawsom3
2024-03-01 03:54:58
Well, whenever you see jpegxl or jxl respectively
Oleksii Matiash
CrushedAsian255 how is the format pronounced?
2024-03-01 05:30:17
Depends on where you live 🙂
CrushedAsian255
2024-03-01 05:31:07
Huh Chinese I guess just drop the L?
2024-03-01 05:31:12
_wb_
2024-03-01 06:03:16
The confusion between XR and XL in languages that do not have both phonemes is not something that was sufficiently considered.
CrushedAsian255
_wb_ The confusion between XR and XL in languages that do not have both phonemes is not something that was sufficiently considered.
2024-03-01 06:34:04
That’s Japanese I think not Chinese
w
2024-03-01 06:34:30
chinese has distinct L and R
CrushedAsian255
2024-03-01 06:35:09
Yeah
2024-03-01 06:35:21
Leng: cold
2024-03-01 06:35:28
Peng: hit? I can’t fully remember
gb82
Orum sometimes I wonder why we even have image codecs 😮‍💨 ```769M ./factorio.ppm 121M ./factorio.ppm.xz 368M ./factorio-8.jxl 366M ./factorio.png```
2024-03-01 07:41:57
try qoi
yoochan
Orum sometimes I wonder why we even have image codecs 😮‍💨 ```769M ./factorio.ppm 121M ./factorio.ppm.xz 368M ./factorio-8.jxl 366M ./factorio.png```
2024-03-01 08:13:05
a 769 Mo screenshot ?! what a huge screen you have !
CrushedAsian255
yoochan a 769 Mo screenshot ?! what a huge screen you have !
2024-03-01 08:50:09
256mpx
2024-03-01 08:50:20
Must be some kind of mod
2024-03-01 08:50:36
That’s 16k by 16k or something
yoochan
2024-03-01 08:52:05
more than the las vegas sphere !! 16k x 8k
lonjil
CrushedAsian255 Must be some kind of mod
2024-03-01 09:28:22
The game's built in screenshot command lets you specify any size.
jonnyawsom3
2024-03-01 11:00:58
Yeah, pauses logic and takes tiled captures if I recall
plantain
2024-03-01 12:02:05
I read the Pareto Front article about JXL which says there's a very significant speedup in libjxl 0.10 from some kind of streaming encoder changes. Do clients need to change anything to benefit from that?
2024-03-01 12:02:25
I use libjxl via GDAL, will the GDAL implementation have to change or will it benefit automatically?
yoochan
2024-03-01 12:03:39
I guess GDAL will have to update the libjxl they use, and activate the options when calling the encoding function
plantain
2024-03-01 12:08:10
I can't see any options that appear to have been added in 0.10?
2024-03-01 12:09:13
if it's just flipping a flag I will do it myself
Orum
lonjil The game's built in screenshot command lets you specify any size.
2024-03-01 12:17:24
nah, it limits you to 16384²
lonjil
2024-03-01 12:17:35
rip
Orum
2024-03-01 12:17:57
well that's still not bad, considering it forces you to (initially) encode in png
2024-03-01 12:18:26
I wish it would just give me ppm or xz'ed ppm output
gb82 try qoi
2024-03-01 12:20:15
qoi is generally worse (in ratio) than png, no?
afed
2024-03-01 12:23:40
theoretically this could be used to make infinite resolution screenshots https://github.com/Palats/mapshot
lonjil
Orum qoi is generally worse (in ratio) than png, no?
2024-03-01 12:23:54
yes, and slower than fpng and fpnge
Orum
2024-03-01 12:24:55
yeah, I always saw little reason to even bother testing it, based on what I read elsewhere
afed
2024-03-01 12:25:20
worse than optimized png, but maybe there are some cases when qoi will be better
Orum
afed theoretically this could be used to make infinite resolution screenshots https://github.com/Palats/mapshot
2024-03-01 12:27:02
I'm so glad this exists, as it saves me the trouble of writing it myself <:CatSmile:805382488293244929>
yoochan
Orum yeah, I always saw little reason to even bother testing it, based on what I read elsewhere
2024-03-01 12:27:02
the reason to add it is that QOI have a LOT of support ! mainly because it can be implemented over a week-end in your favorite language.
Orum
2024-03-01 12:28:53
that's cool and all from a developer perspective, but from a user perspective, if you're not moving the pareto front then it's hard to get excited about it
lonjil
2024-03-01 12:29:09
but your favorite language probably already has good png library support
yurume
2024-03-01 12:32:38
the main selling point of QOI is indeed a simplicity, which doesn't exactly correlate to performance in one or another axes 🙂
2024-03-01 12:32:56
besides from that though, the fundamental design of QOI does limit its own performance
2024-03-01 12:33:30
so while QOI is a really good educational project, it is not very useful as a basis of small but performant codec
Orum
2024-03-01 12:37:03
this is rather interesting though, as several of my factorio screenshots are definitely better in <:JXL:805850130203934781> than anything else I try (webp, xz'ed ppm, and optimized png)
2024-03-01 12:37:23
I suspect it all depends on how much area is of a perfectly regular repeating pattern
2024-03-01 12:38:02
should be easy to find a (much smaller than 16k²) pathological case then
afed
2024-03-01 12:42:08
probably also `-e 10` + `-I 1 -P 0 -g 3` or `-I 0 -P 0 -g 3` is worth a try, it will perhaps disable streaming mode, but it's faster and less heavy than the normal `-e 10`
Quackdoc
Orum qoi is generally worse (in ratio) than png, no?
2024-03-01 12:44:05
I find it's about 50:50 if I don't bother with ect and just use magick or ffmpeg. but it's kinda fast to decode which is neato
Orum
afed probably also `-e 10` + `-I 1 -P 0 -g 3` or `-I 0 -P 0 -g 3` is worth a try, it will perhaps disable streaming mode, but it's faster and less heavy than the normal `-e 10`
2024-03-01 12:44:13
well when I tried your patches suggestion it started running illegal instructions <:KekDog:805390049033191445>
afed
2024-03-01 12:45:32
for smaller samples, it's simpler to just crop some part of a large screenshot that closely resembles the typical pattern of the entire image
Orum
2024-03-01 12:47:12
well, it looks like I've managed to do just that: ```8.5M ./factorio-9.jxl 5.6M ./factorio.png 2.6M ./factorio-9.webp 2.3M ./factorio.ppm.xz```
afed
Orum well when I tried your patches suggestion it started running illegal instructions <:KekDog:805390049033191445>
2024-03-01 12:47:40
then it probably doesn't do much to reduce memory consumption, just easier to encode <:PepeSad:815718285877444619>
Orum
2024-03-01 12:48:13
anyway here is the image if people want to play around with it
Quackdoc
Orum well, it looks like I've managed to do just that: ```8.5M ./factorio-9.jxl 5.6M ./factorio.png 2.6M ./factorio-9.webp 2.3M ./factorio.ppm.xz```
2024-03-01 12:51:52
ppm supremacy confirmed
Orum
2024-03-01 12:52:21
more like xz supremacy
afed
2024-03-01 12:52:41
jxl `-e 0` for advanced ppm <:FeelsAmazingMan:808826295768449054>
Quackdoc
2024-03-01 12:52:43
make ppm.xz a proper image format [av1_woag](https://cdn.discordapp.com/emojis/852007419474608208.webp?size=48&quality=lossless&name=av1_woag)
Orum
2024-03-01 12:56:41
oh wow, *not* using streaming results in a *much* smaller <:JXL:805850130203934781>: 2.6M
2024-03-01 12:57:11
wild that the streaming one is more than 3 times the size...
2024-03-01 12:59:37
still beaten by xz though <:SadOrange:806131742636507177>
afed
2024-03-01 12:59:37
pretty predictable because streaming uses smaller independent blocks instead of the whole image, so large single colored images or repeating patterns don't compress well
afed jxl `-e 0` for advanced ppm <:FeelsAmazingMan:808826295768449054>
2024-03-01 01:02:07
i wonder if disable compression, put the image in metadata and use brotli for encoding <:FeelsAmazingMan:808826295768449054>
Orum
2024-03-01 01:02:29
yeah, the problem is utilization drops off a cliff when not using streaming, and memory use goes way up, but I suppose there's no free lunch
afed
afed probably also `-e 10` + `-I 1 -P 0 -g 3` or `-I 0 -P 0 -g 3` is worth a try, it will perhaps disable streaming mode, but it's faster and less heavy than the normal `-e 10`
2024-03-01 01:03:04
and with these settings?
jonnyawsom3
afed i wonder if disable compression, put the image in metadata and use brotli for encoding <:FeelsAmazingMan:808826295768449054>
2024-03-01 01:03:29
Horrible idea. I love it
Orum
afed and with these settings?
2024-03-01 01:04:11
Haven't tried yet. Working on a script to redo my testing *without* streaming. You're welcome to though as you can download the image 🥰
afed
2024-03-01 01:05:17
<:FeelsAmazingMan:808826295768449054>
2024-03-01 01:06:07
slightly larger, but 10x faster to decode than lzma
Orum
2024-03-01 01:06:11
so it looks like down to `-e 7` encoding is still very parallel (when not using streaming), and then after that is when utilization drops to only ~225%
2024-03-01 01:08:10
size was still pretty good at e 7 though, only 2.7 M
Quackdoc
2024-03-01 01:10:23
zstd btfo
Orum
2024-03-01 01:10:37
zstd is made for speed, not max ratio
Quackdoc
2024-03-01 01:14:11
it decodes too fast though T.T
2024-03-01 01:14:14
```ps hyperfine --runs 20 'taskset 00000001 brotli -d factorio.ppm.br --stdout > /dev/null' 'taskset 00000001 zstd -d factorio.ppm.zst --stdout > /dev/null' Benchmark 1: taskset 00000001 brotli -d factorio.ppm.br --stdout > /dev/null Time (mean ± σ): 48.4 ms ± 2.2 ms [User: 40.3 ms, System: 7.8 ms] Range (min … max): 45.3 ms … 52.8 ms 20 runs Benchmark 2: taskset 00000001 zstd -d factorio.ppm.zst --stdout > /dev/null Time (mean ± σ): 29.3 ms ± 1.9 ms [User: 18.7 ms, System: 10.4 ms] Range (min … max): 26.8 ms … 35.1 ms 20 runs Summary taskset 00000001 zstd -d factorio.ppm.zst --stdout > /dev/null ran 1.65 ± 0.13 times faster than taskset 00000001 brotli -d factorio.ppm.br --stdout > /dev/null ```
2024-03-01 01:15:20
wait I think cpu is bugged
2024-03-01 01:15:40
fixed
afed
afed probably also `-e 10` + `-I 1 -P 0 -g 3` or `-I 0 -P 0 -g 3` is worth a try, it will perhaps disable streaming mode, but it's faster and less heavy than the normal `-e 10`
2024-03-01 01:15:46
nope, for this image, it's not better <:FeelsSadMan:808221433243107338>
_wb_
plantain I use libjxl via GDAL, will the GDAL implementation have to change or will it benefit automatically?
2024-03-01 02:48:57
It will get most of the benefits automatically (assuming it uses an updated libjxl). For the full memory reduction benefits it needs to use the chunked encoding API, but that makes a relatively small difference compared to the improvement you get even when calling the encoder with full buffers.
plantain
2024-03-01 02:49:28
that's great. I'll just build with an update libjxl then
2024-03-01 02:49:56
I have ~100 cores running 24/7 making JXL's of satellite imagery...
2024-03-01 03:00:03
(thanks all for JXL!)
yoochan
2024-03-01 03:07:17
100 cores ? can you toast bread at the same time ?
_wb_
Orum anyway here is the image if people want to play around with it
2024-03-01 03:09:06
interesting image — it looks a bit like it could be a palette image, but it does have quite a lot of different colors: ``` $ identify -format "%k\n" factorio.ppm 111539 ```
2024-03-01 03:10:11
and it looks like it has a lot of repeating patterns but it seems like the repetition is not quite exact
Orum
2024-03-01 03:10:38
yeah, which surprises me somewhat that xz/LZMA does so well with it
2024-03-01 03:14:51
in any case it looks like I will have to abandon streaming input/output for any cases where it's not absolutely necessary <:FeelsSadMan:808221433243107338>
jonnyawsom3
_wb_ and it looks like it has a lot of repeating patterns but it seems like the repetition is not quite exact
2024-03-01 03:20:49
The game uses tiles and sprites, but overlapping sprites, particle effects and lighting mean they're very rarely exact matches
yoochan
Quackdoc zstd btfo
2024-03-01 03:24:33
with lzip you can shave 4kb more 😄 (the factorio.ppm.lz lands at 2361189 bytes)
Quackdoc
2024-03-01 03:25:00
*we have confirmed lzip supremacy*
yoochan
The game uses tiles and sprites, but overlapping sprites, particle effects and lighting mean they're very rarely exact matches
2024-03-01 03:41:23
I could make a quick identification of identical areas (3x3 pixels) and there is many ! Here are only plotted the most frequent repetitions, but I catch many more. For the sake of simplicity, the script only scan the Green channel...
sklwmp
2024-03-01 03:42:06
zpaq gets us to 2170558 bytes at max compression
jonnyawsom3
2024-03-01 03:42:33
At 1:1 zoom, the sprites are 32x32 max (If I recall) with 64x64 possible with mods
afed
2024-03-01 03:43:50
srep is just deduplication without compression
yoochan
At 1:1 zoom, the sprites are 32x32 max (If I recall) with 64x64 possible with mods
2024-03-01 03:44:11
do you mean patches ? what is the minimal size ?
jonnyawsom3
2024-03-01 03:44:30
No, I mean in Factorio
yoochan
2024-03-01 03:44:40
oh, oki
2024-03-01 03:46:13
The approach I try here (and it seems to work) is to do a first pass and detect identical 3x3 patches (which is relatively fast with a hash table) and then grow around to see if we can grab a bigger area... (not implemented yet)
2024-03-01 03:46:52
I hope it could lead to some way to use patches... if not too slow
jonnyawsom3
At 1:1 zoom, the sprites are 32x32 max (If I recall) with 64x64 possible with mods
2024-03-01 03:48:02
Scratch that, the game is made of tiles, and each tile can have 64 pixels max, but a sprite can cover many tiles
yoochan
2024-03-01 03:48:30
I see, make sense
2024-03-01 03:56:38
I wonder what the minimal size of a patch could be before it becomes useless. I guess it may depends on how many times it is used
afed
2024-03-01 03:59:46
lolz v22c4b
VcSaJen
Quackdoc make ppm.xz a proper image format [av1_woag](https://cdn.discordapp.com/emojis/852007419474608208.webp?size=48&quality=lossless&name=av1_woag)
2024-03-01 04:05:10
Well, .tar.gz is already a "proper format", so .ppm.xz can follow
_wb_
2024-03-01 04:05:50
clearly there is redundancy in that image that can be exploited but libjxl isn't finding it. Between patches and lz77 there should be enough coding tools to do something better, but of course you need an encoder that uses them effectively. Current patch detection heuristics will not do much on an image like this (they require solid background), and it doesn't look like lz77 by itself is doing much either.
2024-03-01 04:06:09
$ cjxl factorio.ppm -d 0 factorio.ppm.jxl -g 3 -X 0 -Y 0 -C 5 -e 10 JPEG XL encoder v0.10.0 a070f827 [NEON] Encoding [Modular, lossless, effort: 10] Compressed to 5512.9 kB (5.317 bpp). 3840 x 2160, 0.035 MP/s [0.03, 0.03], 1 reps, 12 threads.
2024-03-01 04:06:17
not a great result
Orum
2024-03-01 05:53:03
oof <:AngryCry:805396146322145301>
gb82
Orum qoi is generally worse (in ratio) than png, no?
2024-03-01 06:03:16
I just wanted to see how it'd do
Orum
2024-03-01 06:03:42
well, you're welcome to download the image above
2024-03-01 06:03:47
I don't even have QOI installed
gb82
2024-03-01 06:03:50
Ah okay, didn't see that
Orum
2024-03-01 06:27:46
it's not possible for non-stream encoding to produce larger lossless output than stream encoding (with all other options being the same), is it?
_wb_
2024-03-01 06:30:07
Everything is possible
afed
2024-03-01 06:30:48
possible, especially on photos
Orum
2024-03-01 06:30:58
ugh, okay, good to know
2024-03-01 07:11:47
well `-e 9` with streaming in/out seems to generally outperform `-e 7` without streaming, at least when it comes to compression ratio
2024-03-01 07:16:11
~~and obviously, there are some exceptions, sometimes where non-streaming is **much** better~~ actually nvm, that was webp that was massively outperforming it, not the non-streaming mode
gb82
2024-03-01 11:49:18
2024-03-01 11:50:31
so yeah qoi misses on this one
ProfPootis
2024-03-02 01:58:50
I'm thinking about using Flutter for an app. It seems it doesn't have jpeg xl support, but a plugin might. If anyone can point me in that direction I'd appreciate it.
Quackdoc
2024-03-02 06:26:43
the easiest way would probably be jxl-oxide + rinf
gb82
2024-03-02 07:25:04
is jpegxl.info down for anyone else?
2024-03-02 07:26:31
nvm just came back
Orum
gb82 so yeah qoi misses on this one
2024-03-02 01:02:57
unfortunate, but doesn't surprise me
afed
afed possible, especially on photos
2024-03-02 01:28:38
seems that the default streaming mode (without i/o) up to e3 can be slightly worse or even better sometimes, but on slower efforts it's mostly worse, sometimes noticeably although it's very quick comparisons and need to recheck, maybe I'm using too old version for the test without streaming mode
Orum
2024-03-02 01:38:40
yeah, I've noticed it that streaming is almost always better than non-streaming (when going up to e 9 on both), but I need to test on more images
HCrikki
2024-03-02 02:50:36
about the conformance test, is it up to date? wondering about the conformance of implementation by the various tools implementing decoding and how they do it (ie integrating a current or old libjxl or imagemagick)
VcSaJen
2024-03-02 05:09:51
Speaking of implementations, I wonder about their performance, and their API (like support of progressive decoding and stuff)
ProfPootis
Quackdoc the easiest way would probably be jxl-oxide + rinf
2024-03-02 05:34:29
ty!
Orum
2024-03-02 08:32:48
anyone have an example image where lossless non-streaming produced smaller output than streaming (excluding e 10)?
afed
2024-03-02 08:39:29
most likely qoi_benchmark_suite.tar will have some such images, especially for e4-e8, I haven't checked, but it's happened on pretty similar images https://qoiformat.org/benchmark/
Orum
2024-03-02 08:39:56
danke
jonnyawsom3
Orum anyone have an example image where lossless non-streaming produced smaller output than streaming (excluding e 10)?
2024-03-03 02:15:30
When you say lossless non-streaming Do you mean 0.9 or something else?
Orum
2024-03-03 02:15:47
0.10.x
2024-03-03 02:16:08
just not putting --streaming_input/--streaming_output options in
jonnyawsom3
2024-03-03 02:16:13
So, how are you making it non-streaming?
2024-03-03 02:16:16
Oh, right
2024-03-03 02:16:24
It still streams internally
Orum
2024-03-03 02:16:35
yeah but not to the same degree
jonnyawsom3
2024-03-03 02:16:43
Interesting
Orum
2024-03-03 02:18:11
well, actually, I'm not sure--it could be there is no difference, and that's why my script is always showing streaming encodes, but it does the streaming encodes first, and only accepts a "new" encode if it's smaller
2024-03-03 02:18:17
so they could, in fact, be tied
2024-03-03 02:19:06
but so far I've yet to find a non-streaming encode that is smaller than all streaming encodes
CrushedAsian255
2024-03-03 02:40:12
``` -R K, --responsive=K Do the Squeeze transform, 0=false, 1=true (default: 1 if lossy, 0 if lossless)``` does squeeze still work on lossless input?
2024-03-03 02:40:16
or does it break things?
Traneptora
CrushedAsian255 ``` -R K, --responsive=K Do the Squeeze transform, 0=false, 1=true (default: 1 if lossy, 0 if lossless)``` does squeeze still work on lossless input?
2024-03-03 07:02:04
yea, squeeze works for lossless. it doesn't really save any space though
2024-03-03 07:02:55
basically the gist of squeeze is that it splits a channel into two channels of half-size. one of those is effectively a downscaled version of the channel
2024-03-03 07:03:29
the other channel encodes the residual information that is lost by the downscale
2024-03-03 07:03:51
when doing lossy, you can fudge the residuals (often by zeroing them) in a way that makes things more compressible
2024-03-03 07:04:24
with lossless you have to encode the residuals as-is, which is possible, but it isn't really more efficient than encoding the image without squeeze
2024-03-03 07:05:03
squeeze is reversible, provided you don't actually fudge the residuals
afed
Orum just not putting --streaming_input/--streaming_output options in
2024-03-03 07:51:09
but, i meant true non-streaming mode, like with a build without streaming by default and just without i/o, I haven't really tested much, unless sometimes e1 can be a bit smaller, but for other efforts it's mostly the same
monad
Orum so they could, in fact, be tied
2024-03-03 08:28:41
Orum
afed but, i meant true non-streaming mode, like with a build without streaming by default and just without i/o, I haven't really tested much, unless sometimes e1 can be a bit smaller, but for other efforts it's mostly the same
2024-03-03 11:34:17
🤔 yeah, I don't think it's worth testing both, as even if there are those where non-streaming is smaller, they're few and far between
monad
2024-03-03 11:34:53
ah yeah, so except for e 10 (non-streaming), there's no difference in size
2024-03-03 11:38:47
and e 10 (without streaming) is just too damn slow for me to use <:KekDog:805390049033191445>
2024-03-03 11:41:44
Anyway I guess if --streaming_output is on by default as you say afed, how do you turn it off? Is recompiling really the only way?
2024-03-03 11:42:09
perhaps the option should be renamed to `--disable_streaming_output`
afed
Orum 🤔 yeah, I don't think it's worth testing both, as even if there are those where non-streaming is smaller, they're few and far between
2024-03-03 11:42:36
for some content there is a pretty noticeable difference, sometimes for streaming, sometimes for non-streaming (like in older versions) though for fast presets this is compensated that they are faster with streaming, so it's possible to use a slower preset, but for single-threaded mode it might make some sense
Orum Anyway I guess if --streaming_output is on by default as you say afed, how do you turn it off? Is recompiling really the only way?
2024-03-03 11:43:33
i'm just using an older build
Orum
2024-03-03 11:43:42
oh <:FeelsSadMan:808221433243107338>
afed
2024-03-03 11:44:11
but some option would be much more useful
Orum
2024-03-03 11:44:39
well AFAICT, `--streaming_output` is on for all efforts *except* e 10 (and probably e 11 but I don't bother testing that), so the option is almost never useful
afed
afed but some option would be much more useful
2024-03-03 11:45:47
perhaps it would be better to use some setting for the buffer size or disable it completely (so it will be the old behavior)
jonnyawsom3
Orum Anyway I guess if --streaming_output is on by default as you say afed, how do you turn it off? Is recompiling really the only way?
2024-03-03 04:24:00
https://github.com/libjxl/libjxl/issues/3291
veluca
2024-03-03 04:26:38
--streaming_output is not on by default 😉
afed
2024-03-03 04:41:49
since the buffer size is already there (even if it doesn't work yet), it will be easier to change or disable streaming mode through the same option, also for cli ```jxl:2:d0:buf3 jxl:2:d0``` <https://github.com/libjxl/libjxl/pull/3265>
veluca --streaming_output is not on by default 😉
2024-03-03 04:56:33
is there any changes between 0.10.1 and 0.9.2 that affect lossless besides streaming mode?
2024-03-03 05:05:13
seems to be for pngimg in qoi_benchmark_suite, streaming mode is better for other sets almost the same or mostly slightly worse <:Thonk:805904896879493180>
2024-03-03 05:07:50
and pngimg it's mostly pngs with alpha channel
afed seems to be for pngimg in qoi_benchmark_suite, streaming mode is better for other sets almost the same or mostly slightly worse <:Thonk:805904896879493180>
2024-03-03 06:02:23
```effort 1 187 File(s) 187 328 444 bytes effort 1 streaming 187 File(s) 189 384 379 bytes effort 2 187 File(s) 177 703 485 bytes effort 2 streaming 186 File(s) 164 084 623 bytes effort 3 187 File(s) 156 171 092 bytes effort 3 streaming 186 File(s) 148 686 341 bytes effort 4 187 File(s) 152 129 454 bytes effort 4 streaming 186 File(s) 144 612 669 bytes effort 5 187 File(s) 146 048 834 bytes effort 5 streaming 186 File(s) 139 771 137 bytes effort 6 187 File(s) 143 401 887 bytes effort 6 streaming 186 File(s) 137 678 715 bytes effort 7 187 File(s) 139 026 417 bytes effort 7 streaming 186 File(s) 134 263 517 bytes```
2024-03-03 06:07:54
hmm, weird, some image for higher efforts doesn't seem to be encoded but, for some reason, it's fine just for effort 1
2024-03-03 06:10:02
i'll try again, after some optimizers <:PepeHands:808829977608323112>
2024-03-03 06:28:13
this png is not encoded for efforts other than 1 `libpng warning: iCCP: known incorrect sRGB profile` <:FeelsSadMan:808221433243107338>
CrushedAsian255
Traneptora squeeze is reversible, provided you don't actually fudge the residuals
2024-03-03 09:32:31
would squeeze help with progressive decoding lossless images? or is modular already somewhat progressive?
Traneptora
CrushedAsian255 would squeeze help with progressive decoding lossless images? or is modular already somewhat progressive?
2024-03-03 09:34:58
yes. that is the primary reason you'd want to squeeze a lossless image
2024-03-03 09:35:22
by default modular goes in raster order within the group
2024-03-03 09:35:48
if you use squeeze, you get a downscaled version of the image as a channel
2024-03-03 09:36:00
which can be upscaled and rendered, while the residuals are being decoded
CrushedAsian255
2024-03-03 09:36:12
then why wouldn't you use Squeeze by default then?
Traneptora
2024-03-03 09:36:21
because it increases the size of the image
2024-03-03 09:36:34
not by a lot, but by some
2024-03-03 09:36:44
progressive rendering tends not to be particularly important when combined with lossless
2024-03-03 09:37:07
usually the applications that want to render downscaled previews are the same ones that are likely going to be using lossy
2024-03-03 09:37:24
at least, that's why it's off by default. you can always turn it on ofc
CrushedAsian255
2024-03-03 09:37:33
ig cause something like websites most likely aren't using Lossless for anything other than logos and stuff
Traneptora
2024-03-03 09:37:39
yea, pretty much
CrushedAsian255
2024-03-03 09:37:40
and then logos are small enough anyways