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

benchmarks

Scientia
2021-05-22 10:36:42
Logically shouldn't cjxl be able to at least recognize that the two halves of this image are the same but mirrored?
2021-05-22 10:36:58
In both ways
2021-05-22 10:37:36
Can you do translation with patches?
2021-05-22 10:38:13
Logically you could reduce this to 2M if patches could translate
_wb_
2021-05-22 10:38:47
Patches cannot flip, no
Scientia
2021-05-22 10:39:02
Hm
_wb_
2021-05-22 10:40:22
Could make thin patches for every column on the left and copy them to corresponding columns on the right, I guess
Scope
2021-05-22 11:13:36
https://i.redd.it/9l003u3ltkq31.png ``` 471,000 - WebP 1,569,575 - PNG 2,093,942 - JXL (s9 E3 I1) 1,431,469 - JXL (-g 3) ```
veluca
2021-05-22 11:14:13
gee
2021-05-22 11:14:27
I mean, I get why
2021-05-22 11:14:29
but...
2021-05-22 11:15:16
I'll add something to my list for large, not text-like patches πŸ˜›
Scope
2021-05-22 11:17:53
Also about patches https://i.imgur.com/H98sH.png ``` 8,404 - WebP 6,999 - PNG 1,954 - FLIF 20,447 - JXL (s9 E3 I1) 14,608 - JXL (patches 0) 20,285 - JXL (-g 3) ```
veluca
2021-05-22 11:18:51
I guess this also counts as tree learning not doing a great job here...
2021-05-22 11:24:18
although: `./tools/cjxl H98sH.png -g 3 -I 0 -s 9 -P 9 -m --patches=0` Compressed to 14197 bytes (0.109 bpp).
2021-05-22 11:24:55
(has the advantage of being fast to decompress)
2021-05-22 11:25:16
I mean, it should be possible to do better
_wb_
2021-05-22 11:25:26
How large is the image?
Scope
2021-05-22 11:25:47
1023x1023
_wb_
2021-05-22 11:26:02
Then the FLIF size should be achievable
2021-05-22 11:26:14
Or better
2021-05-22 11:27:10
In a single group, for grayscale, there is literally nothing FLIF can do that jxl cannot do at least as well, I think
2021-05-22 11:27:57
But it can happen that FLIF's tree learning finds a better tree than cjxl's
veluca
2021-05-22 11:28:19
yeah, the tree learning in FLIF has very very little in common with the one in cjxl
_wb_
2021-05-22 11:28:33
It is almost completely different
veluca
2021-05-22 11:28:35
mostly they both learn trees, but that's it xD
_wb_
2021-05-22 11:28:56
Well they are both greedy, one split at a time
2021-05-22 11:29:12
So that kind of suboptimality they have in common
veluca
2021-05-22 11:29:22
true
_wb_
2021-05-22 11:29:33
But other than that, very different methods
veluca
2021-05-22 11:29:57
well, good to know we can do better πŸ˜›
_wb_
2021-05-22 11:31:13
Yes, I think a PhD or two could be written just on better MA tree learning
2021-05-22 11:32:24
Let alone the interactions with lz77 and with modular transforms
Scope
2021-05-22 11:33:37
However https://i.redd.it/nikixial60s21.png ``` 1,166 - WebP 805 - FLIF 184 - JXL (s9 E3 I1) 148 - BMF ```
_wb_
2021-05-22 11:34:37
That one could probably also be done in 40 bytes or so
Scope
2021-05-22 11:40:41
I showed this example before, but https://i.imgur.com/UL1fXgB.png ``` 14,410 - WebP 77,610 - FLIF 44,165 - JXL (s9 E3 I1) 54,605 - JXL (patches 0) 36,721 - JXL (X0 Y0) 27,319 - JXL (g 3) 12,940 - BMF```
_wb_
2021-05-22 12:18:15
Here the group limit comes at a cost compared to non-tiled codecs
veluca
2021-05-22 12:25:57
can you try -g 3 -I 0 -s 9 -P 0 --patches 0?
Deleted User
2021-05-22 12:26:28
Would `-E 3` help, too?
veluca
2021-05-22 12:26:51
I'd assume this would get palette'd
_wb_
2021-05-22 12:27:07
Not on grayscale images or other effectively 1 channel images
veluca
2021-05-22 12:27:42
ah, but I think this has subpixel rendering
Scope
veluca can you try -g 3 -I 0 -s 9 -P 0 --patches 0?
2021-05-22 12:28:05
```28 665 (-g 3 -I 0 -s 9 -P 0) 33 154 (-g 3 -I 0 -s 9 -P 0 --patches 0)```
_wb_
2021-05-22 12:28:20
I hate subpixel rendering with a passion
veluca
2021-05-22 12:28:39
not too bad... other values of P might be interesting too πŸ˜„ (up to 13 IIRC)
_wb_ I hate subpixel rendering with a passion
2021-05-22 12:28:48
fair enough πŸ˜›
_wb_
2021-05-22 12:28:57
``` $ ./cjxl UL1fXgB.png t.jxl -m -g 3 -I 0 -s 9 -P 0 --patches 0 J P E G \/ | /\ |_ e n c o d e r [v0.3.7 | SIMD supported: Neon] ../lib/extras/codec_png.cc:505: PNG: no color_space/icc_pathname given, assuming sRGB Read 1167x865 image, 23.2 MP/s Encoding [Modular, lossless, tortoise], 8 threads. Compressed to 33164 bytes (0.263 bpp). 1167 x 865, 0.03 MP/s [0.03, 0.03], 1 reps, 8 threads. ```
2021-05-22 12:29:14
I get a weirdly different result
Deleted User
_wb_ I hate subpixel rendering with a passion
2021-05-22 12:29:26
Fortunately at least it's a text console, the font is monospace and aligned so the letters are pixel-exact matches
_wb_
2021-05-22 12:30:13
Patches actually help a bit
2021-05-22 12:30:27
But probably most of them are not detected here
veluca
2021-05-22 12:30:35
yup, but -I 0 decodes a lot faster so...
Deleted User
_wb_ Patches actually help a bit
2021-05-22 12:30:55
A bit? The whole thing can be encoded with patches!
Scope
_wb_ I get a weirdly different result
2021-05-22 12:30:59
Yes, here are the final results https://discord.com/channels/794206087879852103/803645746661425173/845639153549836359
veluca
2021-05-22 12:31:19
I don't think patch detection works so well with subpixel rendering
2021-05-22 12:31:38
but lz77 also does a good job πŸ˜›
Scope
2021-05-22 12:33:37
Are there any universal options for the lz77 that I could add to the comparison without knowing the image type (to see where the lz77 might be better)? Like `-P 15` (15=mix everything) works with -i 0?
_wb_
2021-05-22 12:35:04
2021-05-22 12:36:27
Looks like A,B,C,D are not detected as patches, and the rest somewhat is
2021-05-22 12:37:15
So the biggest opportunities for patches are actually missed
2021-05-22 12:37:28
Likely because there is no solid background nearby those
veluca
Scope Are there any universal options for the lz77 that I could add to the comparison without knowing the image type (to see where the lz77 might be better)? Like `-P 15` (15=mix everything) works with -i 0?
2021-05-22 12:45:49
it doesn't
2021-05-22 12:46:05
I'll try to get something like that working, but probably not earlier than in a month
_wb_
2021-05-22 12:46:14
what's that? background?
Scope
2021-05-22 12:49:14
Ok, I need to finish encoding the other options anyway, since it takes a very long time
_wb_
2021-05-22 01:05:27
It's the result of djxl -s 8
2021-05-22 01:05:45
Looks kind of bad because there is no DC :)
2021-05-22 01:06:59
Something modular global still happens
2021-05-22 01:07:33
Causing the bg not to be black, maybe palette or channel palette, I dunno
Scope
2021-05-22 04:04:05
Something difficult even for FLIF and JXL does better, but according to BMF, there is still compression potential for this image https://files.catbox.moe/a480l8.png ```307,485 - FLIF 216,228 - JXL (s9 E3 I1) 215,824 - JXL (patches 0) 209,918 - JXL (X0 Y0) 211,211 - JXL (g 3) 148,940 - BMF```
2021-05-22 04:20:31
https://i.redd.it/016nuealcl341.png ```6,198,924 - FLIF 7,843,213 - JXL (s9 E3 I1) 6,210,965 - JXL (palette 0) 7,666,728 - JXL (g 3) 5,756,530 - EMMA```
2021-05-22 04:23:58
- https://i.redd.it/5qmh3c3fben01.png ```11,704,800 - FLIF 12,891,658 - JXL (s9 E3 I1) 10,949,990 - JXL (palette 0) 11,952,531 - JXL (g 3) 9,048,551 - EMMA```
2021-05-22 04:25:55
- https://i.redd.it/59rr49wh1qo31.png ```2,014,202 - FLIF 2,248,884 - JXL (s9 E3 I1) 1,944,748 - JXL (palette 0) 1,928,298 - JXL (g 3) 1,798,641 - EMMA```
veluca
2021-05-22 04:35:27
I would be pretty surprised if jxl could do consistently better than EMMA
2021-05-22 04:35:49
pleasantly surprised, but surprised nonetheless xD
_wb_
2021-05-22 04:39:06
What does EMMA do?
Scope
2021-05-22 04:39:15
I think it would be quite difficult, at least without the kind of storage mode where the decompression speed would not be important
2021-05-22 04:41:52
Some discussion was here: <https://encode.su/threads/3589-GDCC-port-mortem?p=69000&viewfull=1#post69000>
diskorduser
2021-05-23 06:48:22
`stat -c "%s %n" *.jxl 39255 test-dct.jxl 32350 test-modular.jxl` Is this normal for non-photographic content?
Scope I think it would be quite difficult, at least without the kind of storage mode where the decompression speed would not be important
2021-05-23 06:51:15
So Emma good for compressing for raw dngs.
veluca
2021-05-23 06:51:16
not entirely surprising at least
diskorduser
2021-05-23 06:51:33
Okay
Scope
diskorduser So Emma good for compressing for raw dngs.
2021-05-23 06:53:52
For many things, except Pixel Art
2021-05-23 07:03:40
And this experimental non-optimized for speed encoder is faster than lossless JXL with default settings (effort/speed 7), but the drawback is that the decoding speed is the same as the encoding speed
diskorduser
2021-05-23 07:08:21
From where can I get emma?
2021-05-23 07:09:48
The one from Google drive? https://drive.google.com/drive/u/0/mobile/folders/0B_X1BeQ2TuWibTBmVG90S0k1bVE?usp=drive_open
Scope
2021-05-23 07:10:21
https://globalcompetition.compression.ru/assets/files/compressors/EMMA.7z
diskorduser The one from Google drive? https://drive.google.com/drive/u/0/mobile/folders/0B_X1BeQ2TuWibTBmVG90S0k1bVE?usp=drive_open
2021-05-23 07:11:13
I think this is another EMMA, a more complex encoder that is no longer developing
2021-05-23 07:14:56
And EMMA only accepts PPM files, for example I convert images with ImageMagick: `convert Image.png Image.ppm`
lithium
Scope For many things, except Pixel Art
2021-05-23 08:29:00
In my opinion, For current version avif lossless implement(libaom) can't compare other lossless encoder, ```--cicp 2/2/0, pack the RGB values directly into the planes (in the order GBR)```
Scope
2021-05-23 08:34:33
Yes, but I had to compare it as well (because so far many people think AVIF is also very good in lossless), although lossless improvements are planned for AVIF
lithium
2021-05-23 08:42:24
If jpeg xl have high fidelity lossy for any type image(photographic and non-photographic), And have better lossless mode(modular lossless and jpeg lossless), maybe we can defeat avif on this github discuss. https://github.com/mozilla/standards-positions/issues/522
diskorduser
Scope And EMMA only accepts PPM files, for example I convert images with ImageMagick: `convert Image.png Image.ppm`
2021-05-24 06:39:34
The binary size is just 37kb. Is it okay?? I tired to run it with wine but it doesn't.
2021-05-24 06:48:52
Also not working in windows 10
Scope
diskorduser The binary size is just 37kb. Is it okay?? I tired to run it with wine but it doesn't.
2021-05-24 07:54:44
Yes, it's ok, because this competition takes into account the size of encoders/decoders, but this EXE should work, something like this: `emma_c.exe Image.ppm Image.emma`
Scientia
Scope For many things, except Pixel Art
2021-05-24 07:57:41
what happened between speed 3 and 7 lol
2021-05-24 07:58:03
some optimization that we NEED for pixel art isn't applied at some level between 7 and 3
veluca
2021-05-24 07:58:38
3 doesn't even try to do anything but photographic-only πŸ˜›
Scientia
2021-05-24 07:58:43
ah
Scope
2021-05-24 08:02:18
Yes, I've done experiments with fast modes <https://docs.google.com/spreadsheets/d/1ugFqODnDnyeHbww9g4kKsqk--VKvosMQ2YYd1YN5KLA/edit#gid=1077758646>
_wb_
2021-05-24 08:12:43
Possibly something like -s 3 -P 4 might work a bit better for pixel art
Scope
2021-05-24 08:01:43
https://i.redd.it/6wcb3n2w2uc31.png ```18,842 - FLIF 23,670 - JXL (s9 E3 I1) 23,539 - JXL (palette 0) 23,419 - JXL (g 3) 17,240 - BMF```
2021-05-24 08:08:11
- https://i.redd.it/ixnqw29s2li31.png ```84,049 - FLIF 45,657 - JXL (s9 E3 I1) 42,988 - JXL (patch 0) 47,176 - JXL (g 3) 25,796 - BMF```
Crixis
2021-05-24 08:08:48
FLIF big fail in this
_wb_
2021-05-24 08:13:50
Lossless is a funny game
2021-05-24 08:16:22
Big fail is a relative thing. FLIF compresses it losslessly at 0.25 bpp...
2021-05-24 08:17:13
A lossy jpeg could easily be ten times as large
2021-05-24 08:17:37
But yes, jxl does even better, and bmf even better than that
2021-05-24 08:18:50
It's amazing how much structure some images have, so they can be losslessly compressed to a bitrate that would be very poor lossy quality
Pieter
_wb_ It's amazing how much structure some images have, so they can be losslessly compressed to a bitrate that would be very poor lossy quality
2021-05-24 08:20:00
See <#824000991891554375> for some examples.
_wb_
2021-05-24 08:21:04
Haha yes. Finding the hidden structure in an image is tricky though.. probably if you try compressing those jxl art images with cjxl, it will be quite a bit bigger
Pieter
_wb_ Haha yes. Finding the hidden structure in an image is tricky though.. probably if you try compressing those jxl art images with cjxl, it will be quite a bit bigger
2021-05-24 08:31:37
0.000 bpp asymptotically is hard to beat
Scope
2021-05-24 09:23:27
Hmm, didn't find options when JXL was close to WebP https://i.redd.it/kepfxbji1ru31.png ```346,632 - WebP 429,355 - JXL (s9 E3 I1) 421,094 - JXL (palette 0) 417,652 - JXL (g 3) 328,192 - EMMA```
veluca
2021-05-24 09:32:40
not even `-s 9 -I 0 -P 0 -g 3` and/or `-s 9 -I 0 -P 4 -g 3`?
Scientia
2021-05-24 09:32:53
What do you think the issue with this one was?
Scope
2021-05-24 09:34:24
Yes, also combinations with `-I 0` almost never give better results than some other options I have even tried bruteforcing `-P`, like `-P 0-13`
veluca
2021-05-24 09:35:19
curious
2021-05-24 09:35:37
might be a case of bad tree learning
2021-05-24 09:37:35
`--palette 10000000` helps somewhat (~1.5%)
Scope
2021-05-24 09:38:47
Yep, some options are better, but not by much
veluca
2021-05-24 09:39:47
I wonder what webp does
2021-05-24 09:40:19
anyway, I'll be playing with lossless in a couple months I think
Deleted User
veluca I wonder what webp does
2021-05-24 09:40:36
<@!532010383041363969> should know a thing about that...
veluca
2021-05-24 09:40:40
from what I understand, most of the things that webp does should also be possible in jpeg xl, and at similar speeds
2021-05-24 09:40:56
it's just a question of implementing appropriate special paths xD
2021-05-24 09:43:17
well, more or less, webp-ll is hard-coded for 4 channels, jxl is not, and that changes a thing or two
Scope
2021-05-24 09:43:38
Also, i made another spreadsheet for tuning when some of the other formats are noticeably better, but have not yet uploaded the images from this set and some other little things
veluca
2021-05-24 09:44:11
no hurry
2021-05-24 09:44:33
very likely I won't have any amount of time until the chrome 93 branch cut
Scope
2021-05-24 09:50:44
It's good that often the compression is improved with `palette` or `-g 0/3` options, but sometimes this doesn't help either
2021-05-24 10:02:33
Unless, for some Pixel Art, `-I 0` can be better (but still worse than WebP) https://files.catbox.moe/5jx4oh.png ``` 95,490 - WebP 123,090 - JXL (s9 E3 I1) 121,016 - JXL (palette 10000) 125,828 - JXL (g 3) 113,156 - JXL (s9 E3 I0 P0 g3) 71,884 - BMF```
Maximilian
2021-05-24 10:08:42
What magic is BMF doing?
2021-05-24 10:08:49
and back in 1999 too o.O
veluca
2021-05-24 10:09:14
I think nobody know, but it's a context mixing based model, right?
2021-05-24 10:09:26
anyway IIRC it's a lot slower than JXL at decoding
Scope Unless, for some Pixel Art, `-I 0` can be better (but still worse than WebP) https://files.catbox.moe/5jx4oh.png ``` 95,490 - WebP 123,090 - JXL (s9 E3 I1) 121,016 - JXL (palette 10000) 125,828 - JXL (g 3) 113,156 - JXL (s9 E3 I0 P0 g3) 71,884 - BMF```
2021-05-24 10:10:10
I *believe* that it ought to be possible to basically copy the webp encoder in JXL, but I'm not absolutely sure πŸ˜„
Scope
veluca I think nobody know, but it's a context mixing based model, right?
2021-05-24 10:13:47
EMMA yes, but BMF as far as I know uses several different models with good hand tuning for many years
veluca
2021-05-24 10:14:18
did you perhaps measure decompression performance?
Scope
2021-05-24 10:14:54
No, but on slow mode it's only slightly faster than encoding
veluca
2021-05-24 10:16:23
how fast is encoding then? πŸ˜›
Scope
2021-05-24 10:18:19
But on normal modes, the decoding speed is quite sufficient for practical use, I no longer have my own tests, but there are, for example GDC: https://globalcompetition.compression.ru/#leaderboards
2021-05-24 10:18:44
2021-05-24 10:21:32
But this is purely photo content, EMMA does not work well on Pixel Art (unlike BMF)
veluca
2021-05-24 10:22:35
I see that the jxl encoder is a tad slow xD
2021-05-24 10:22:48
anyway, about 10x slower than jxl is very slow
Scope
2021-05-24 10:30:04
For decoding, yes, except for the Balanced test, where BMF is fast in both encoding and decoding while still having good efficiency for these speeds (this test only has photographic images, but it is also good on other types)
veluca
2021-05-24 10:32:36
yup, indeed
Scope
2021-05-24 10:32:44
For example PIK is also very good, but on other sets it performs worse than BMF
veluca
2021-05-24 10:33:23
btw pik-lossless should be neither faster nor denser than JXL, we'll have to fix that at some point...
Scope
2021-05-24 10:36:59
Same for Gralic (It has been well tuned for LPCB, but on other sets it is worse than BMF and some other encoders) http://qlic.altervista.org/LPCB.html
Orum
2021-05-25 03:25:04
yeah, all the insanely high compression formats tend to have very slow decompression
Scope
2021-05-25 11:11:53
`-I 0` helps, but WebP still better https://files.catbox.moe/dn0i9a.png ```465,218 - WebP 827,465 - JXL (s9 E3 I1) 827,483 - JXL (patch 0) 733,108 - JXL (X0 Y0) 592,772 - JXL (g 3) 515,937 - JXL (s9 I0 P0 g3)```
2021-05-25 11:19:05
Slightly better than WebP, but BMF has a decent gap https://i.redd.it/fabub8fetx441.png ```35,330 - WebP 45,319 - JXL (s9 E3 I1) 45,224 - JXL (patch 0) 34,342 - JXL (s9 I0 P0 g3) 26,900 - BMF```
2021-05-25 11:25:53
- This image has been posted before, but still an interesting result https://files.catbox.moe/kkug21.png ``` 53,674 - WebP 111,086 - JXL (s9 E3 I1) 109,413 - JXL (patch 0) 97,091 - JXL (palette 10000) 106,322 - JXL (s9 I0 P0 g3) 37,852 - BMF```
veluca
2021-05-25 11:42:33
yup, very interesting
diskorduser
2021-05-25 07:54:24
png to jxl. Non synthetic image. `Q 97 s 9 - 411kb Q 97 s 7 - 275kb`
veluca
2021-05-25 07:56:31
amazing!
2021-05-25 07:56:43
tree learning must be doing something very wrong here πŸ˜›
diskorduser
2021-05-25 07:59:16
Same image `d 1 - s 7 - 128kb d 1 - s 9 - 126kb`
veluca
2021-05-25 07:59:50
ah wait, that's lossy, nvm
2021-05-25 08:00:31
I don't remember what q97 maps to - but I'm not surprised that very very high qualities do weird stuff at -s 8 or -s 9
2021-05-25 08:01:11
don't use -s 8 and -s 9 for VarDCT lossy if you're not prepared to have very weird results πŸ˜„
diskorduser
2021-05-25 08:06:17
jxl modular tortoise - 1.64 mb squirrel - 1.68mb emma - 1.56mb
2021-05-25 08:07:30
jxl s9 took more time than emma 😞
_wb_
2021-05-25 08:10:07
To decode?
diskorduser
2021-05-25 08:10:12
Encode
_wb_
2021-05-25 08:10:15
Ah
2021-05-25 08:11:15
Yes, tortoise encode is kind of "not even trying to optimize"
2021-05-25 08:14:41
Faster modular encode should be possible for s4+, but it's not trivial
2021-05-25 08:15:03
Also better densities should be possible, but also not trivial
2021-05-25 08:22:42
It's not really a priority atm to work on better lossless encoding, there are more urgent things to do right now (faster/lower memory decoding, improving browser integrations, decoder conformance, fuzzing, subjective evals, improving lossy encoding)
Scope
2021-05-25 08:24:03
And as already discussed, it would be nice to have a fast speed with relatively universal compression for photos, artificial content and pixel art, like something with a fixed tree/predictors that would be suitable for this
_wb_
2021-05-25 08:26:06
Yes, when I get the time I will make an s2 modular that is faster than s3, and an s4 that is faster and better than current s4
diskorduser
2021-05-25 08:26:06
anime preset 😜
improver
2021-05-25 08:30:18
use neural net to divine the most suitable preset tbh
veluca
2021-05-25 08:55:13
eh, we can do faster than a NN I believe πŸ˜›
Scope
2021-05-26 05:50:26
So `thunder` is something like this? https://discord.com/channels/794206087879852103/803645746661425173/813732246804234260
veluca
2021-05-26 06:00:14
-s 2 *might* be a bit better than -s 3 for nonphoto
2021-05-26 06:00:17
I dunno though
Scope
2021-05-26 06:09:06
Hmm, I guess I'll do the tests then
_wb_
2021-05-26 06:37:18
It might be better for nonphoto than -s 3, yes
2021-05-26 06:38:32
I was thinking for -e 4 to maybe do just both -e 2 and -e 3 encodes of each group, and take the best one. WDYT, <@179701849576833024> ?
2021-05-26 06:39:12
That should be faster than twice as slow as -e 3, which is a lot faster than current -e 4
2021-05-26 06:39:29
And likely better
veluca
2021-05-26 06:39:30
why not - but we should probably avoid complicating our lossless encoder further and just do a good redesign of it πŸ˜› we should also try -I 0 in each group...
_wb_
2021-05-26 06:40:38
Yes, it is starting to become a bit of a complicated thing
2021-05-26 06:40:57
Good redesign might be a better approach
2021-05-26 06:41:48
Also figuring out how to combine lz77 and trees. It's currently too much one or the other...
2021-05-26 06:42:41
It's complicated though, combining them
2021-05-26 06:43:54
lz77 doesn't match pixel values, it matches encoded symbols, which will end up doing different things depending on the predictor, which depends on the tree and on the neighboring pixels.
Scope
2021-05-26 06:45:36
But, as I said before, it would be nice to have an option to remove the invisible alpha, at least, if it is not very difficult to implement (for further correct comparisons with FLIF/WebPn)
_wb_
2021-05-26 06:48:08
Ah yes, I keep forgetting about that, and it should be easy enough
veluca
2021-05-26 06:48:34
should being the keyword here
Scope
2021-05-26 06:49:01
Better on Pixel Art, but not on the other sets πŸ€”
veluca
2021-05-26 06:49:16
not entirely surprising
_wb_ Also figuring out how to combine lz77 and trees. It's currently too much one or the other...
2021-05-26 06:50:16
one relatively easy thing to try is to see if we can lz77 each group instead of globally... the next idea would be to pick predictor in some way (possibly per-group), then LZ77, then learn a tree on lz77 symbols
Scope
2021-05-26 06:50:29
Yep, but I thought maybe it would be better on some non-photographic sets
veluca
2021-05-26 06:51:20
wow, speed 1 is pretty bad on pixel art πŸ˜„ then again, I guess that's no context modeling, so...
Scope
2021-05-26 06:55:39
Yep, also a little more efficiency and `-s 2` would be the same or slightly better as the optimized PNG
2021-05-26 07:23:30
veluca
2021-05-26 07:25:17
how fast (and how good) is, say, `-g 3 -s 7 -I 0 -P 5` for you?
2021-05-26 07:25:36
and/or -P 4
2021-05-26 07:25:44
it should be pretty similar (in density) to a fast PNG encoder
2021-05-26 07:26:10
(perhaps a fast PNG encoder would try all of -P 0 / -P 4 / -P 5)
Scope
2021-05-26 07:30:17
This is hard to measure accurately, or rather I would need to write scripts and measure the time on some set on an unused CPU, but I remember doing this once with something like `-g 3 -s 8 -I 0 -P n` and `-s 4 -P n` was faster
2021-05-26 07:32:29
And also this https://cdn.discordapp.com/attachments/803645746661425173/813732244711669810/unknown.png
veluca
2021-05-26 07:34:39
-s 8 is slow yes, IIRC it does zopfli-like matching
2021-05-26 07:35:12
(I mean, I wrote that, but I don't remember if it's at -s 8)
Scope
2021-05-26 07:35:23
And perhaps with a faster/optimized lz77 implementation, combinations with `-i 0` will be faster
veluca
2021-05-26 07:37:11
yeah the current code is not *too* optimized
Scope
2021-05-26 07:37:27
However, I will check results with `-g 3 -s 7 -I 0 -P 5/4`
2021-05-26 11:02:56
veluca
2021-05-26 11:18:24
not bad
Scope
2021-05-27 08:24:24
Hmm, looks like QLIC2 and ZPNG are faster than JXL `-s 1` with better efficiency
2021-05-27 08:25:26
<https://github.com/catid/Zpng>
2021-05-27 08:26:30
2021-05-27 08:28:27
QLIC2 is faster than Kvick, and here is a comparison between Kvick and JXL `-s 3` (and on my sets Kvick is worse in efficiency than QLIC2)
_wb_
2021-05-27 08:32:10
-s 1 is not worth much, I need to find something better to do there
2021-05-27 08:32:45
-s 2 might be somewhat useful though, it should be quite a bit faster than -s 3 both in encode and decode
Scope
2021-05-27 08:34:36
Yep, `-s 2` is also in the table, I did not compare speeds, but ZPNG and QLIC2 are very fast, almost instantaneous
raysar
2021-05-27 10:16:31
It's a 75mpx 14 real bits 6mB jxl file, it's a bit slow to decode πŸ˜„ (12cores pc) You can see my beautifull browser collection :p
veluca
2021-05-27 10:22:38
ouch πŸ˜„ is that modular or vardct?
2021-05-27 10:22:49
(# of cores doesn't really matter atm)
2021-05-27 10:23:16
I guess modular, vardct should decode in about 2 s...
raysar
veluca ouch πŸ˜„ is that modular or vardct?
2021-05-27 10:26:32
dct
veluca
2021-05-27 10:26:43
uh, weird
2021-05-27 10:26:57
how long does it take in practice?
raysar
2021-05-27 10:27:05
it's realtime 60fps
veluca
2021-05-27 10:27:13
so ~30s?
2021-05-27 10:27:16
that's... bad
raysar
2021-05-27 10:27:18
It's fast for small images
veluca
2021-05-27 10:27:38
75 mpx should take about 2-4s on a modern PC
raysar
2021-05-27 10:27:54
12s
veluca
2021-05-27 10:27:59
that's clearly more
2021-05-27 10:28:10
ok, I'll have to look into it perhaps next week
2021-05-27 10:28:15
if you can file a bug...
raysar
2021-05-27 10:28:21
you can see it's only one core, it's not a fast monocore with no avx2.
veluca
2021-05-27 10:28:25
well, if you can decode it from CLI first
2021-05-27 10:28:34
still, should be about 4s I think
2021-05-27 10:28:39
ideally, at least
2021-05-27 10:29:00
how long does a JPG of the same size take?
raysar
2021-05-27 10:29:41
i need to decode it with djxl?
2021-05-27 10:31:05
ah i need to add it's a file with hdr profile and p3 color πŸ˜„
2021-05-27 10:31:32
oups :p
2021-05-27 10:34:18
It's from darktable png, the png is opening very fast on xnview, but it crash xnview after few seconds πŸ˜„
2021-05-27 10:38:09
In fact, original png decoding is a joke on all chromium browsers πŸ˜„ In summary 16 bits HGL+P3 75mpx πŸ˜„
2021-05-27 10:38:48
i never undestand why so many part of chrome are not multicore :/
2021-05-27 10:42:19
Firefox is way faster for this png πŸ˜„
2021-05-27 10:59:01
It's ultraslow in jpeg too, so it's chrome the problem. Decode fast with imagemagick viewer. Jpeg HLG + P3
veluca
2021-05-27 11:06:00
ah, ok πŸ˜„
2021-05-27 11:06:13
that's a relief
raysar
2021-05-27 11:07:37
15 seconds on 1.5mB srgb (14bit input) that's slow too, plus slow zoom.
veluca
2021-05-27 11:09:07
pretty sure JXL has nothing to do with the zooming πŸ˜„
raysar
veluca pretty sure JXL has nothing to do with the zooming πŸ˜„
2021-05-27 11:11:48
Yes
2021-05-27 11:13:11
I hope progressive decode become ultrafast for huge files πŸ˜„
veluca
2021-05-27 11:15:02
we'll see πŸ˜„
Jyrki Alakuijala
2021-05-30 02:47:20
I consider that eventually -- with 5-10 years of maturing (hopefully earlier) -- lot of the computation is transferred to a GPU, and we will be able to use animation to mitigate the introduction of spatially scattered visual activity in JPEG XL
190n
2021-05-30 10:18:49
compressing every png texture in factorio with lossless jxl made the textures 25.37% smaller (1108 β†’ 827 MiB)
Scope
2021-05-31 08:16:10
<https://docs.google.com/spreadsheets/d/1ju4q1WkaXT7WoxZINmQpf4ElgMD2VMlqeDN2DuZ6yJ8/edit#gid=1523015175> I added Game Assets, it would be better to take these sets directly from the resources of the 100 top mobile games or something, but I was limited to free public sets, however I tried to choose examples that are frequently used and varied. <https://github.com/catid/gcif> I also added GCIF, which claims to be optimized specifically for Game Assets and decodes images faster than WebP with better compression (but this is not always true when using a variety of other sets) Also in practice, mobile and other games are not always using PNG or WebP, it is often some other specialized or GPU formats, but still not uncommon and it would be nice to have optimizations for this use case (and since there are most images with alpha channel, it is good to have different options for it)
2021-05-31 08:19:19
Also a video about WebP and games (although quite old, but still) https://youtu.be/1pkKMiDWwpM
diskorduser
2021-06-01 02:34:32
I don't see any popular mobile games using webp. They are using gpu formats like ktx
Scope
2021-06-01 08:26:41
They use, especially if it is 2D games or various hyper casual, also for logos, icons, UI, loading screens, etc., but not for 3d textures and stuff
2021-06-01 08:40:51
For example, this is from Gardenscapes
2021-06-01 08:44:03
Or Homescapes
2021-06-01 08:55:05
However, I'm not sure that modern formats with lossless mode should be intended primarily for Game Assets and this is their typical use, it's not bad to have good efficiency for that as well, but... πŸ€” https://twitter.com/PascalMassimino/status/1390536793855086593
_wb_
2021-06-01 09:46:14
"typical" can typically mean many things to many people πŸ™‚
Scope
2021-06-01 10:15:43
At least now there is a set with Game Assets and mostly transparent images, also this use case requires very fast decoding with moderate memory consumption and also I think some optimizations for this content which are well described in the Specification of GCIF: <https://github.com/catid/gcif#specification>
lithium
2021-06-01 10:52:39
Probably can use vardct lossy on Game Assets? on lower distance(-d 0.5~1.0) quality still good.
2021-06-01 10:54:09
lossy
2021-06-01 10:57:45
Like this pixel art case, lossy -d 1.0 -s 8 still can keep good quality.
2021-06-01 10:58:06
original
2021-06-01 10:58:28
jxl-d1.0-s8
Scope
2021-06-01 11:03:34
Yes, games use lossy as well, both WebP and Jpeg where it would be more efficient and artifacts wouldn't be noticeable, for pixel art it often happens that sprites are shown at very high zooming and they show very noticeable blurring, banding and artifacts, so they mostly use lossless, as well as UI elements and some other things
Crixis
2021-06-01 11:06:52
I don't see blurring
2021-06-01 11:07:16
right is the original
2021-06-01 11:08:36
140 KB vs 480 KB
Scope
2021-06-01 11:21:13
I see the difference and for pixel art it is important to keep every pixel as it is (they are also drawn pixel by pixel), also their zooming does not use any smoothing algorithms, as it happens in viewers or browsers, it is very risky to get any distortions or artifacts from lossy algorithms, but lossy formats can be used for some large images or for example loading screens
lithium
2021-06-01 11:22:40
pixel art case2, lossy -d 1.0 -s 8, Can see some error on dark red and dark purple area, I think need wait Jyrki Alakuijala fix integral transform selection. > https://gitlab.com/wg1/jpeg-xl/-/issues/147 > I guess dark red, blue, purple color have smooth and specific gradient area, > have chance happen this issue, this issus probably like an edge case.
2021-06-01 11:23:08
original
2021-06-01 11:23:28
d1.0-s8
Scope
2021-06-01 11:26:02
Yep, and for example this
lithium
2021-06-01 11:27:37
Probably fix integral transform selection, can fix some issue?
_wb_
2021-06-01 11:55:39
if you're going to look at it as pixel art that gets upsampled to the point that you see actual pixels as little squares, then I think lossless is a better choice than lossy. Lossy cannot really do much if it cannot assume some minimal viewing distance... imho
Scope
2021-06-01 12:04:07
Yes, sprites can be stored in their 1x1 form, but in games they can be even x10 times larger, sometimes some lossy techniques are used in their own formats, but they are not like Jpeg losses, also such games look like this on the screen (and not in a very small resolution as their real sprites):
fab
2021-06-01 12:41:26
don't use medium bitrate
2021-06-01 12:42:00
use d1 s 9
2021-06-01 12:42:21
or -q 78,97356 -s 7 --use_new_heuristics --dots=1 --gaborish=0 if you are really desperate but it will disable blurring and also new heuristics
2021-06-01 12:42:27
so you will get s... performance
2021-06-01 12:42:53
so you can only use d 1 s 9
lithium
2021-06-01 12:42:53
<@!794205442175402004> <@!111445179587624960> If want do some lossy thing on pixel art, probably lossy modular can make better result? > cjxl -m -Q 90 -s 9
fab
2021-06-01 12:43:27
not worth using lower bitrates if medium bitrates give blurry results
2021-06-01 12:43:46
like don't consider any lower than q 65 and q 63.52
2021-06-01 12:43:58
jpeg xl is very good on them
2021-06-01 12:44:02
i tested it on squoosh
_wb_
2021-06-01 12:44:07
lossy pixel art might be hard to do effectively
fab
2021-06-01 12:44:13
but without optimization of medium bitrates
2021-06-01 12:44:22
lower bitrates can't look good
_wb_
2021-06-01 12:44:44
e.g. usually pixel art only uses a small number of colors, so palette works well... but lossy and palette don't mix that well
Scope
lithium <@!794205442175402004> <@!111445179587624960> If want do some lossy thing on pixel art, probably lossy modular can make better result? > cjxl -m -Q 90 -s 9
2021-06-01 12:44:45
Maybe, but it can also cause the loss of some pixels Lossy-palette may be better for some cases
fab
2021-06-01 12:45:07
i posted in on <#804324493420920833>
2021-06-01 12:45:21
and i also filed an issue on github
2021-06-01 12:45:28
one week ago
2021-06-01 12:45:47
we did in <#794206170445119489> compress a nasa image
2021-06-01 12:45:58
4 people participated
_wb_
2021-06-01 12:46:08
operationally, for pixel art, the effort spent in manually checking if lossy is OK or not is too expensive for the potential gain you could get by doing lossy.
2021-06-01 12:46:11
imo
fab
2021-06-01 12:46:24
result
2021-06-01 12:46:29
webp is still ok
Scope
2021-06-01 12:52:30
However, I do not know games that would use lossy formats for this kind of sprites (and not even for pixel art), textures are another thing, there is not so noticeable losses because it uses a lot of post-processing, different perspective, lighting and other things
Crixis
2021-06-01 12:59:29
anyway also -d 0 -s 1 is smaller then png on the first image, it is also faster to dec?
2021-06-01 01:01:22
damn, -s 2 is a lot smaller than -s 7
2021-06-01 01:02:33
mmh someting sus
Scope
2021-06-01 01:04:28
When I have time I would like to compare the decoding speed for different modes, also now it is better to compare mostly with WebP since it is already quite common in games (at least on Android)
Crixis
2021-06-01 01:06:52
``` s1 162 148 s2 148 873 s3 150 026 s4 134 958 s5 174 345 s6 174 404 s7 171 100 s8 169 377 s9 163 032 s9 E3 I1 135 371 ```
2021-06-01 01:07:18
something going bad after `-s 4`
Scope
2021-06-01 01:10:00
Yep, especially for something like pixel art this is a common thing
Crixis
2021-06-01 01:12:51
I didn't expect s4 can be best then s9 E3 I1 on some images
_wb_
2021-06-01 01:28:11
Must be tree learning or RCT selection really messing up
veluca
2021-06-01 01:28:48
I'd bet tree learning
2021-06-01 01:28:59
we should make a "webp mode"...
2021-06-01 01:29:22
ah, could also be patches πŸ˜„
Scope
2021-06-01 01:29:28
Also https://files.catbox.moe/6sxvc6.png ```1,048 - WebP 1,215 - JXL (s9 E3 I1) 336 - GCIF```
_wb_
2021-06-01 01:30:06
GCIF, what's that?
Scope
2021-06-01 01:30:48
https://discord.com/channels/794206087879852103/803645746661425173/849018441549742081
2021-06-01 01:33:45
As far as I understand, it's kind of a continuation of BCIF ideas and some other formats that would be better suited for Game Assets
2021-06-01 01:34:15
2021-06-01 01:35:33
πŸ€” https://github.com/play-co/gcif/issues/2
fab
2021-06-01 01:35:48
is old
2021-06-01 01:35:55
why i should star this repo
2021-06-01 01:35:58
i removed the star
Scope
2021-06-01 01:40:33
It doesn't matter how old the format is, if it is effective and especially if it has sources and where there may be some interesting ideas ```It typically produces files that are 60% the size of PNGCRUSH output and about 85% the size of WebP output, while decoding faster than both. The format is released under the BSD license as forever patent-free, monetarily free, and open-source software. Contributions, discussions, and a healthy dose of criticism are all welcome.```
Crixis
veluca ah, could also be patches πŸ˜„
2021-06-01 01:41:05
no, s7 patch 0 171 240
veluca
Scope πŸ€” https://github.com/play-co/gcif/issues/2
2021-06-01 01:42:05
<@!794205442175402004> bad memory I see xD
_wb_
2021-06-01 01:58:10
hah, lol
fab
2021-06-01 02:01:19
wb should you or me close the issue about less perceived quality in mid range compared to new heuristic
2021-06-01 02:01:24
is not valid anymore
2021-06-01 02:01:25
2021-06-01 02:01:37
the detail is the same in s9 q 65
2021-06-01 02:01:40
is exactly the same
2021-06-01 02:01:53
more info about build used in <#794206170445119489>
_wb_
2021-06-01 02:02:05
if your issue is resolved you can close it yourself
fab
2021-06-01 02:02:12
an user called <@!387462082418704387> sent the build
2021-06-01 02:02:17
and this build solves the issue
2021-06-01 02:02:21
at 100%
2021-06-01 02:02:25
so i can
2021-06-01 02:02:26
ok
_wb_ if your issue is resolved you can close it yourself
2021-06-01 02:09:11
issue closed
2021-06-01 02:49:21
made a low fidelity version of that image
2021-06-01 02:49:22
-q 48.23 --use_new_heuristics --epf=2 -p --dots=1
2021-06-01 02:49:25
another image
2021-06-01 02:49:41
ezziedato build
2021-06-01 02:52:14
2021-06-01 02:57:42
not sure if users will be happy of seeing images in this quality
_wb_
2021-06-01 02:58:23
this image is getting larger and larger
2021-06-01 02:58:59
first it was a crop, then the full image, and now there's Windows stuff in it too?
fab
2021-06-01 02:59:42
no is same resolution
2021-06-01 02:59:53
this original
2021-06-01 02:59:57
2021-06-01 02:59:59
the crop i did with paint
2021-06-01 03:00:18
2021-06-01 03:00:19
2021-06-01 03:00:44
those version i have at -q 45.858 -s 9 and new heuristic is 2
lithium
2021-06-01 03:11:32
How to compare --lossy-palette --palette=0 result quality? (compare -d 1.0 -s8 and -m -Q 90 -s9)
2021-06-01 03:13:01
look like --lossy-palette is very suitable lossy pixel art.
2021-06-01 03:14:38
but lossy-palette get large maxButteraugli_jxl score on some case.
Scope
2021-06-01 03:17:12
I don't think it can be compared by metrics like this, it needs a visual comparison
lithium
2021-06-01 03:18:03
original
2021-06-01 03:18:23
lossy-pal0
2021-06-01 03:19:10
look like still great.
Scope
2021-06-01 03:19:59
Yep, except for some brightly colored modified pixels
lithium
2021-06-01 03:22:30
<@!794205442175402004> For current version cjxl -m --lossy-palette --palette=0 is implement lossless alpha channel?
_wb_
2021-06-01 03:23:38
yes, the alpha is lossless, and I think it also doesn't do anything special with the invisible pixels (it does the same lossy palette thing on them as on the visible pixels)
lithium
2021-06-01 03:24:17
ok thank you πŸ™‚
2021-06-01 03:26:11
I think if color less than 15000, lossy-palette can't get best result,
Scope
2021-06-01 03:26:44
For such content, efficiency could also be improved with options for premultiplied alpha and invisible pixels <https://github.com/libjxl/libjxl/issues/76>
lithium
2021-06-01 03:27:32
And some complex drawing (anime, manga), vardct is suitable those content.
2021-06-01 03:32:01
pixel art content > png pal 8 => -m -q 100 -s 9 -g 2 -E 3 -I 1 --num_threads=12 > color large than 15000 => -m -s 9 --lossy-palette --palette=0 -g 2 -E 3 -I 1 --num_threads=12 > color less than 15000 => -m -q 100 -s 9 --palette=15000 -g 2 -E 3 -I 1 --num_threads=12
2021-06-01 03:34:50
special case
2021-06-01 03:35:36
This case is very special, only --palette=15000 can effective compress,
2021-06-01 03:36:33
vardct, lossy modular, --lossy-palette will increase file size.
veluca
2021-06-01 03:38:43
try `--palette=20000 -I 0 -s 9 -g 3`
2021-06-01 03:38:55
or maybe -g 2 works too
lithium
2021-06-01 03:42:04
I using this, slow but can effective compress. > cjxl -m -q 100 -s 9 --palette=15000 -g 2 -E 3 -I 1 --num_threads=12 Input file: w9feLzj.png | 122829 bytes Image: 1920x1080 pixels | 8 bits/sample | RGB | 10105 color(s) Delta filter: Mixed
2021-06-01 03:46:03
-I 0 will will increase much file size. 119KB =>721KB
2021-06-01 03:47:38
> -m -q 100 -s 9 -g 3 -I 1 --palette=20000 --num_threads=12 => 99.3KB > -m -q 100 -s 9 -g 2 -E 3 -I 1 --palette=15000 --num_threads=12 => 87.5KB
veluca
2021-06-01 03:49:39
ah, sorry, `-I 0 -P 0`
2021-06-01 03:49:45
I always forget those two go together
lithium
2021-06-01 03:52:32
> -m -q 100 -s 9 -g 3 -I 0 -P 0 --palette=20000 --num_threads=12 => 117KB
2021-06-01 03:56:53
> -m -s 9 --num_threads=12 --lossy-palette --palette=0 -g 2 -E 3 -I 1 =>252KB
2021-06-01 03:57:58
Can't understand why lossy palette can't compress pixel art...
Eugene Vert
2021-06-01 03:58:40
<@!461421345302118401> , сan you give advice on lossy compression of manga w/ screentone?
lithium
Eugene Vert <@!461421345302118401> , сan you give advice on lossy compression of manga w/ screentone?
2021-06-01 04:03:22
For now I don't recommend vardct mode, some fix not implement on current version, If you want try, -d 0.5 -s 8 for color content and -d 0.8~1.0 -s 8 for black and white content(manga).
2021-06-01 04:04:47
-d 1.3~1.45 still good, -d 1.6~1.9 have some risk.
2021-06-01 04:11:54
Manga and anime content have much entropy, I don't think large target distance can keep good quality.
2021-06-01 04:26:05
<@!736666062879195236> I think integral transform selection fix probably will implement on this mouth. > I hope that will change in the next few weeks. > https://gitlab.com/wg1/jpeg-xl/-/issues/147
fab
2021-06-01 05:16:32
my eyes are bleeding
2021-06-01 05:16:48
it looks like random banding and sky mirror
Scope
Scope Hmm, looks like QLIC2 and ZPNG are faster than JXL `-s 1` with better efficiency
2021-06-01 07:57:14
New -s 1, -s 2 (some sets have changed, but still)
_wb_
2021-06-01 08:00:43
after https://github.com/libjxl/libjxl/pull/47 lands it will be a bit different again
Scope
_wb_ after https://github.com/libjxl/libjxl/pull/47 lands it will be a bit different again
2021-06-01 08:03:44
After today's and future changes? This is `-s 1/2` with this patch, but I compiled this build yesterday
2021-06-01 08:05:41
And the previous comparison is `-s 1/2` from the main branch
_wb_
2021-06-01 08:09:06
Ah you added the patch before it was merged?
Scope
2021-06-01 08:09:16
Yep
_wb_
2021-06-01 08:09:49
PNG is optimized PNG in that table, right?
Scope
2021-06-01 08:10:12
Yes, Pingo+ECT
_wb_
2021-06-01 08:10:49
It would be interesting to compare with a reasonably good fast png encoder too
Pieter
2021-06-01 08:10:54
> Lightning is now consistently at least slightly faster than thunder. I am now curious whether a medium exists in which sound is faster than light.
veluca
2021-06-01 08:11:54
IIRC yes but I'm not a physicist
_wb_
2021-06-01 08:11:57
For authoring workflows, you just need a weakly compressed fast encode option, you're not going to do a very optimized encode each time you hit 'save' in gimp or photoshop
Scope
2021-06-01 08:14:01
Yes, but I don't know any good PNG encoders and they are often optimized afterwards with at least something like Oxipng Even IM or LibVips produce rather bloated images, which even with the fastest optimizations will be smaller
_wb_
2021-06-01 08:15:33
Before delivery or packaging, sure, but for authoring workflows people now use XCF or PSD which is basically very weakly compressed, more important to save quickly than to compress well.
Scope
2021-06-01 08:22:58
But it might be worth re-converting with some popular PNG encoder to compare the results πŸ€”
veluca
2021-06-01 08:23:55
amazing that zopfli is not even the slowest xD
2021-06-01 08:24:20
random thought : uncompressed PNG + Brotli is actually reasonable for web delivery, if you use brotli as a content encoding...
Scope
2021-06-01 08:26:52
Yes, but the problem is that if someone wants to save a PNG, it will be very large (or it will be Brotli compressed and then it will not work in applications), I have not tested this in practice
2021-06-01 08:35:35
Which encoder is mostly used in production: libpng/lodepng/stb_image/...?
veluca
2021-06-01 08:36:51
probably libpng
Scope
2021-06-01 09:02:48
Btw, it's strange when there are many PNG optimizers, but almost no one makes or compares PNG encoders by their efficiency, mostly comparing decoding speed
2021-06-01 11:17:51
**PNG** - Optimized PNG **IM-PNG** - ImageMagick with default settings (there is an option to enable stronger compression), also there are probably faster and more efficient PNG encoders, but I found this to be the most optimal and used solution (IM also uses libpng)
2021-06-01 11:43:28
2021-06-02 12:20:45
Perhaps I found the fastest PNG encoder (as well as decoder), but I couldn't compile it properly on Windows <https://www.reddit.com/r/programming/comments/mld1ob/the_fastest_safest_png_decoder_in_the_world/gtnbv50/>
2021-06-02 12:27:21
Also (same encoder/decoder): <https://www.reddit.com/r/programming/comments/lpzxnc/time_to_dethrone_jpeg_a_comparison_of_nextgen/goidxws/>
veluca
2021-06-02 08:18:53
I highly doubt you can write a JPEG decoder that is 15x faster than libjpeg-turbo
2021-06-02 08:21:03
if I had to trust their numbers, it would be decoding 3 gigapixels/second - that's not going to happen on a CPU
_wb_
2021-06-02 08:45:39
They do parallel encode/decode of JPEG using some trickery - doing things in stripes, with restart markers in the beginning of every strip, and adding a TOC in an app marker, or something like that.
2021-06-02 08:51:14
https://www.reddit.com/r/programming/comments/lpzxnc/time_to_dethrone_jpeg_a_comparison_of_nextgen/goiaks1?utm_source=share&utm_medium=web2x&context=3
2021-06-02 08:51:31
not even using the TOC, just hoping there to be restart markers
2021-06-02 08:52:24
if you do jpeg encoding/decoding in parallel like that, it probably scales almost linearly with number of threads
2021-06-02 08:52:58
since the stripes are literally independent
2021-06-02 08:54:22
of course the decoding is only fast 1) if you encoded in that way (which probably does hurt compression slightly and is not what normal jpeg encoders do), and 2) if you can use many cores
veluca
2021-06-02 08:54:53
yeah
Scope
2021-06-02 01:32:23
Hmm, sometimes premultiplied alpha gives worse results on very small files like Emoji
_wb_
2021-06-02 01:35:53
I suppose it can both add and remove entropy
2021-06-02 01:36:45
Like an image that is all white and transparent, could be just constant color RGB and all info in A when doing non-premultiplied
2021-06-02 01:39:38
An option for "don't care about invisible pixels" would be good, not sure yet though what would be the best thing to replace the invisible pixels with (ideally they are ignored when learning an MA tree and get their residual set to 0 in whatever MA leaf they end up in, but that's a bit tricky to do)
fab
2021-06-02 02:56:58
#comparison
2021-06-02 02:57:20
-q 49.23377 -s 9 --use_new_heuristics 26.jxl
2021-06-02 02:57:29
-q 49.23377 -s 9 25.jxl
2021-06-02 02:57:48
2021-06-02 02:57:50
2021-06-02 02:57:53
2021-06-02 02:57:57
2021-06-02 02:58:45
in <#794206170445119489> there is the avif you can download and also the firefox bug
2021-06-02 03:01:14
is difficult to detect a difference between those two images
2021-06-02 03:01:27
with night is slightly
Scope
2021-06-02 03:24:49
``` 263 - WebP2 288 - JXL (s9 E3 I1) 16,377 - JXL (s9 E3 I1 Premultiply)```
2021-06-02 03:28:03
WebP2 as far as I know uses premultiply and removing invisible alpha by default
2021-06-02 03:37:25
But overall (Emoji set)
2021-06-02 03:38:55
WebP2 is still a bit better
2021-06-02 03:39:45
2021-06-02 03:46:10
- https://files.catbox.moe/i0s15w.png ``` 52,952 - WebP 155,017 - WebP2 154,651 - JXL (s9 E3 I1) 185,833 - JXL (s9 E3 I1 Premultiply)```
2021-06-02 03:47:13
Game Assets
2021-06-02 03:47:43
_wb_
Scope ``` 263 - WebP2 288 - JXL (s9 E3 I1) 16,377 - JXL (s9 E3 I1 Premultiply)```
2021-06-02 04:07:32
I wonder what's up with that, smells weird
2021-06-02 04:21:02
Something must be going horribly wrong on that one, I wonder what
2021-06-02 04:21:40
No time to investigate now, might help if you show cjxl --verbose output
Scope
2021-06-02 04:58:07
Yes, those were examples from a quick test, I will have to re-check, maybe some of the file names have shifted in the spreadsheet
2021-06-02 07:07:50
While the Emoji set is being re-encoded, a few more examples from Game Assets https://files.catbox.moe/ei0ft6.png ```222,196 - WebP 218,919 - WebP2 150,705 - JXL (s9 E3 I1) 222,274 - JXL (s9 E3 I1 Premultiply)```
2021-06-02 07:09:18
- https://files.catbox.moe/73phzp.png ```4,204 - WebP 4,055 - WebP2 4,045 - JXL (s9 E3 I1) 5,864 - JXL (s9 E3 I1 Premultiply)```
diskorduser
2021-06-03 04:17:37
_wb_
2021-06-03 05:19:47
What encode settings for jxl are this?
diskorduser
2021-06-03 05:45:52
modular speed 7
2021-06-03 05:47:02
Using cjxl
2021-06-03 05:50:39
Pictures are web page screenshots
_wb_
2021-06-03 06:02:33
Ah, screenshots
2021-06-03 06:02:55
Might get better results with -g 3 on those
2021-06-03 06:03:08
And with -I 0 -P 0 -s 9
Scope ``` 263 - WebP2 288 - JXL (s9 E3 I1) 16,377 - JXL (s9 E3 I1 Premultiply)```
2021-06-03 09:08:57
this one I cannot reproduce, could be a spreadsheet misalignment?
Scope While the Emoji set is being re-encoded, a few more examples from Game Assets https://files.catbox.moe/ei0ft6.png ```222,196 - WebP 218,919 - WebP2 150,705 - JXL (s9 E3 I1) 222,274 - JXL (s9 E3 I1 Premultiply)```
2021-06-03 09:10:35
This one does indeed somehow suffer quite a bit from premultiplying, my guess is that too much entropy from the alpha channel gets introduced in the RGB by doing premultiply here
Scope
2021-06-03 09:11:56
Probably, because I was adding and modifying images to the set (now doing a complete re-encoding) But this applies to Emoji, for Game Assets the results should be correct
2021-06-03 09:16:34
Interesting that WebP2 doesn't have the option to disable premultiplying and removing invisible alpha (so the devs are sure that this is always necessary and more effective?)
improver
2021-06-03 09:24:57
inb4 it doesn't have option for removing invisible alpha because it's always removed
2021-06-03 09:25:20
(just speculating)
_wb_
2021-06-03 09:42:28
When you do premultiply, invisible pixels inherently become black
2021-06-03 09:43:20
And no, it isn't always effective, counterexample being white text on a transparent background where premultiplying doubles the entropy.
Scope
2021-06-03 09:51:00
So in the future, for denser compression, is it better to do something like auto mode and apply only where it will be more effective?
2021-06-03 10:25:27
Emoji
2021-06-03 10:25:30
2021-06-03 10:27:52
- ``` 618 - WebP 581 - WebP2 575 - JXL (s9 E3 I1) 1,150 - JXL (s9 E3 I1 Premultiply)```
2021-06-03 10:29:54
- ``` 70,406 - WebP 61,548 - WebP2 55,964 - JXL (s9 E3 I1) 108,391 - JXL (s9 E3 I1 Premultiply)```
2021-06-03 10:32:06
- ```1,310 - WebP 1,213 - WebP2 1,251 - JXL (s9 E3 I1) 2,216 - JXL (s9 E3 I1 Premultiply)```
2021-06-03 10:34:23
After re-encoding there is not such a big difference, but there are still some examples with a noticeable increase in size, also WebP2 is still more efficient on Emoji set
2021-06-03 10:58:20
- ```139,772 - WebP 133,482 - WebP2 73,162 - JXL (s9 E3 I1) 116,525 - JXL (s9 E3 I1 Premultiply)```
2021-06-03 02:57:38
> **skal** > It is lossless (because of the -q 100 option indeed, which means 'lossless' in cwp2)... but in premultiplied world! > Means: cwp2 is discarding everything under the alpha=0 area, and pre-multiplying the other area, which could explain the difference you're seeing with 'pngdiff' if this tool is not doing the measurement in pre-multiplied space.
2021-06-03 02:57:40
Btw, it would be nice to have support for these modes in comparison tools
2021-06-04 01:34:11
2021-06-04 01:37:02
Decoding to null-file (although I'm not sure if all decoders do all their work this way)
2021-06-04 01:40:27
Because with the actual decoding to the ppm file, the result is slightly different, but I did not want to add the impact of disk speed For Jpeg XL it is images encoded with the new fast `-s 2`
improver
2021-06-04 01:54:55
this is for lossless, right?
Scope
2021-06-04 01:55:08
Yep
veluca
2021-06-04 01:59:07
seems about right
2021-06-04 01:59:23
you have no idea how much useless stuff is being done now in the lossless decode path πŸ˜›
_wb_
2021-06-04 02:28:16
lossless decode speed in webp/png is probably quite image-dependent: if you have many long lz77 matches (like in that diagram) it should be a lot faster than on e.g. a photo
Scope
2021-06-04 02:33:14
Yes, so I made a mix set for this test with about ~500 images/1.5 GB
2021-06-04 02:48:51
However, here Qlic2 is a bit faster than WebP (but perhaps because this is a rather old comparison and WebP has become more optimized) http://qlic.altervista.org/LPCB.html
2021-06-04 02:50:05
2021-06-05 01:56:09
> Linear prediction based on a block-wise LSM(OLS)-optimized prediction model + ANS coding So, it's something very fast?
2021-06-05 01:56:15
2021-06-05 01:57:53
However, on the overall result on my sets Kvick does not show such good results (perhaps it was tuned only for this test set?)
Scope
2021-06-05 09:49:16
Hmm, since WP2 also uses tiles (although I'm not sure about lossless) and ANS, but still better than premultiplied JXL on Emoji, it must be something else πŸ€”