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

fab
2021-04-22 03:27:55
with jpeg i fatigue to compress almost zero image compressed but is made in this way
2021-04-22 03:28:11
is more secure as jyri said
2021-04-22 03:28:20
you have less risk or ruining image
2021-04-22 03:28:32
also the encoder is test
2021-04-22 03:29:20
mine was 100 kb jpeg to 20 kb jxl
2021-04-22 03:29:24
80% reduction
2021-04-22 03:29:41
your image sent i don't know the original file size
2021-04-22 03:29:45
i guess is a png
2021-04-22 03:29:55
with few webp icon
Deleted User
Crixis d8 is garbage
2021-04-22 04:59:18
Don't worry, he used 8.03!
fab
2021-04-22 05:05:09
with photographic it does suprisly good
2021-04-22 05:05:17
i expected the opposite
2021-04-22 05:05:26
like it would be better suited for modular
2021-04-22 05:06:21
now i'm using d 1 -s 7
Crixis
2021-04-22 05:14:31
no way
fab
2021-04-22 05:30:37
But i prefer options that works with different type synthetic etc
Crixis
Crixis no way
2021-04-22 05:37:25
synthetic?
fab
2021-04-22 06:05:22
Like the contrary of photographic
2021-04-24 11:58:47
i deleted the re encoding options on the doc file
2021-04-24 11:59:00
i also tried
2021-04-24 11:59:01
for %i in (C:\Users\User\Documents\a\*.png) do cjxl "%i" "%i.jxl" -q 93.10 -I 0.908 -X 8.222 -Y 13.44 --intensity_target=205 -g 2 -s 9 -m --num_threads=2
2021-04-24 11:59:16
but it doesn't decode the modular file
2021-04-24 11:59:29
it decodes an invalid file
2021-04-24 11:59:48
i didn't tried without g2
2021-04-24 11:59:51
or with g3
2021-04-24 11:59:56
but i don't want to
2021-04-24 12:00:15
i prefer waiting until the encoder makes butteraugli decisions
Crixis this is lower!
2021-04-24 12:01:12
deleted my original
2021-04-24 12:09:33
i tried with c2 but it changed colour it becomes violet
2021-04-24 12:09:52
so i won't try anymore
monad
2021-04-29 09:50:39
Photomosaics generated by https://www.complang.tuwien.ac.at/schani/metapixel classical, no cheating, constituent image size of 32x32 ```encoder size B mem KB time s pingo -s9 -nostrip 29443130 766392 220.38 cwebp -z 9 -metadata all 8208784 1141764 99.42 cjxl -d 0 -s 7 34868365 3730400 189.53 pingo -s9 -nostrip 55490015 1040116 126.52 cwebp -z 9 -metadata all 20657804 1114144 111.69 cjxl -d 0 -s 7 50222491 3447760 214.21 pingo -s9 -nostrip 27867016 612748 56.23 cwebp -z 9 -metadata all 6994508 530856 40.39 cjxl -d 0 -s 7 25834021 1637624 84.85 cjxl -d 0 -s 9 -E 3 -I 1 -g 3 13691659 3794756 2544.06```
_wb_
2021-04-29 10:21:38
interesting, webp is doing great on these!
Orum
2021-04-29 10:22:04
Is there that much overhead on JXL or is it something else?
_wb_
2021-04-29 10:23:05
maybe the color cache feature of lossless webp is particularly useful on these particular kinds of images
Orum
2021-04-29 10:23:35
oh wait, this is a mosaic, so it's looking at the overall image and not the compression of each 32x32
_wb_
2021-04-29 10:24:18
<@263300458888691714> can you share an original png?
2021-04-29 10:25:01
perhaps `-g 0` could give better results for these particular kinds of images
monad
2021-04-29 10:30:48
Yes, `-g 0` does better in what I've tested.
2021-04-29 10:31:40
Can't share these images, but I can see about generating new ones if that would help.
2021-04-29 01:40:50
<@!794205442175402004> <https://mega.nz/file/fNk2TaYS#7Ihu2HyAFIBPYbWRznvW_pAvCxRXuHQUIh1JaIRqg_U> ```encoder size B mem KB time s pingo -s9 -nostrip 31930150 576664 52.03 cwebp -z 9 -metadata all 9830406 539308 49.59 cjxl -d 0 -s 7 28134264 1619660 91.75 cjxl -d 0 -s 7 -g 0 26748947 1619916 123.80```
_wb_
2021-04-29 01:46:54
oh, I see what is going on here
2021-04-29 01:46:59
a lot of the subimages are repeated
2021-04-29 01:47:24
webp will catch that
2021-04-29 01:47:33
jxl currently doesn't really
2021-04-29 01:48:21
patches could do it more efficiently than webp probably, but the current encoder is not going to find those patches here
2021-04-29 01:49:40
and we could get some savings with lz77 but that's only going to help within a group and it will not be as effective
monad
2021-04-29 01:49:55
Can symmetries be encoded with patches?
_wb_
2021-04-29 01:50:30
no, only translations, no flips/rotations
2021-04-29 01:51:42
if you would first encode a spritesheet that contains every unique subimage once, then use patches to make the composite image, I think webp could probably be beaten here
Deleted User
_wb_ no, only translations, no flips/rotations
2021-04-29 01:52:35
Are we talking about libjxl or the jxl spec?
_wb_
2021-04-29 01:53:05
webp and png have the advantage here that all they know how to do is lz77 distance matching, so they will kind of automatically find these repeated subimages as long as they're within the lz77 window
Are we talking about libjxl or the jxl spec?
2021-04-29 01:53:19
spec
2021-04-29 01:54:15
you can of course just encode all the variations w.r.t. flipping/rotation that you need
2021-04-29 01:54:33
just you don't get "take this patch and flip it" for free
2021-04-29 01:55:11
we at some point thought about adding that but it's basically more signaling cost for questionable gain
2021-04-29 01:55:57
(and also more implementation complexity to do blitting of oriented patches)
Orum
2021-04-29 02:29:38
few people do the mosaic thing any more, it seems like a fad from the early 00's
Deleted User
_wb_ no, only translations, no flips/rotations
2021-04-29 02:44:26
Which translations are allowed?
_wb_
2021-04-29 02:45:14
I mean translation just in the sense of moving it to whatever x0,y0 offset
fab
2021-04-29 04:10:39
do you can mantain another lossless algorithm that don't use patch
2021-04-29 04:10:46
but the traditional way
Scientia
2021-04-29 09:00:17
You can just turn off patches and just use modular standalone I believe
2021-04-29 09:00:30
There's no point to turn off patches though
2021-04-29 09:00:37
Patches actually save space
veluca
2021-04-29 10:54:30
not *always*
Scientia
2021-04-29 11:06:24
If they don't save space then they shouldn't be used right?
2021-04-29 11:06:46
I mean the encoder should decide to not use them
BlueSwordM
Scientia If they don't save space then they shouldn't be used right?
2021-04-29 11:06:50
Not *always* .
2021-04-29 11:06:59
You need very good heuristics to determine if they are useful or not.
Scientia
2021-04-29 11:07:37
If you had the time you could check the difference with and without
2021-04-29 11:08:06
But only if you had the time to do the equivalent of two encodes
veluca
2021-04-30 11:41:39
my code generally assumes they do save space if they occur at least ... twice? three times? ๐Ÿ˜›
2021-04-30 11:42:04
but I'm pretty sure we could do better
Crixis
2021-04-30 12:04:20
Probably patch on test save space also on one occurrence, modular encode test smaller than vardct
2021-04-30 12:04:52
I think
fab
2021-04-30 12:11:24
you had a image in lossless modular smaller than vardct
2021-04-30 12:11:39
pixelart? anime?
Crixis
2021-04-30 12:14:54
a lot
Jim
2021-04-30 12:14:56
Not surprising. You can make PNGs that are much lower than JPEGs when the graphic is simplistic and a vector-type, unless you set JPG to rather low quality. Depends on the content of the image.
Crixis
2021-04-30 12:19:01
original
2021-04-30 12:19:12
- d 1
2021-04-30 12:19:29
-m
2021-04-30 12:19:48
10 times smaller
Jim
2021-04-30 12:21:13
Yep, pixel art generally will work better with modular.
Crixis
2021-04-30 12:22:35
as text
Jim
2021-04-30 12:23:59
Text?
2021-04-30 12:24:15
Even the PNG you posted is 18 KB, even smaller than the jxl.
Crixis
Jim Even the PNG you posted is 18 KB, even smaller than the jxl.
2021-04-30 12:25:13
yep, this is a good case for png, modular need some other tweaks on some pixelart
Jim Text?
2021-04-30 12:25:42
yes, modular is better on text then vardct
Jim
2021-04-30 12:26:34
Oh, I thought you meant that image was text.
Crixis
2021-04-30 12:30:58
original
2021-04-30 12:31:11
d1
2021-04-30 12:31:33
d1 nopatches
2021-04-30 12:31:40
m
2021-04-30 12:31:56
i was expecting smalller m, but is lossless after all
Jim
2021-04-30 12:36:36
If it where just the console window it would probably be quite a bit smaller. That photographic background around the edge is likely what increases the size.
Crixis
Jim If it where just the console window it would probably be quite a bit smaller. That photographic background around the edge is likely what increases the size.
2021-04-30 12:37:02
probably
_wb_
2021-04-30 12:38:57
Patches with vardct does quantized colors so somewhat lossy modular (it subtracts the patches and the residuals do still get vardct encoded, but likely get quantized away there)
fab
2021-05-04 06:15:06
2021-05-04 06:15:06
2021-05-04 06:16:05
2021-05-04 06:16:05
2021-05-04 06:16:27
2021-05-04 06:23:12
2021-05-04 06:25:48
2021-05-04 06:28:52
2021-05-04 06:31:34
2021-05-04 06:35:41
2021-05-04 06:35:53
text file to try
_wb_
2021-05-04 07:22:01
What is the point of all these screenshots?
2021-05-04 07:22:26
It is kind of spammy
fab
2021-05-05 07:12:13
ok
2021-05-05 07:12:35
this is the png
2021-05-05 07:12:36
https://discord.com/channels/794206087879852103/803645746661425173/839203840935198740
2021-05-05 07:14:24
there are paint blocking artifacts
2021-05-05 07:17:55
i did not generation loss tests
2021-05-05 07:18:22
also low quality mozjpeg has smoothing enabled
2021-05-05 07:23:22
2021-05-05 07:23:27
ok new settings
2021-05-05 07:23:55
2021-05-05 07:25:33
2021-05-05 07:25:36
q78 firefox browser jpg
2021-05-05 07:28:10
2021-05-05 07:28:21
2021-05-05 07:28:29
canvas is wp2 image
2021-05-05 07:28:36
2021-05-05 07:28:36
2021-05-05 07:28:43
i used lower possible settings
2021-05-05 07:28:47
and worst possible settings
2021-05-05 07:29:02
not comparable one
Orum
2021-05-05 10:42:27
Here's the lossless image:
2021-05-05 10:42:56
Recompress that at -d 1 and look at the lines on the bottom of the gun <@!424295816929345538>
Crixis
2021-05-05 10:44:51
oh no xcom 2 no!
fab
2021-05-05 10:46:37
2021-05-05 10:47:37
now i can't on my computer
2021-05-05 10:47:41
i haven't the ram
2021-05-05 10:47:57
with firefox open the max i can is 1,6 gb of ram
Crixis
Orum Recompress that at -d 1 and look at the lines on the bottom of the gun <@!424295816929345538>
2021-05-05 10:48:49
on my screen i don.t see any difference
2021-05-05 10:48:55
fab
2021-05-05 10:48:55
even the display of the image lasted more then 14 seconds
Orum
2021-05-05 10:49:26
Oh <:PepeSad:815718285877444619>
Crixis
Orum Oh <:PepeSad:815718285877444619>
2021-05-05 10:50:20
you see differences in my png?
Orum
2021-05-05 10:50:56
definitely, though I'm not sure why yours looks so much lighter on the right
2021-05-05 10:51:32
I've been decoding with djxl to avoid any decoding issues with viewers
Crixis
2021-05-05 10:52:05
I try with djxl
2021-05-05 10:53:35
2021-05-05 10:54:08
whitch image viewer you use for pngs?
Orum
2021-05-05 10:54:50
I'm using nomacs
Crixis
2021-05-05 10:56:03
you see divverences from the png opened in nomacs and in google chrome? (chrome as a good color managment)
Orum
2021-05-05 10:56:13
I don't have chrome installed
Crixis
2021-05-05 10:56:27
edge?
Orum
2021-05-05 10:56:36
Not running Windows
Crixis
2021-05-05 10:56:43
chromium?
Orum
2021-05-05 10:57:02
Just Firefox
Crixis
2021-05-05 10:57:22
firefox not have a good color managment
2021-05-05 10:57:42
not out of the box anyway
Orum
2021-05-05 11:02:06
nomacs has some issues but as long as you stick to the common formats (png) it's fine
Crixis
2021-05-05 11:05:25
png can have may issue in color managment, I say that becouse a lot of bugs report (color shft) on jxl was due bad png viewer
2021-05-05 11:05:28
example
Orum
2021-05-05 11:06:13
well, opening it in GIMP it looks identical
Crixis
2021-05-05 11:12:53
we need a more expert opinion
2021-05-05 11:13:19
random <@!799692065771749416> ping
Deleted User
2021-05-09 05:33:38
Here is a good gradient (16 bpc) for testing dithering since the human eye is more susceptible to green:
Scope
2021-05-13 06:27:41
2021-05-13 06:28:42
```197 048 - new build 210 847 - old build```
2021-05-13 06:30:03
But this is one of the few images where patches win
_wb_
2021-05-13 06:31:20
I am surprised it even finds patches there - probably misses many potential patches still
Scope
2021-05-13 06:31:34
2021-05-13 06:32:05
```21 223 - new build 16 505 - old build```
2021-05-13 06:32:39
There's text, but that doesn't improve efficiency
_wb_
2021-05-13 06:34:12
Is this a 1-bit image?
2021-05-13 06:35:08
(on phone, hard to check)
2021-05-13 06:35:15
It looks 2-bit or so
2021-05-13 06:36:37
Possibly the image itself is so cheap without patches that the signaling cost of patches is worse than just not doing patches
Scope
2021-05-13 06:36:42
```q1bHrZ3.png PNG 1920x1080 1920x1080+0+0 8-bit sRGB 7c 18513B 0.000u 0:00.017```
_wb_
2021-05-13 06:37:03
7 colors, so 3-bit I guess
2021-05-13 06:37:53
It could be that patches is trying to do those dithering dots
Scope
2021-05-13 06:39:01
2021-05-13 06:39:22
```19 665 - new 17 125 - old```
_wb_
2021-05-13 06:39:28
<@179701849576833024> what is the minimum patch size? Could be useful to bump it up when doing lossless...
2021-05-13 06:41:31
Scope are you comparing at slowest settings? Things might be different at faster speeds...
Scope
2021-05-13 06:43:14
Yes, first all sets on the slowest, then I'll try the others, btw, from what speeds are the paths enabled by default?
_wb_
2021-05-13 06:53:55
I think hare and slower
2021-05-13 06:55:37
At slowest speed, the encoder also tries to do lz77 matching, which competes with patches in a way
veluca
_wb_ It could be that patches is trying to do those dithering dots
2021-05-13 08:02:53
yes, very likely
_wb_ <@179701849576833024> what is the minimum patch size? Could be useful to bump it up when doing lossless...
2021-05-13 08:03:28
probably 1x1, and you're probably right
2021-05-13 08:11:23
<@!111445179587624960> can you try this patch on the images that became worse? (and possibly also on those that became better :P) It makes things worse in some cases, but it should prevent dithering patterns to be encoded as patches - I don't know if that's going to improve things, and before I submit something like this it would be useful to know if it actually works ๐Ÿ™‚ ``` if (!found_border || !all_similar || max_x - min_x >= kMaxPatchSize || - max_y - min_y >= kMaxPatchSize) { + max_y - min_y >= kMaxPatchSize || + (max_x - min_x) * (max_y - min_y) < 2) { continue; } ```
Scope
2021-05-13 08:20:49
Yes, but I won't be able to do it right now, I'll be able to access my PC in about 10-12 hours (to compile changes and stuff), but sample images are above (with different results) if this is needed faster
veluca
2021-05-13 08:53:49
I'm technically on vacation, so no hurry ๐Ÿ˜›
Scope
2021-05-13 09:01:08
Then I will do it after I encode all the sets completely, also then there will be more examples of best and worst results or maybe someone else can compile and check these changes on the examples above
veluca
2021-05-13 09:19:50
I guess that the best heuristic would be something like "if there's only x distinct colors, patches need to be at least y big, and they shouldn't create too many new colors"
2021-05-13 09:23:12
or some simple estimate of bits of encoding a patch (~`k + h*log(image size)`) vs bits of encoding the pixels (~`size*log(distinct colors)`)
Eugene Vert
Scope
2021-05-13 07:49:51
cjxl -m -s 9 -E 3 -I 1 ... zHEkAUH.png ``` 210 805 --patches 0 198 067 --patches 1 197 227 patched --patches 1 ``` q1bHrZ3.png ``` 16 522 --patches 0 21 869 --patches 1 18 595 patched --patches 1 ``` 4LF2tCj.png ``` 17 140 --patches 0 20 139 --patches 1 20 139 patched --patches 1 ```
veluca
2021-05-13 10:33:53
mhhh so this mostly mitigates the problem but doesn't really solve it
2021-05-13 10:34:06
good to know, but probably I should do the smarter thing
2021-05-13 10:34:22
I might do this on Monday or so ๐Ÿ™‚
Scope
2021-05-13 10:35:23
๐Ÿค” So, yes, a more complex heuristic is needed to determine the benefit for paths, the encoding is still in progress, from what I've noticed, all the sets have been larger in size except the photographic type (they're the same)
veluca
2021-05-13 10:36:24
yeah not many patches to find there ๐Ÿ˜›
Diamondragon
2021-05-14 12:31:26
That map of Threed is helped pretty significantly by `-g 3`. I know you aren't testing it (you're using `-s 9 -E 3 -I 1`), but the amount of savings impressed me, since `-g 3` usually doesn't work that well.
2021-05-14 12:32:53
`167 455 cjxl -q 100 -s 9 -E 3 -I 1 -g 3 threed_map.png threed_map.jxl`
Scope
2021-05-14 12:41:58
Yes, by individual settings for each image it is possible to significantly improve the efficiency and even this image we have already discussed https://discord.com/channels/794206087879852103/803645746661425173/812097373438214205 But, when encoding many images (thousands, millions, billions) it is impossible to choose individual settings for each image (except brute force, but it will extremely increase the encoding time, which is already slow)
2021-05-14 12:45:20
Unless, as I once suggested, for example for -s 11 add an automatic selection for -g 3 where it will be better, perhaps there are some methods to identify it faster than brute force
veluca
Diamondragon That map of Threed is helped pretty significantly by `-g 3`. I know you aren't testing it (you're using `-s 9 -E 3 -I 1`), but the amount of savings impressed me, since `-g 3` usually doesn't work that well.
2021-05-14 12:49:57
that's likely lz77...
Scope Unless, as I once suggested, for example for -s 11 add an automatic selection for -g 3 where it will be better, perhaps there are some methods to identify it faster than brute force
2021-05-14 12:51:02
the bigger problem with -g 3 is that it reduces parellizability of decoding, but otherwise I do have a couple of ideas on how one could try to figure out if it would help (without doing full tree learning...)
Scope
2021-05-14 12:57:31
Yes, that's why it should only be enabled for something like -s 11 (modes where for maximum compression the sacrifices are worth)
2021-05-14 12:59:47
And perhaps some small images that fit entirely in the tile
veluca
2021-05-14 12:59:52
I'd prefer to not tie *compression* speed to *decompression* speed
2021-05-14 01:00:18
maybe I'll repurpose `--faster_decoding` for that and have `--faster_decoding=-1` do this kind of search
BlueSwordM
veluca I'd prefer to not tie *compression* speed to *decompression* speed
2021-05-14 01:00:59
That's why you should make a hidden -s 12 that's only available if you compile with a specific option that does everything in the encoder's power to compress as much as possible no matter the cost during decoding <:kekw:808717074305122316>
Scope
2021-05-14 01:01:28
Yes, but there are other cases where maximum compression is most important and it's good to have a choice for that
Pieter
2021-05-14 01:01:44
zstd generally has limited requirements for the decoder, unless you specify --long, which enables higher compression settings which need more decompression memory
2021-05-14 01:01:49
this feels similar
2021-05-14 01:02:38
<@179701849576833024> Does the 5 or 10 profile restrict the use of this?
veluca
2021-05-14 01:02:41
I think I'll make a `--faster_decoding=-1` for automatic `-E 3`, `--faster_decoding=-2` to also try to find the best group size, and maybe let `-s 9` also try the equivalent of `-I 0` and pick the best
2021-05-14 01:02:54
nope!
Pieter
2021-05-14 01:03:01
Maybe it should?
veluca
2021-05-14 01:03:14
I don't think our encoder today does anything that is not covered in L5
2021-05-14 01:03:41
ah, perhaps some higher bit depths
2021-05-14 01:03:59
well, browsers won't be very likely to decode images in parallel I believe, so not sure the restriction should be there
Scope
2021-05-14 01:04:38
Yes, it might be worth doing this with an extra setting than `-s`, so that people don't select it without much knowledge of what they're doing
veluca
Scope Yes, but there are other cases where maximum compression is most important and it's good to have a choice for that
2021-05-14 01:04:41
q: should `-s 9` default to `-I 1`?
2021-05-14 01:05:17
why do you prefer an extra `-s` setting rather than using a flag that is there explicitly to control decoding speed? ๐Ÿ™‚
Scope
2021-05-14 01:05:56
I have not tested how much slower `-I 1` is for encoding and decoding But, usually the effectiveness of `-I 1` is not that big (if there is any)
veluca
2021-05-14 01:06:04
decoding: shouldn't change
2021-05-14 01:06:09
encoding: probably 2x
2021-05-14 01:07:08
(I could also make a `--speed glacier` / `-s 10` ...)
veluca I think I'll make a `--faster_decoding=-1` for automatic `-E 3`, `--faster_decoding=-2` to also try to find the best group size, and maybe let `-s 9` also try the equivalent of `-I 0` and pick the best
2021-05-14 01:08:39
<@!794205442175402004> thoughts?
Pieter
2021-05-14 01:15:38
Glacier is a terrible reference for speed. The fastest is way faster than some slugs, and the slowests are arbitrarily close to 0 speed.
Scope
2021-05-14 01:16:31
I think this kind of setting would be good, my thoughts are that `-s` option is optimal enough to be used by everyone, but it is nice to have additional settings for better compression or vice versa - faster decompression speed
2021-05-14 01:18:56
And that it was not like in some articles, when people use `-s 9` for VarDCT and conclude that JXL is very slow and not very efficient
veluca
Pieter Glacier is a terrible reference for speed. The fastest is way faster than some slugs, and the slowests are arbitrarily close to 0 speed.
2021-05-14 01:19:28
any proposals of an animal that doesn't have negative connotations? ๐Ÿ˜›
Pieter
veluca any proposals of an animal that doesn't have negative connotations? ๐Ÿ˜›
2021-05-14 01:22:42
I'm half joking of course. The only concern about having something that spans an entire range from n>0 speed and 0 speed, is that you later can't add anything that's even slower, unless it has negative speed ;)
veluca
2021-05-14 01:23:10
Jon proposed tectonic_plate once ๐Ÿ˜›
Scope
2021-05-14 01:25:53
Sloth (but it's not always about the movement speed)/Snail? The names should rather be memorable and well-known, than a more accurate match to the encoder speed Although, personally, I prefer just numbers, because I do not need to remember what names are used and they are not always obvious (except like for turtle = slow)
Pieter
2021-05-14 01:26:17
Slowest tortoise: 70000 ฮผm/s Slowest slug: 23 ฮผm/s Fastest glacier: 520 ฮผm/s Amoeba speed: 0.5-3 ฮผm/s
2021-05-14 01:27:11
If you would have given me slug/glacier/amoeba, I don't think I'd even be able to order them in speed...
2021-05-14 01:27:52
Fastest tectonic plate: 0.005 ฮผm/s
veluca
2021-05-14 01:32:00
slug does have some negative connotations though
2021-05-14 01:32:58
I expected glacier and slug > amoeba and tectonic plate, but I wasn't sure about (glacier, slug) and (amoeba, tectonic_plate)
Scope Sloth (but it's not always about the movement speed)/Snail? The names should rather be memorable and well-known, than a more accurate match to the encoder speed Although, personally, I prefer just numbers, because I do not need to remember what names are used and they are not always obvious (except like for turtle = slow)
2021-05-14 01:33:18
don't worry, we'd keep numbers too ๐Ÿ˜„
Pieter
2021-05-14 01:36:45
There is a sea slug that swims like a fish, so it's a lot faster.
Scope
veluca don't worry, we'd keep numbers too ๐Ÿ˜„
2021-05-14 01:40:23
Yep, but just names are less practical in general, for example more understandable for x264 like `-preset slow`/`-preset veryslow` etc. are not so slow nowadays when fast CPUs and much slower formats like AV1/VVC and encoders appeared (and such presets can only relate to each other but not in comparison with something outside encoder)
Pieter
2021-05-14 01:43:33
tardigrade = 200 ฮผm/s
2021-05-14 01:58:52
https://twitter.com/pwuille/status/1393022684221431812
2021-05-14 02:06:37
Oops, my number for the slug is wrong by a factor 1000.
Scope
2021-05-14 03:02:27
Also about single image decoding parallelization, does it work or planned in browsers? Since if it's not used, `-g 3` for web won't be slower to decode, but it would be nice to have a smarter use of resources, like using one thread per image if there are many, and multi-threading for one very large image
_wb_
2021-05-14 06:15:16
I like `snail`, it's somewhat less yucky than slug, it has a hard shell like a tortoise, and it's a simple animal that everyone knows is slow.
veluca <@!794205442175402004> thoughts?
2021-05-14 06:18:04
Makes sense to me. Could also do E 3 by default and disable it with faster decoding = 1, but that does make default decode speed possibly slower (though at default encode speed it probably doesn't use the extraprops). IIRC the effect on decode speed was not that dramatic though...
Scope
2021-05-14 07:46:38
Art set with new build and patched patches `(JXL Patches)`: <https://docs.google.com/spreadsheets/d/1rZJFsAm65Da-z30-yrphjfTWptGltjML6QkhLqPDkvY/edit#gid=2120588660>
2021-05-14 07:46:48
There are some interesting results ๐Ÿค”
2021-05-14 07:49:53
Were there any other changes in lossless modes besides patches in the latest builds?
2021-05-14 07:51:42
https://i.redd.it/09ti861d66j41.png ```6 230 966 - patches 6 774 178 - old ```
2021-05-14 07:55:05
It looks like this grain is better compressed by the patches
2021-05-14 08:00:47
https://i.redd.it/4hkchu3ft7841.png ```3,623,432 - patches 3,095,190 - old ```
_wb_
2021-05-14 08:04:43
We'll have to make better heuristics to avoid such worst-case stuff, and use patches only when they actually help.
2021-05-14 08:05:17
It's a powerful coding tool and we're just scratching the surface of understanding how best to use it.
Scope
2021-05-14 08:07:13
https://i.redd.it/dgfpiwvmghh41.png ```10,385 - patches 12,552 - old ```
_wb_
2021-05-14 08:07:48
<:WhatThe:806133036059197491>
2021-05-14 08:08:03
I wonder how patches help on that image
Scope
2021-05-14 08:08:26
Yep, it's strange, patches for solid color areas/lines? <:Thonk:805904896879493180> Or maybe I need to compare the same build with `--patches=0`
_wb_
2021-05-14 08:10:15
<@179701849576833024> it would be fun to have a debug image that shows little rectangles around the patches, or something
Scope Yep, it's strange, patches for solid color areas/lines? <:Thonk:805904896879493180> Or maybe I need to compare the same build with `--patches=0`
2021-05-14 08:10:55
Ah yes, could be we somehow improved something regardless of patches
Scope
Scope https://i.redd.it/dgfpiwvmghh41.png ```10,385 - patches 12,552 - old ```
2021-05-14 08:26:25
Yes, this is the result of some other improvements, with `--patches=0` the size is the same in the new build (10,385)
Eugene Vert
Scope https://i.redd.it/dgfpiwvmghh41.png ```10,385 - patches 12,552 - old ```
2021-05-14 08:34:31
<:Thonk:805904896879493180> ``` cjxl -m -s 9 -E 3 -I 1 ... 10 286 --patches 0 10 286 --patches 1 10 286 patched --patches 1 ```
2021-05-14 08:37:09
On commit 30ea86ab (2021-05-12) [v0.3.7 | SIMD supported: AVX2,SSE4,Scalar]
Scope
2021-05-14 08:37:19
Maybe because I'm encoding an already optimized PNG or maybe it's the compiler, different SIMD?
2021-05-14 08:37:52
2021-05-14 08:39:32
^ Optimized PNG
Fox Wizard
2021-05-14 08:40:54
Gotta make it even smaller <a:DogeEvil:821038587176419381>
Eugene Vert
2021-05-14 08:42:11
Yep, `10 385` on optimized PNG and `10 286` on unoptimized one <:NotLikeThis:805132742819053610>
veluca
_wb_ <@179701849576833024> it would be fun to have a debug image that shows little rectangles around the patches, or something
2021-05-14 08:42:30
We have that :P compress with benchmark_xl and use --debug_dir
_wb_
2021-05-14 08:44:47
It is weirdly enough compiler/platform dependent what exact encode result you get. Some heuristics use float arithmetic which has compiler/platform-dependent behavior. Of course the result is always a bitstream that losslessly represents the image, but it might be using a different MA tree, for example.
Eugene Vert Yep, `10 385` on optimized PNG and `10 286` on unoptimized one <:NotLikeThis:805132742819053610>
2021-05-14 08:47:07
That is a bit weird, other than maybe a different color profile signaling, if the input pixels are the same then there shouldn't be a difference, afaik
veluca
2021-05-14 08:47:57
might be that one has an ICC and the other one doesn't
Scope
2021-05-14 08:51:27
Pingo optimizes to 8 bits per channel (this is most likely the reason for the different size), but it also creates equal conditions with lossless WebP
Fox Wizard
2021-05-14 08:52:04
Not sure if this was worth a 10 minutes wait, but have a PNG of ๐Ÿ‹ that's slightly better optimized I guess ~~yes, I'm this bored~~
2021-05-14 08:52:42
2**6,66**8 bytes now <a:ElmoHELL:593434575146057728>
2021-05-14 08:53:28
~~only 304 bytes smaller <:kekw:808717074305122316>~~
veluca
Scope Yes, this is the result of some other improvements, with `--patches=0` the size is the same in the new build (10,385)
2021-05-14 08:54:49
not that I recall making any change to lossless recently ๐Ÿ˜›
Scope
2021-05-14 08:55:04
๐Ÿค”
_wb_
2021-05-14 09:19:32
Maybe the better choice between prefix and ANS helps here?
veluca
2021-05-14 09:20:19
ah, maybe, but shouldn't help *this* much...
_wb_
2021-05-14 09:20:19
(the thing you did to trim off some bytes for jxl art ๐Ÿ˜‚ )
2021-05-14 09:21:18
Well that image does have some very low entropy groups, but yes shouldn't help that much
veluca
2021-05-14 10:02:05
<@!111445179587624960> since you've made this huge comparison, could you perhaps send me a corpus of a few images that you know behave surprisingly (in some way) in jxl? ๐Ÿ˜„
2021-05-14 10:02:39
I want to play with improving our heuristics and it would be useful to have such testcases
2021-05-14 10:05:09
say: - bad cases for patch detection - cases where lz77-based codecs (or `-s 9 -I 0`) do better than JXL - cases where `-g 3` or `-g 0` do a lot better than defaults - cases where using palettes has surprising results ( <@!794205442175402004> for the flags for checking that) - other things that just seem weird ๐Ÿ™‚
Scope
2021-05-14 10:08:41
Yep, `-g 0`/`-g 3` for best compression settings? But first I need to finish the current encoding, which will take some time
veluca
2021-05-14 10:09:12
I don't plan to do anything about this until *at least* Monday, likely more anyway ๐Ÿ˜›
2021-05-14 10:09:36
(I didn't understand the `-g 0`/`-g 3` question)
Scope
2021-05-14 10:11:36
Like for `-s 9 -E 3 -I 1` or just for default settings/speed
veluca
2021-05-14 10:15:15
ah, yes
2021-05-14 10:15:44
no need to try it for *all* images of course, just a few examples where each option does better would be good ๐Ÿ™‚
improver
2021-05-14 02:51:18
it's hard to find outliers unless you look at results of all image encodes and compare them, no?
veluca
2021-05-14 03:11:58
not necessarily, you can also run a script 'til it finds something significantly smaller than the results you already have, say
improver
2021-05-14 03:17:36
well yeah, but you won't know if there's something even more significantly smaller
2021-05-14 03:18:02
(yes this is pointless)
veluca
2021-05-14 03:23:42
I just need examples, not complete information ๐Ÿ˜›
Scope
2021-05-14 11:28:06
It's strange, but the new build is worse than the older one (on which I did the last comparison): <https://docs.google.com/spreadsheets/d/1rZJFsAm65Da-z30-yrphjfTWptGltjML6QkhLqPDkvY/edit#gid=2120588660>
2021-05-14 11:28:25
2021-05-14 11:31:17
JXL Patches (new build with a patch for patches) `-s 9 -E 3 -I 1` JXL Patch 0 (same, but with --patches=0) `-s 9 -E 3 -I 1 --patches=0` JXL (s9 E3 I1) (old build) `-s 9 -E 3 -I 1`
veluca
2021-05-14 11:33:10
... weird
2021-05-14 11:33:15
any idea why?
2021-05-14 11:33:34
or a few example files
2021-05-14 11:33:48
there might have been regressions, I guess
Scope
2021-05-14 11:34:51
Also strange that I tested several recent builds (but I do not remember which ones) and the result did not change, it happened on some of the most recent
veluca
2021-05-14 11:36:13
I wouldn't be sure why...
Scope
2021-05-14 11:36:41
https://i.redd.it/j6dypx3jha841.png ```5,635,876 - JXL Patches 4,959,727 - JXL (s9 E3 I1) ```
veluca
2021-05-14 11:36:41
one random guess is that we might preserve more metadata now (i.e. exif) but that seems too big of a difference for that
2021-05-14 11:37:21
what does it do with --patches=0?
Scope
2021-05-14 11:37:35
5,635,876 - same
veluca
2021-05-14 11:38:01
not *too* surprising
2021-05-14 11:38:19
if you have both builds around - can you run cjxl with `--print-details`?
Scope
2021-05-14 11:39:06
`Unknown argument: --print-details`
veluca
2021-05-14 11:39:25
sorry, --print_details
2021-05-14 11:39:29
I think
2021-05-14 11:40:08
nah
2021-05-14 11:40:10
it's just -v
Scope
2021-05-14 11:40:58
Apart from the version and SIMD there is nothing there
veluca
2021-05-14 11:41:05
could you create a drive folder / email / whatever with these weird files and send it to me by DM (or even better email), so that I won't forget to look into it when I have time? ๐Ÿ™‚
2021-05-14 11:41:11
ok, let me figure out how to trigger that
Scope
2021-05-14 11:41:14
`[v0.3.7 | SIMD supported: AVX2]`
veluca
2021-05-14 11:42:04
``` luca@desktop ~ $ ./jpeg-xlm/build/tools/cjxl /data/jpeg_xl_data/jyrki31/stp.png -m -v J P E G \/ | /\ |_ e n c o d e r [v0.3.7 | SIMD supported: AVX2,SSE4,Scalar] ../lib/extras/codec_png.cc:505: PNG: no color_space/icc_pathname given, assuming sRGB No output file specified. Encoding will be performed, but the result will be discarded. Read 1024x683 image, 41.8 MP/s Encoding [Modular, lossless, squirrel], 32 threads. Compressed to 625248 bytes (7.152 bpp). 1024 x 683, 0.70 MP/s [0.70, 0.70], 1 reps, 32 threads. Average butteraugli iters: 0.00 Total layer bits headers 0.001499% 75 Total layer bits TOC 0.006658% 333 Total layer bits quant tables 0.000020% 1 Total layer bits modularGlobal 0.404769% 20246 [c/i:107.00 | hst: 2486 | ex: 0 | h+c+e: 618886.455] Total layer bits modularAcGroup 99.392926% 4971499 Total layer bits modularTree 0.194128% 9710 [c/i: 4.00 | hst: 39 | ex: 109 | h+c+e: 1205.837] Total image size 5001864 [c/i:111.00 | hst: 2526 | ex: 7121 | h+c+e: 627103.792] Allocations: 429 (max bytes in use: 3.662562E+07) ```
Scope
2021-05-14 11:42:43
Yes, but I was going to finish at least one more set first (maybe there will be a different result)
Scope https://i.redd.it/j6dypx3jha841.png ```5,635,876 - JXL Patches 4,959,727 - JXL (s9 E3 I1) ```
2021-05-14 11:43:35
For this image?
2021-05-14 11:46:45
```cjxl.exe "j6dypx3jha841.png" "j6dypx3jha841.png.ls9.jxl" -q 100 --num_threads 8 -v J P E G \/ | /\ |_ e n c o d e r [v0.3.7 | SIMD supported: AVX2] Read 2097x4781 image, 40.8 MP/s Encoding [Modular, lossless, squirrel], 8 threads. Compressed to 6078780 bytes (4.851 bpp). 2097 x 4781, 0.83 MP/s [0.83, 0.83], 1 reps, 8 threads. Average butteraugli iters: 0.00 Total layer bits headers 0.000185% 90 Total layer bits TOC 0.007973% 3877 Total layer bits quant tables 0.000002% 1 Total layer bits modularGlobal 0.196613% 95612 [c/i:128.00 | hst: 11946 | ex: 0 | h+c+e: 4707763.904] Total layer bits modularAcGroup 99.559425% 48415207 Total layer bits modularTree 0.235802% 114669 [c/i: 4.00 | hst: 54 | ex: 2438 | h+c+e: 13983.063] Total image size 48629456 [c/i:132.00 | hst: 12001 | ex: 1316104 | h+c+e: 6035412.717] Allocations: 1428 (max bytes in use: 4.588365E+08)```
veluca
2021-05-14 11:48:32
that's on the new or on the old build?
Scope
2021-05-14 11:48:41
New
veluca
2021-05-14 11:48:46
ah, also I meant with the same other flags
2021-05-14 11:48:54
so -s 9 -E 3 -I 1
2021-05-14 11:49:19
could you also do it on the old? ๐Ÿ™‚
Scope
2021-05-14 11:49:58
Ok, but I don't remember which was the old build, I'll try some
2021-05-14 11:52:34
And it's a big image, so it's going to take a while at these settings
veluca
2021-05-14 11:53:27
thanks!
Scope
2021-05-15 02:07:59
Hmm, I tried all the builds from 0.2 and higher and the result was the same, maybe it was some even older version, I think I'll update all the other sets with the new version and see the results
2021-05-15 02:13:53
Aw set <https://docs.google.com/spreadsheets/d/1rZJFsAm65Da-z30-yrphjfTWptGltjML6QkhLqPDkvY/edit#gid=1734182694>
2021-05-15 02:14:26
The difference is very small
2021-05-15 08:39:29
Manga set <https://docs.google.com/spreadsheets/d/1rZJFsAm65Da-z30-yrphjfTWptGltjML6QkhLqPDkvY/edit#gid=1181869618>
2021-05-15 08:39:32
2021-05-15 08:41:45
Some interesting examples https://i.redd.it/xptmu1db53o31.png
2021-05-15 08:43:21
```41,741 - JXL (patches 0) new build 50,175 - JXL (defaults) new build```
2021-05-15 08:44:52
- https://i.redd.it/95syrffycdj51.png
2021-05-15 08:45:31
```436,377 - JXL (patches 0) new build 429,883 - JXL (defaults) new build```
2021-05-15 08:46:50
But in general the result does not change much on this set
2021-05-16 02:19:01
PixelArt set <https://docs.google.com/spreadsheets/d/1rZJFsAm65Da-z30-yrphjfTWptGltjML6QkhLqPDkvY/edit#gid=0>
2021-05-16 02:19:15
2021-05-16 02:21:57
- https://i.redd.it/myvhtme8abi41.png ```9,819 - JXL (patches 0) new build 8,774 - JXL (defaults) new build```
2021-05-16 02:24:28
- https://i.redd.it/jm2ri825s9851.png ```5,541 - JXL (patches 0) new build 5,374 - JXL (defaults) new build```
2021-05-16 02:29:57
But it seems that on very small images or where there are few colors, patches are ineffective https://i.redd.it/qu0dqaxauoh41.png ```4,204 - JXL (patches 0) new build 5,987 - JXL (defaults) new build```
2021-05-16 02:30:52
- https://i.redd.it/b0meqib48zf61.png ```249 - JXL (patches 0) new build 353 - JXL (defaults) new build```
2021-05-16 02:31:30
- https://i.redd.it/v0o3h0uc1j961.png ```9,631 - JXL (patches 0) new build 11,895 - JXL (defaults) new build```
2021-05-16 02:32:46
- https://i.redd.it/uo9u57i7opj41.png ```28,726 - JXL (patches 0) new build 36,885 - JXL (defaults) new build```
Scientia
2021-05-16 06:19:37
tuning for pixel art could be improved, I'm pretty sure one of the devs said that on small images a lot more tuning could be done
Scope
2021-05-16 06:42:05
Some -gX examples (-s 9 -E 3 -I 1): https://i.redd.it/815jlxknl5o51.png ```352,540 -g 0 385,640 -g 3 371,122 -g 1-2 (defaults) ```
2021-05-16 06:43:46
- https://i.redd.it/1xbcfb7b49h51.png ```212,026 -g 0 153,379 -g 3 205,573 -g 1-2 (defaults) ```
2021-05-16 06:47:53
- Interesting that both `-g 0` and `-g 3` are better than the defaults https://i.redd.it/xptmu1db53o31.png ```46,794 -g 0 41,856 -g 3 50,175 -g 1-2 (defaults) ```
2021-05-16 06:51:36
- https://i.redd.it/5yqvn7szhhy51.png ```1,510,864 -g 0 1,360,890 -g 3 1,565,266 -g 1-2 (defaults) ```
2021-05-16 06:52:53
So for something like black and white images, the smallest and largest group sizes are better?
2021-05-16 06:57:42
- https://i.redd.it/o0ilan3v7fy51.png ```283,415 -g 0 391,175 -g 3 277,937 -g 1-2 (defaults) ```
2021-05-16 06:58:04
<:Thonk:805904896879493180> Hmm, although this is not always the case, perhaps it also depends on the image complexity in the tiles
_wb_
2021-05-16 07:35:33
Thanks for finding these examples!
2021-05-16 07:36:38
Figuring out a good heuristic for -g will be tricky, there are several things that interplay there...
veluca
2021-05-16 09:55:23
I think for patches my heuristic on "some formula on #pixels and #colors" should work
_wb_
2021-05-16 10:14:34
I guess if the patch is duplicated only within the same group, using lz77 matches will probably end up being cheaper to signal (unless it's a very tall patch, small width and big height is not good for lz77)
2021-05-16 10:18:20
So maybe could also give a heuristic weight boost to patches that have copies in multiple groups, or something, and based on aspect ratio (a 100x2 patch is probably better done with lz77 while a 2x100 patch is not good for lz77)
veluca
2021-05-16 10:18:51
mhhh, that might be useful, but I think we have bigger problems
2021-05-16 10:19:11
like we shouldn't create patches at all for 1x1 pixels in a black-white image, that's just silly
_wb_
2021-05-16 10:19:57
Yes, probably not for 2x2 pixels either
Scope
2021-05-16 02:21:34
- https://i.redd.it/6obx988is5h61.png ```13,000 -g 0 2,246 -g 3 4,930 -g 1-2 (defaults) ```
2021-05-16 02:22:43
For this kind of content there is a big difference for `-g 3`
veluca
2021-05-16 02:23:29
yeah, that image is very lz77 friendly
2021-05-16 02:23:44
big groups help there, a lot
Scope
2021-05-16 02:25:55
https://i.redd.it/eftrizs1uf941.png ```495,654 -g 0 296,654 -g 3 452,338 -g 1-2 (defaults) ```
2021-05-16 02:29:14
- For pixel art or tile patterns -g 3 helps, but not always https://i.redd.it/49ox0pmrf6c61.png ``` 97,839 -g 0 105,746 -g 3 66,357 -g 1-2 (defaults) ```
2021-05-16 02:32:54
- It seems to be worse for very complex images or with large color areas https://i.redd.it/d2emovbjx5861.png ```188,634 -g 0 312,502 -g 3 196,182 -g 1-2 (defaults) ```
2021-05-16 02:36:09
- -g 0 ```165,025 -g 0 225,345 -g 3 216,175 -g 1-2 (defaults) ```
2021-05-16 02:37:33
- https://i.redd.it/0dw3cmjdh9b61.png ```110,633 -g 0 129,171 -g 3 127,735 -g 1-2 (defaults) ```
_wb_
2021-05-16 02:41:58
Small groups make local palette more effective, big groups make prediction and lz77 more effective
Scope
2021-05-16 08:50:12
https://i.redd.it/ps0qma6rixf41.png ```590,982 - JXL (patches 0) new build 638,522 - JXL (defaults) new build```
2021-05-16 08:50:50
- https://i.redd.it/xmtoihicvlj41.png ```68,569 - JXL (patches 0) new build 73,291 - JXL (defaults) new build```
Scientia
2021-05-16 09:09:31
38 kilobytes is a large delta
2021-05-16 09:09:46
I'm talking about the wave image
2021-05-16 09:14:41
Do you think detecting dithering would help
veluca
2021-05-16 09:17:29
maybe not dithering specifically
2021-05-16 09:17:39
but small patches on low-color images, definitely yes
Scope
2021-05-17 07:50:59
<https://i.redd.it/9s13kkm53mc41.png> ``` 874,098 - JXL (palette=0) 1,148,710 - JXL (defaults)```
2021-05-17 07:53:01
- https://i.redd.it/c4o4edl7zli41.png ```533,895 - JXL (palette=0) 645,720 - JXL (defaults)```
2021-05-17 07:53:50
- https://i.redd.it/mcjesaqusa141.png ```1,293,982 - JXL (palette=0) 1,540,206 - JXL (defaults)```
2021-05-17 07:54:56
- https://i.redd.it/msakckaxtyt41.png ```3,750,292 - JXL (palette=0) 4,385,213 - JXL (defaults)```
2021-05-17 08:00:26
- Manga set with added `palette=0` and other options, I have not yet selected images that highly differ in size with some options, first I want to finish encoding other sets, but if such examples are needed, it will be easier to copy the spreadsheet and sort the efficiency in percentages by the desired options <https://docs.google.com/spreadsheets/d/1rZJFsAm65Da-z30-yrphjfTWptGltjML6QkhLqPDkvY/edit#gid=1181869618> - All image sets from this comparison (if it's more convenient or some have a broken link) <https://drive.google.com/drive/u/1/folders/1X_F_vhNwJFhPWSW3EeSa-gGhhikkOoYd> -
2021-05-17 08:06:37
Btw, `palette=0` for the Manga set is more efficient in general (except `-g 3`), so the palette needs some tuning
veluca
2021-05-17 08:25:22
those palette=0 numbers are kinda odd xD
Scope
2021-05-17 08:27:05
I think it's because Manga are mostly black and white images
2021-05-17 08:37:22
For example for something like this, it's not good: https://i.redd.it/815jlxknl5o51.png ```731,619 - JXL (palette=0) 371,122 - JXL (defaults)```
veluca
2021-05-17 08:56:22
sure, but we do have heuristics for palette for 1c...
_wb_
2021-05-17 08:57:14
they might not be good though ๐Ÿ™‚
Scope
2021-05-17 09:00:00
Maybe because it's not pure black and white, it's usually some kind of shade
2021-05-17 11:16:47
https://i.redd.it/dghx5h93l8k41.png ```316,862 - EMMA 433,042 - WebP 426,770 - JXL (palette=0) 414,566 - JXL (-g 0) 408,716 - JXL (-g 3) 447,090 - JXL (defaults)```
veluca
2021-05-17 10:31:42
<@!111445179587624960> would you be able to collect all the images you sent here in a drive folder / zipfile and send them by email/dm/whatever? (even better if you can divide them by what is the weird thing, or add the text that you sent here with them :D)
Scope
2021-05-17 10:40:14
Yes, but I will finish at least one more set because encoding at these settings is very slow and I will not add `--palette 0` for other sets (because it is mainly useful for black and white images), btw, I think that `--palette 0` consumes more memory <:Thonk:805904896879493180> , although I have not done a comparison, but overall RAM consumption has increased for the same set
2021-05-17 10:47:31
Later I will make a spreadsheet only with strange images and upload them to gdrive, it will be difficult to describe or separate them, because one image can fit into several categories at once and it will be easier to see what the problem is in the spreadsheet
veluca
2021-05-17 11:03:02
that's great already ๐Ÿ™‚
Scope
2021-05-18 12:40:43
Hmm, for some big images with `--palette 0` I didn't even have enough RAM to encode them, yes, several images in parallel, but still, with other settings everything encoded fine So can `--palette 0` consume significantly more RAM in certain cases?
2021-05-18 12:45:50
Some examples:
2021-05-18 12:46:06
2021-05-18 12:46:37
2021-05-18 12:47:39
I don't think --palette 0 is needed for these images, but still
_wb_
2021-05-18 12:53:21
Strange that it uses more memory, I would expect less
veluca
2021-05-18 12:58:47
probably not creating a palette ends up with more pixels in total
Scope
2021-05-18 01:49:46
Also interesting example https://i.imgur.com/qAiPdtp.png ```668,269 - JXL (palette=0) 850,291 - JXL (patches 0) 915,479 - JXL (-g 0) 672,755 - JXL (-g 3) 849,578 - JXL (defaults)```
2021-05-18 01:52:45
Not a black and white image, unless there are not many colors
2021-05-18 01:54:12
- https://i.imgur.com/j84wOJe.png ```175,771 - JXL (palette=0) 218,843 - JXL (patches 0) 243,080 - JXL (-g 0) 171,226 - JXL (-g 3) 220,018 - JXL (defaults)```
2021-05-18 01:59:01
So the palette needs tuning, because on certain images `palette=0` or `-g 3` gives a significant difference
2021-05-18 05:00:15
<@!179701849576833024><@!794205442175402004>**Tuning Corpus** <https://docs.google.com/spreadsheets/d/1Ne3sFznHIMAUn-QQJR9UnQDRwKNarcvuFxeAvQDSHw8/edit#gid=2120588660> **Tuning Corpus Images** <https://drive.google.com/drive/folders/14zu7SUT1CYGvsCbqnrfDejWNcfQO6gwB>
2021-05-18 05:01:25
The selected sets look like this, the rest are not ready yet
2021-05-18 05:06:44
I picked the biggest difference in some options or WebP and if BMF or EMMA is 40% better (since it is most likely that such images can also compress better) The biggest and most problematic set is still Pixel Art, WebP and BMF are kings there
veluca
2021-05-18 06:08:13
thanks a lot! I don't know *exactly* when I'll be able to look at tweaking the encoder for this (the *decoder* still needs quite a bit of love :D) but those will be very useful ๐Ÿ™‚
Scope
2021-05-20 08:06:12
<https://i.redd.it/p2x28aq8uxc41.png> ```2,175,032 - JXL (Palette 0) 2,091,901 - JXL (Palette 10000) 2,085,348 - JXL (-X 0 -Y 0) 2,085,348 - JXL (s9 E3 I1) 2,085,371 - JXL (Patch 0) 2,070,774 - JXL (-g 0) 2,287,156 - JXL (-g 3) 1,741,899 - FLIF 1,484,366 - EMMA ``` I'm doing another corpus with different options on images where JXL was worse than other formats, is there anything else I can try for this image for better results?
2021-05-20 08:12:39
Or just one more option that will be useful in the overall comparison and the result can be very different? So far, I've noticed that the biggest difference is more often with `g 3` and `palette 0`
diskorduser
2021-05-21 03:13:37
`2153287 crop.png 2177387 crop-s3-modular.jxl 1757006 crop-s4-modular.jxl 1304737 crop-s6-d1.jxl 1387412 crop.zpng`
2021-05-21 03:14:59
zpng compress very fast and has better compression than modular s3 , s4.
2021-05-21 03:18:21
1312x30297 image dimensions.
_wb_
2021-05-21 04:34:21
For non-photographic images that doesn't surprise me
diskorduser
2021-05-21 05:25:16
For photographic, `4.5 MB ref-m.jxl 6.0 MB ref.png 1.3 MB ref.zpng`
_wb_
2021-05-21 05:26:55
That is a nice result for zpng
diskorduser
2021-05-21 05:27:06
Faster to encode too
_wb_
2021-05-21 05:27:24
What is zpng? Png with zstd?
diskorduser
2021-05-21 05:27:29
Yes
_wb_
2021-05-21 05:27:48
Could you share that image?
2021-05-21 05:28:44
Maybe try -s 3 -g 3 ?
diskorduser
2021-05-21 05:29:15
Is it lossless?
_wb_
2021-05-21 05:29:38
I mean -m -s 3 -g 3
diskorduser
2021-05-21 05:30:04
No change in file size
_wb_
2021-05-21 05:30:31
Should be at least some small change in file size
diskorduser
2021-05-21 05:30:37
The image is the flower photo which I shared in photography channel
_wb_
2021-05-21 05:31:18
That's a jpeg?
diskorduser
2021-05-21 05:31:34
It's a PNG
_wb_
2021-05-21 05:32:04
plu.jpg is a png?
diskorduser
2021-05-21 05:32:18
May be discord changed it
2021-05-21 05:32:26
I will share the png
2021-05-21 05:41:38
2021-05-21 05:45:23
May the zpng does lossy compression?
_wb_
2021-05-21 05:57:40
That sounds weird to me, but maybe?
2021-05-21 05:57:56
What tool do you use to encode it?
diskorduser
2021-05-21 05:59:14
I got encoder exe from their GitHub. And used wine to run it on Linux
2021-05-21 06:00:20
https://github.com/catid/Zpng/blob/master/ZpngApp.exe?raw=true
2021-05-21 06:03:15
I opened both reference PNG and zpng decoded PNG on gimp and set layer mode to difference. I don't see any difference.
fab
2021-05-21 06:09:52
use dssim
_wb_
2021-05-21 06:13:24
Do compare -metric pae orig.png decoded.png null:
diskorduser
2021-05-21 06:21:04
Pae - 242
_wb_
2021-05-21 06:21:48
Not lossless then
2021-05-21 06:22:04
Maybe converts 16-bit to 8-bit?
diskorduser
2021-05-21 06:22:13
But on viewing on imageviewer, comparing both pixel by pixel, no change in color and there are no artifacts
_wb_
2021-05-21 06:22:36
Yes on an 8-bit display you wouldn't have any difference
diskorduser
2021-05-21 06:51:17
I didn't realize I was using a 16bit PNG as input. I am stupid. ๐Ÿ˜†
_wb_
2021-05-21 06:54:29
``` $ stat -c "%s %n" ref* 521695 ref8bit.png 367726 ref8bit.png.jxl-m-s3 344042 ref8bit.png.jxl-m-s9 363371 ref8bit.png.jxl-m-s9-E3-g0-I1 339557 ref8bit.png.jxl-m-s9-E3-g1-I1 354125 ref8bit.png.jxl-m-s9-E3-g3-I1 1738349 ref.jxl 2280161 ref.png 521034 ref.zpng ```
2021-05-21 06:55:02
zstd-png doesn't help much compared to regular gzip-png, on this image
diskorduser
2021-05-21 07:09:42
Yeah
veluca
2021-05-21 08:22:47
for stuff that is good with PNG, you should try `-s 9 -I 0 -g 3 -P 0` ๐Ÿ™‚
2021-05-21 08:23:19
(I promise I'll make a speed setting that tries that at some point...)
Deleted User
veluca for stuff that is good with PNG, you should try `-s 9 -I 0 -g 3 -P 0` ๐Ÿ™‚
2021-05-21 08:29:42
What about this file then? Even `-s 9 -g 3 -E 3 -I 1` JXL can't go below original PNG size...
veluca
2021-05-21 08:34:56
did you try -I 0 and different values of -P ?
Deleted User
2021-05-21 08:36:20
`-I 0` increased filesize from 383 to 811 bytes
veluca
2021-05-21 08:38:35
mhhh, let's see what's going on here
Deleted User
2021-05-21 08:40:32
Just bruteforced through all `-P` values both on `-I 1` and `-I 0` while keeping `-m -s 9 -g 3 -E 3` constant, never went lower than 383 bytes.
Scope
2021-05-21 08:46:30
Also, I tried `-s 9 -I 0 -g 3 -P n` on images where WebP was better and the result was still worse than WebP or some other JXL option, perhaps JXL has a less efficient LZ77 implementation right now?
veluca
2021-05-21 08:47:57
one thing webp does that jxl doesn't is change predictors with lz77
2021-05-21 08:52:52
but in this specific case, by looking at the tree, I'd say this is a bad tree learning case
Deleted User
2021-05-21 08:53:24
This file is from Wikipedia, btw
Scope
2021-05-21 08:57:24
Perhaps sometimes the limited group size also affects, btw, would adding a size higher than 1024x1024 not add more efficiency or would it be difficult for the JXL structure, more designed to work with tiles rather than one solid image?
_wb_
2021-05-21 09:01:18
2021-05-21 09:01:32
`-m -s 9 -I 1 -v --palette 0 -X 0 -Y 0`
2021-05-21 09:02:02
palette and channel palette heuristics are too simplistic
2021-05-21 09:02:37
-E 3 trims two more bytes, 130 bytes
2021-05-21 09:03:26
a hand-written tree could probably bring it down further
Scope
2021-05-21 09:05:26
Yes, `--palette 0` was often noticeably better in my tests, mostly `-g 3` or/and `--palette 0` gives significantly different results on problematic images, all other options are not that noticeable
_wb_
2021-05-21 09:07:00
basically currently the heuristic is just "if the image (or group) has less than 1024 different colors, make a palette and encode it like that"
2021-05-21 09:07:17
that is certainly not always a good idea
2021-05-21 09:07:59
sometimes palettes with more colors are effective, sometimes even a palette with just 100 colors is less effective than encoding the channels separately
2021-05-21 09:08:52
it's just quite hard to estimate in advance when it will work well and when not
2021-05-21 09:09:32
maybe we should just try both with and without palette and make a -s 10 that is twice as slow
2021-05-21 09:09:52
or 4 times as slow, since this would have to be done both globally and locally
Scope
2021-05-21 09:10:28
Yep, sometimes --palette 10000 https://i.redd.it/lmbvey8yymj41.png ```43,631 - Palette 10k 49,780 - Palette 0 48,923 - JXL (s9 E3 I1) 48,382 - JXL (-g 0) 55,370 - JXL (-g 3) ```
_wb_
2021-05-21 09:16:13
10k is just the upper bound, it could be a 1025-color palette ๐Ÿ™‚
veluca
_wb_ or 4 times as slow, since this would have to be done both globally and locally
2021-05-21 09:55:35
we can do better than that, we just need to find a good proxy for "how many bits will this take", no need to do full tree learning ๐Ÿ˜›
Scope
2021-05-21 10:40:41
Big difference for `-g 3` https://i.redd.it/i6e4lbla4pv21.png ```576,412 - WebP 734,087 - Palette 0 769,994 - JXL (s9 E3 I1) 793,921 - JXL (-g 0) 528,436 - JXL (-g 3) ```
improver
2021-05-21 04:26:31
2021-05-21 04:26:34
anime'ing
2021-05-21 04:27:09
(du is bad for small sizes)
2021-05-21 04:28:47
also jpeg's levels don't quite match up. for small images jxl makes them much smaller at equivalent jpeg levels
2021-05-21 04:29:34
which is kinda expected but also these purple color shift on ribbon things make me think that its pushing a bit too far
veluca
2021-05-21 04:31:09
I suspect the blue differences are not visible without a lot of zooming
improver
2021-05-21 04:36:16
when i make file sizes basically the same, it looks pretty much perfect, so it's not worse than jpeg
2021-05-21 04:37:40
2021-05-21 04:42:42
anyway ill stop playing with it ive been nerd sniped
2021-05-21 04:49:52
2021-05-21 04:49:53
no more
2021-05-21 04:50:44
curiously, with modular color shift happens near border, while with vardct it's more like random drops
Scope
2021-05-22 10:27:28
Interesting, but maybe not very practical example (since fractals are quite a narrow theme) https://i.redd.it/04gch7ezbdc41.png ```7,774,068 - WebP 8,513,022 - JXL (s9 E3 I1) 8,046,059 - JXL (-g 3) ```
_wb_
2021-05-22 10:33:14
Looks quite repetitive, that's where groups hurt (theoretically patches could help, but good luck detecting those in an image like this)