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-10-05 05:54:47
Yes in my opinion is the right balance between fidelity and artifacts
2021-10-05 05:54:59
At d1 it look mostrous
2021-10-05 05:55:08
Providing good images
2021-10-05 05:55:36
For screenshots gonna look good especially at s8
diskorduser
fab At d1 it look mostrous
2021-10-05 05:55:38
Eh?
fab
2021-10-05 05:56:00
I agree with arun
diskorduser
2021-10-05 06:01:03
But you need to understand libjxl can't / shouldn't make already compressed / poor quality image to look good.
fab
2021-10-05 06:08:59
yes when i use libjxl i think images of this quality should look good
2021-10-05 06:09:07
compressed at 0.323 bpp
2021-10-05 06:09:25
should look same and with same appeal as original
2021-10-05 06:09:28
i assume it
2021-10-05 06:09:41
wb can tell me is wrong
2021-10-05 06:10:43
but the encoder scope is testing is good
2021-10-05 06:11:02
wb changes he did to gain 4, 5% quality on png at least is good
2021-10-05 06:11:39
i hope he adds it to libjxl
2021-10-05 06:11:48
it has no flaws
diskorduser
2021-10-05 06:13:51
Is this tik tok?
fab
diskorduser Is this tik tok?
2021-10-05 06:14:00
yes
2021-10-05 06:14:33
naples music
2021-10-05 06:14:53
tik tok advices what i look, but i don't look for them
2021-10-05 06:15:04
just that i live in a isle in south
2021-10-05 06:15:34
and obviously i don't skip their videos
diskorduser Is this tik tok?
2021-10-05 06:16:13
if that image disturbs the dev i can create another thread but the devs are focusing more on png
2021-10-05 06:16:33
on raw files
2021-10-05 06:16:41
because that interested them in comparisons
diskorduser
2021-10-05 06:16:58
I asked because I never used tiktok
fab
2021-10-05 06:16:59
even if they are a bit bad
2021-10-05 06:17:26
but i don't see english speaking people on my feed
2021-10-05 06:21:34
mineimage
2021-10-05 06:32:29
to me the commit is very good, commit it
2021-10-05 06:32:36
for png it improves all
2021-10-05 06:33:16
apart of these things https://discord.com/channels/794206087879852103/895000336325017641/895000687535067136
2021-10-05 06:33:20
look fine
2021-10-05 06:33:39
it produces all what jon sneyers said on github
2021-10-06 01:05:18
2021-10-06 01:05:18
2021-10-06 01:05:26
2021-10-06 01:05:26
2021-10-06 01:05:27
2021-10-06 01:05:28
2021-10-06 01:05:28
i won't upload on mineimage they are 20 kb files
2021-10-06 01:05:28
2021-10-06 01:05:44
Kornel
2021-10-14 11:59:46
Do you know if there's compression benchmark dataset tested on @2x/200dpi images?
2021-10-14 12:00:20
I use old TID2013, but it was done on 1x monitors
2021-10-14 12:00:51
And I'd like to tune perceptual quality for hdpi properly
_wb_
2021-10-14 12:07:33
Not afaik
2021-10-14 12:08:52
Would you like to participate in the AHG on image quality assessment? this is one of the open questions imo: what's the effect of pixel density
2021-10-14 12:10:11
In the past, typically testing was done in labs, on calibrated monitors that have good color reproduction but typically no high pixel density
2021-10-14 12:10:58
I don't know of any subjective experiments that were done on, say, phones or tablets
veluca
2021-10-14 01:43:11
I have a 200+dpi monitor now... ๐Ÿ˜„
Lastrosade
2021-10-15 01:10:59
Finally done
2021-10-15 01:11:04
Its only 500 iterations tho
Fox Wizard
2021-10-15 01:14:09
I like how webp just goes full green mode
Lastrosade
2021-10-15 01:17:03
I'm running a new one with 4000 iterations with Q between 70 and 85
Fox Wizard
2021-10-15 01:28:42
<:WhiteFoxSalute:689481667412623385>
_wb_
2021-10-15 02:13:02
webp used to go full pink
2021-10-15 02:13:30
then at some point I suppose they decided to round something the other way, and now it goes full green
2021-10-15 02:14:17
(pink is maximum value for Cb Cr, green is minimum value for Cb Cr)
fab
2021-10-15 02:25:14
2021-10-15 02:25:23
increase detail on that
2021-10-15 02:25:24
https://jon.lucaversari.it/comparison3/after_adjusted2/index.jxl_d2.html
2021-10-15 02:30:03
banding https://mega.nz/file/DAdGDLSI#JU6ttobPWyPhymbJJxqtwJ0FI9YciAuL7FfUiUbyDKE
2021-10-15 02:30:23
https://jon.lucaversari.it/comparison3/after_adjusted4/index.jxl_d1.html
2021-10-15 02:32:08
overrall i prefer afteradjusted 3 at d3.5
2021-10-15 02:32:23
afteradjusted 3 best photographic quality at d2 https://jon.lucaversari.it/comparison3/after_adjusted2/index.jxl_d1.html too white
2021-10-15 02:36:51
overrall i would use --epf=0 --gaborish=0 --faster_decoding=2 -q 95.078 -s 8 --use_new_heuristics --dots=0 on At kAcQuant=0.83: https://jon.lucaversari.it/comparison3/after_adjusted2/index.jxl_dX.html
Lastrosade
2021-10-15 09:03:14
Those are interesting results for jxl. 4000 iterations with Q between 70 and 85
monad
2021-10-15 09:06:43
source performs pretty well
Lastrosade
2021-10-15 09:07:44
I heard its lossless
_wb_
2021-10-15 09:08:24
That looks quite bad for jxl - how many different settings are you using in that interval?
Lastrosade
2021-10-15 09:08:44
only -q changes
2021-10-15 09:09:03
```powershell #mozjpeg cjpeg -outfile "loss3/$j.jpeg" -quality $Q "loss3/$j.jpeg.png" djpeg -outfile "loss3/$i.jpeg.png" "loss3/$j.jpeg" ffmpeg -hide_banner -v error -y -i "loss3/$j.webp" -metadata q=$Q -q:v $Q "loss3/$i.webp" cjxl "loss3/$j.jxl.png" -q $Q -e 4 "loss3/$j.jxl" *>$null djxl "loss3/$j.jxl" "loss3/$i.jxl.png" *>$null $avifQ = [math]::floor([math]::Abs($Q-100)/100*63) avifenc "loss3/$j.avif.png" -c aom --min $avifQ --max $avifQ -s 4 -a color:sharpness=2 -a color:enable-chroma-deltaq=1 -a color:enable-qm=1 -a color:qm-min=0 "loss3/$j.avif" *>$null avifdec "loss3/$j.avif" "loss3/$i.avif.png" *>$null heif-enc -q $Q "loss3/$j.heic.png" -o "loss3/$j.heic" *>$null heif-convert "loss3/$j.heic" "loss3/$i.heic.png" *>$null ```
190n
2021-10-15 09:10:44
what language is that?
Lastrosade
2021-10-15 09:10:48
powershell
2021-10-15 09:11:13
The coloring in discord is weird
2021-10-15 09:12:00
Its a bit cleaner in a sane editor
Scope
2021-10-15 09:16:31
Probably some more strong filters are triggered, also from my own experience I would not recommend using Speed/Effort other than 3, 6/7 and probably 8, because they sometimes give strange results and as far as I remember they were not tuned at all
Lastrosade
2021-10-15 09:17:06
Ah
2021-10-15 09:17:11
-s 3 then
veluca
2021-10-15 09:18:18
`-e 4` is pretty much uncharted territory
2021-10-15 09:18:37
I'd advise against doing this with anything lower than `-e 5`
2021-10-15 09:18:56
`-e 3` is ~~ JPEG so I'm not sure it's useful
Lastrosade
2021-10-15 09:19:18
Oh right its been reversed
2021-10-15 09:19:56
I'll do -e 7
2021-10-15 09:21:28
I should also try to apply the labels after encoding and not on the sources themselves
2021-10-15 09:21:40
But I'm way too lazy and tired
2021-10-15 09:22:09
I'll let it run during the night 10000 iterations at Q 90 to 99
2021-10-15 09:22:57
I also don't know any x265 options that would make heic suck less
2021-10-15 09:23:14
or even jpeg
2021-10-15 09:23:17
or jxl
2021-10-15 09:24:44
actually I'll replace the source with webp2
2021-10-15 09:29:15
`-tile_shape <int> ...... tile shape (0=128, 1=256, 2=512, 3=wide, default = 4)` but there is no 4 <:thinkies:854271204411572236>
_wb_
2021-10-15 09:30:24
If Q is float for cjxl but integer for others, it's not really fair - there are only like 20 different settings of integers while each float is likely different
Lastrosade
2021-10-15 09:30:49
You lost me there
_wb_
2021-10-15 09:31:18
There are a lot of floats between 70.0 and 85.0
2021-10-15 09:31:37
There are only 16 integers between 70 and 85
Lastrosade
2021-10-15 09:32:00
But the distance should still be the same right? relatively speaking
2021-10-15 09:32:15
These values still somewhat seat between 1 and 100
_wb_
2021-10-15 09:32:26
More different settings means more opportunities for generation loss and less opportunities for getting stuck in a fixed point
Lastrosade
2021-10-15 09:32:53
So should I keep it to one single Q ?
_wb_
2021-10-15 09:32:57
E.g. most codecs will reach some fixed point if you only use a single Q
2021-10-15 09:33:15
No, not a single, just same number of different settings per codec would be fair
Lastrosade
2021-10-15 09:36:32
You lost me again, what different settings?
Hello71
2021-10-15 09:41:13
i think <@!794205442175402004> is trying to say that 100x cjxl -q rand(70.0, 85.0) vs 100x cjpeg -q rand(70, 85) is not fair
Lastrosade
Hello71 i think <@!794205442175402004> is trying to say that 100x cjxl -q rand(70.0, 85.0) vs 100x cjpeg -q rand(70, 85) is not fair
2021-10-15 09:42:17
But I'm not sure I understand why
190n
2021-10-15 09:43:21
the other codecs only have 16 different Q levels within that range while cjxl has a huge number
Lastrosade
2021-10-15 09:44:21
I got that part, but 87/100 still 87/100 whether its a float or an int
Hello71
2021-10-15 09:45:00
basically you shouldn't give cjxl 70.5 or 71.5 or 72.5 or whatever. it should only be integers between 70 and 85
Lastrosade
2021-10-15 09:45:19
They are integers
Hello71
2021-10-15 09:45:35
normally the definition of rand(70.0, 85.0) is that it may return 70.0, 70.1, 70.2, etc
Lastrosade
2021-10-15 09:45:49
The Q is at the top left of the videos
2021-10-15 09:45:57
I only give integers
190n
2021-10-15 09:46:09
with cjxl there are more unique ways that the image can be encoded so there are more opportunities for variation to be introduced
Lastrosade I only give integers
2021-10-15 09:46:32
oh lol
Lastrosade
2021-10-15 09:46:43
I'm so confused
Fraetor
Lastrosade I only give integers
2021-10-15 09:46:48
that probably makes it pretty fair.
Lastrosade
2021-10-15 09:46:57
You guys though I gave floats
2021-10-15 09:47:07
the variable $Q is a random int
190n
2021-10-15 09:50:46
well you hadn't told us $Q was an int
Fraetor
2021-10-15 09:52:06
I guess it could be inferred from the same variable being used for the other encoders.
Lastrosade
2021-10-15 09:56:07
the whole script
2021-10-15 09:57:25
to get floats with get doubles you'd have to do `Get-Random -Minimum 0.0 -Maximum 100.0`
veluca
2021-10-15 10:00:30
tbf most codecs will just treat `1.1` as a fancy way of writing `1` ๐Ÿ˜›
2021-10-15 10:00:52
and also I guess we're not super familiar with PowerShell here... or at least Jon isn't
Lastrosade
2021-10-15 10:01:14
Fair enough
_wb_
2021-10-16 05:46:10
I am 100% not familiar with PowerShell
2021-10-16 05:47:26
Ok so the float thing is not an issue - probably still fewer different settings for avif though
2021-10-16 05:49:21
Jxl does do quite badly - I wonder if it's because of filtering. What happens if you do the same but with --epf 0?
Lastrosade
2021-10-16 07:14:52
I'll try with that
2021-10-16 07:14:57
Generation 8150 of the run I started yesterday
2021-10-16 07:16:04
JXL is making art right there
_wb_
2021-10-16 07:16:11
Heh, quite interesting
2021-10-16 07:17:02
That's the B channel getting reduced to three values (blue, neutral, yellow)
Lastrosade
2021-10-16 07:18:04
ok same test but with epf=0
_wb_
2021-10-16 07:18:27
What happens with luma there is quite funky, I wonder to what extent my recent deadzone quantization changes would change that
Lastrosade
2021-10-16 08:47:54
With epf 0, at generation 970
monad
2021-10-16 08:49:12
It seems fair to say the prior claims about generation loss were not robust. ๐Ÿ˜•
_wb_
2021-10-16 08:58:34
Yeah, it definitely depends on settings
2021-10-16 08:59:14
Maybe try epf 0 gaborish 0? I expect gaborish to also cause some generation loss
Lastrosade
2021-10-16 08:59:24
_wb_
2021-10-16 08:59:52
Also decoding to 16-bit png might help
2021-10-16 09:00:08
The quantization to 8-bit is quite lossy
Lastrosade
2021-10-16 09:00:23
I think I'll build a pregenerated table of Q values to make the testing comparable between runs
_wb_
2021-10-16 09:00:31
djxl --bits_per_sample 16 iirc
Lastrosade
2021-10-16 09:01:01
The source is 4:2:2 8 bit
_wb_
2021-10-16 09:03:39
Yes, but color transforms back and forth between rgb8 and xyb are not great (and not what would happen in practice if you would e.g. do repeated encodes with default imagemagick without the intermediate 8-bit png files)
2021-10-16 09:05:30
I'm curious if these changes: https://github.com/libjxl/libjxl/pull/691 would improve the situation. I think some of those dct base pattern artifacts might improve
Lastrosade
2021-10-16 09:16:51
--bits_per_sample doesn't work, I can't find the right flag
2021-10-16 09:18:28
There's --override_bitdepth ?
_wb_
2021-10-16 09:19:05
I mean in djxl
2021-10-16 09:19:42
djxl internally reconstructs the pixels as 32-bit floats, and can then save them at any bit depth
Lastrosade
2021-10-16 09:19:51
Ohhh ok
_wb_
2021-10-16 09:20:08
By default it does 8-bit if the original was 8-bit, mostly to avoid saving large png files
2021-10-16 09:21:11
But saving as 16-bit png would be closer to the actual decode result, and it would be what you get if you would do `convert foo.jxl -quality bla bar.jxl` with a default imagemagick
Lastrosade
2021-10-16 09:37:52
Gaborish seems to do it
_wb_
2021-10-16 09:40:42
Makes sense, encoder does an approximation of the inverse of what the decoder will do, so I can see how that would accumulate error over generations
2021-10-16 09:41:33
Maybe we should have a cjxl flag --avoid_generation_loss that avoids using stuff that are likely to cause generation loss
2021-10-16 09:42:01
Gaborish is off by default at high fidelity settings iirc
Lastrosade
2021-10-16 09:42:27
So when using -d instead of -q ?
_wb_
2021-10-16 09:48:00
-d or -q doesn't make a difference, -q is just a convenience flag that gets translated to -d
Lastrosade
2021-10-16 09:48:11
oh
2021-10-16 09:48:56
I thought -d was translated to -q with extra sparkly stuff going on
_wb_
2021-10-16 09:52:45
Nah, -q 90 and -d 1 is the same thing
Lastrosade
2021-10-16 09:52:51
OH
2021-10-16 09:53:13
That kills some of the magic of it kekw
monad
2021-10-16 09:59:12
The magic is, you can specify -m and get lossy modular.
_wb_
2021-10-16 10:00:13
Ah, that would also be interesting to test with generation loss
2021-10-16 10:01:49
Btw thanks for doing this, <@132637059327328256>, it's interesting to see what happens and how different settings affect things
monad
2021-10-16 10:02:03
I doubt it would be a practical test though, as your typical image hosting service would likely default to VarDCT.
_wb_
Lastrosade Gaborish seems to do it
2021-10-16 10:02:21
Are you making a video of this one?
Lastrosade
2021-10-16 10:02:26
I am
2021-10-16 10:02:44
Now I'm curious about -m
_wb_
monad I doubt it would be a practical test though, as your typical image hosting service would likely default to VarDCT.
2021-10-16 10:03:16
Yeah, not for memes and stuff, but maybe if it works better it might be useful for authoring workflows - no idea if it does though
monad
2021-10-16 10:04:13
I wonder if there are authoring workflows where lossless is impractical.
_wb_
2021-10-16 10:27:29
Maybe when it's not just local
Lastrosade
2021-10-16 03:00:34
Here it is
fab
Lastrosade Here it is
2021-10-16 03:08:17
is it with the new ac deadzone
2021-10-16 03:08:25
all of them
veluca
_wb_ Gaborish is off by default at high fidelity settings iirc
2021-10-16 03:45:44
No gaborish is never disabled
2021-10-16 03:45:56
We could do exact gaborish though (or more exact)
eddie.zato
2021-10-16 03:46:27
Yeah, this is a funny result. 900 generations with default settings and `--gaborish=0`, `-d` random between 0.80 and 1.20
spider-mario
monad I wonder if there are authoring workflows where lossless is impractical.
2021-10-16 03:49:59
video editing is commonly done with lower-resolution โ€œproxiesโ€: https://opensource.com/life/16/1/offline-editing-kdenlive
2021-10-16 03:50:10
(but then the final result is rendered using the original footage)
BlueSwordM
monad I wonder if there are authoring workflows where lossless is impractical.
2021-10-16 04:47:58
Usually, they're just done with all-intra coding using a codec like ProRes or whatever proprietary standard is most popular.
monad
2021-10-16 08:18:30
Yes, I meant in the context of still images.
_wb_
2021-10-16 08:42:06
Well currently people exchange PSD/PSB files that can be several gigabytes large
2021-10-16 08:43:05
Near-lossless versions of that, generation loss resilient, would possibly be nice
Lastrosade Here it is
2021-10-16 08:44:52
Doesn't look like lossy modular is very resilient to generation loss though (maybe at higher Q and staying in rgb instead of converting to xyb it might be better, or if only a fixed Q setting is used)
monad
veluca No gaborish is never disabled
2021-10-16 09:42:25
Except it's disabled at effort lower than 5, right? which is part of the reason for different behavior here: https://discord.com/channels/794206087879852103/803645746661425173/898677423279849504
eddie.zato
2021-10-17 10:23:06
`-d` random between 0.80 and 1.20
_wb_
2021-10-17 10:56:10
Does -c 1 even work in VarDCT? Didn't know that
veluca
2021-10-17 01:53:15
I doubt it does anything sensible
eddie.zato
2021-10-18 07:05:35
One more time, `-q` is random between 90.0 and 99.0
2021-10-18 07:05:47
2021-10-18 07:06:05
I think for now using `--gaborish=0` is a necessary choice for the case where multiple jxl-jxl reencoding is assumed.
_wb_
2021-10-18 07:18:49
I wonder if doing the inverse gaborish more accurately encode-side would fix it (or if the real issue is the cross-block error propagation that gaborish enables)
improver
2021-10-18 08:24:23
it looks p cool tbh
monad
2021-10-20 09:46:18
<https://docs.google.com/spreadsheets/d/1Zzm_Kh7EO9t8dHUSwqamg8UWaGY-A2S5y4uz7I_kdfw> Is this a fair comparison? or does the file size disclaimer prevent a valid choice in codec based on the metrics? Is the color formatting too misleading, or is it helpful? Any other criticisms or suggestions for improvement are welcome.
improver
2021-10-20 09:49:26
is resize 75% enough?
monad
2021-10-20 09:50:31
That's one of my questions too. The JPEGs were likely quality 99/100, so I thought it should be enough.
2021-10-20 09:52:06
I wanted to retain as much of the original complexity as possible in the comparison.
improver
2021-10-20 09:52:10
id probably use 50% just because cleaner 4 pixels to one mapping
2021-10-20 09:52:20
but not telling everyone to do that
veluca
2021-10-20 10:01:06
butteraugli *really* doesn't like 420, I doubt webp is ever going to win any butteraugli comparison ๐Ÿ˜›
2021-10-20 10:01:12
but yes I'd also rescale 50%
monad
2021-10-20 10:11:38
Okay, I'll redo at 50% if it isn't otherwise totally flawed.
Deleted User
2021-12-21 12:22:58
--- short fjxl test --- 1 large RGB image (num_reps=50): enc: 194.2 MP/s dec: 24.56 MP/s 1 large RGBA image (num_reps=50): enc: 251.3 MP/s dec: 28.71 MP/s So roughly speaking, encoding an image takes now 12% the time it takes to decode it.
veluca
2021-12-21 12:43:02
heh not quite surprised
2021-12-21 12:43:32
the decoder for modular (and especially lossless modular) is not nearly as optimized as it could be
Deleted User
2021-12-21 01:26:07
Which priority does this optimization have?
veluca
2021-12-21 01:55:19
"not high enough"
2021-12-21 01:55:56
more accurately, doing it without creating an unmaintainable mess is gated behind a few other things I'm working on
Scope
2021-12-22 11:59:35
https://twitter.com/richgel999/status/1473385085789679616
2021-12-22 11:59:48
https://twitter.com/sanityenvoy/status/1473461807524491267
2021-12-22 12:01:15
https://i.ibb.co/XYRHrcS/kodim34.png
Cool Doggo
2021-12-22 12:14:25
I'm surprised avif does better than webp in that case, every time ive tried it was *very* inefficient for lossless
Fox Wizard
2021-12-22 12:57:29
Gotta post that jxl that destroyed the avif file that "shines" <:KekDog:884736660376535040>
2021-12-22 01:02:09
Think that avif file could be 2.187 bytes or smaller if someone with actual knowledge about the format compresses it
Deleted User
2021-12-22 01:02:55
fjxl is 22,221 bytes
Fox Wizard
2021-12-22 01:03:42
Lol, webp resulted in a smaller file for me than avif... 1032 bytes
Deleted User
fjxl is 22,221 bytes
2021-12-22 01:04:41
@1950 MP/s
Fox Wizard
2021-12-22 01:04:59
<a:FurretSpeed:832307660035850310>
2021-12-22 01:05:19
It feels very strange to see jxl files decode instantly <:KekDog:884736660376535040>
Deleted User
2021-12-22 01:07:10
decode is still only 37 MP/s for me.
Fox Wizard
2021-12-22 01:07:15
Kinda wonder how they got these results: "WEBP: 46 740 bytes JPEG XL: 41 169 bytes"
2021-12-22 01:07:53
Sadge, when I opened a fast encoded image that was sent here I couldn't even see it load... which is very unusual and even used Chrome to open it
Deleted User
2021-12-22 01:08:59
Maybe is was just small or a PNG preview. <:kekw:808717074305122316>
Scope
2021-12-22 01:09:24
I think because it's an online converter with unknown default settings
Fox Wizard
2021-12-22 01:09:40
I guess, but the difference seems to be... extreme
2021-12-22 01:09:47
For me webp was way smaller than avif
2021-12-22 01:10:35
46.740 bytes vs 1.032 bytes (their webp, my webp)
Scope
2021-12-22 01:11:08
AVIF shines when using avif.io
Cool Doggo
2021-12-22 01:11:43
does avif.io even have a lossless option?
Fox Wizard
2021-12-22 01:11:50
Yes
Deleted User
2021-12-22 01:13:20
wait, he said those are non-alpha versions of the original?
Fox Wizard
2021-12-22 01:14:17
Hm, 24 bit, so seems like it...
2021-12-22 01:14:38
Wonder if he meant 32, since removing transparency isn't really proper testing tbh
veluca
2021-12-22 01:17:23
so fjxl uses just a color transform and RLE, no ctx modeling (... for now ...), and that's a lot faster to decode than your typical lossless JXL file
Deleted User
2021-12-22 01:21:58
ah ok, Scope's JXL decodes at 3.5 MP/s so 37 should pretty much feel like lightspeed.
Fox Wizard
2021-12-22 01:23:07
I'm used to ``-e 9 -q 100 -I 1 -E 3 -g 3``, so guess a lot feels fast to me <:KekDog:884736660376535040>
2021-12-22 01:23:30
~~Also used to waiting for 10b cpu0 AV1 encodes <:KekDog:884736660376535040>~~
veluca
2021-12-22 01:23:38
yeah with those settings it takes *a while* to decode
2021-12-22 01:23:52
also to encode
@1950 MP/s
2021-12-22 01:24:22
that's with multithreading, right?
Fox Wizard
2021-12-22 01:24:23
Tbh, feels very fast for me, because... AV1 encoding, so have had cases where I waited for hours... days or even up to 2 weeks for test/meme encodes <:KekDog:884736660376535040>
Deleted User
veluca that's with multithreading, right?
2021-12-22 01:29:30
I don't think so or is this done automatically?
veluca
2021-12-22 01:29:42
it is
2021-12-22 01:30:05
... at least on Linux
2021-12-22 01:30:25
it's https://i.ibb.co/XYRHrcS/kodim34.png right?
2021-12-22 01:31:46
yup, I get 700-800 MP/s single thread on my laptop and 3557.614 MP/s with 8
2021-12-22 01:31:53
... curious about my desktop now...
2021-12-22 01:33:51
heh, ~1GP/s 1 thread, ~9GP/s 32 threads
2021-12-22 01:33:53
not bad
_wb_
2021-12-22 01:38:50
I assume YCoCg is a particularly good idea on that image
2021-12-22 01:39:10
and clamped gradient works particularly well on it
2021-12-22 01:39:28
so you get exceptionally many RLE cases
2021-12-22 02:13:36
on my laptop, the fast-jxl file decodes at 65 MP/s while the e9E3 one decodes at 6.8 MP/s
2021-12-22 02:15:17
both could probably be sped up quite a bit with more special casing in the decoder, but you can clearly see the difference already between no-tree RLE-heavy decoding and the general case of an arbitrary tree
Scope
2021-12-22 02:15:27
~2GP/s FPNG https://twitter.com/richgel999/status/1473392160053551107
fab
Scope ~2GP/s FPNG https://twitter.com/richgel999/status/1473392160053551107
2021-12-22 02:15:58
No Copy paste
Scope
2021-12-22 02:17:40
https://i.ibb.co/RCDwxZs/kodim54.png
2021-12-22 02:20:44
2021-12-22 02:21:18
Deleted User
2021-12-22 02:33:22
Damn, pretty sad if people's laptops are faster than your desktop CPU. ^^
_wb_
2021-12-22 02:57:05
`-m -e 9 -g 3 --palette 0` is 40 bytes ๐Ÿ˜‰
Deleted User
2021-12-23 07:42:10
<@!179701849576833024> fjxl doesn't optimize pixels with fully transparent alpha.
veluca
2021-12-23 07:50:44
yup, true
2021-12-23 07:51:03
I *could* just zero them out
_wb_
2021-12-23 08:25:04
Opinions are divided on whether that is lossless or not
2021-12-23 08:29:15
It depends on whether you view alpha as a mask (that you may want to modify later, making invisible pixels visible again), or as a part of the description of the visual behavior of the pixel (so invisible pixels have irrelevant RGB values)
2021-12-23 08:30:19
Both views have use cases
Deleted User
2021-12-23 08:50:10
an option for that would still be nice though ๐Ÿ˜„
_wb_
2021-12-23 09:02:52
Yes, should be cheap enough to do that while deinterleaving
2021-12-23 09:07:02
Could also detect some special cases like whole group transparent and whole group opaque; if that can be detected without noticeable overhead, it can be special-cased and in the first case you can skip the whole group (just dump one long rle) and in the second you can skip the alpha channel
2021-12-23 09:09:21
Doing `all_opaque &= alpha; all_invisible |= alpha;` should be cheap enough, right <@179701849576833024> ?
2021-12-23 09:11:46
And maybe `not_grayscale |= Yo & Yg`
veluca
2021-12-23 09:14:18
Yep, cheap enough
_wb_
2021-12-23 09:14:22
At the group level, such special cases might occur often enough to make it worth it, speed-wise
veluca
2021-12-23 09:15:01
As for detecting all opaque or all gray-scale... I don't think it would work
_wb_
2021-12-23 09:15:28
Why not?
2021-12-23 09:28:54
Ah because you encode rows while deinterleaving
2021-12-23 09:31:01
Probably a quick scan over the rgba of the group to check grayscale / all opaque / all invisible cases wouldn't be too bad? Before any ycocg is done
2021-12-23 09:34:59
If you're lucky and you have an all-opaque grayscale group (which I suspect does happen quite often in screenshots, and bw photography is also a thing), you can have a special case where only 1 channel needs to be actually encoded (you can just take the red values, no need to do actual ycocg either)
2021-12-23 09:37:09
`not_grayscale |= (red ^ green) & (green ^ blue) & (red ^ blue)` or something like that
Fraetor
2021-12-23 10:02:50
Are channels encoded completely independently in <:JXL:805850130203934781>, or are they compressed together? I would imagine that there would be a strong relation between the channels in most images.
veluca
2021-12-23 10:40:22
ycocg is a color transform that is exactly meant to exploit that correlation
2021-12-23 10:43:58
tbh, RLEing residuals of an all-0 channel is not that much slower than detecting gray / alpha - I strongly suspect that scanning the group will end up being slower, but I might be proven wrong
_wb_
2021-12-23 10:59:13
It might also be worth exploiting that Y and A are 8-bit, maybe?
2021-12-23 11:13:55
I suppose scanning for gray / all invisible can be worth it if it happens enough in practice; you can also skip ycocg and clampedgradient in those cases so I would expect it to be faster if it can be done โ€” but of course the scan is wasted if it only leads to the general case...
veluca
2021-12-23 11:48:32
so I fiddled a bit with fjxl's huffman tables, and I got ~3% better density on the QOI test set at same speed
2021-12-23 11:48:51
next step: trying to adapt those tables per-image...
Scope
2021-12-24 07:54:21
Hmm, but these changes are somehow worse for Emoji, Fractals, GameSets, Manga and PixelArt sets, but better for all others
veluca
2021-12-24 08:43:57
makes sense, it's a bit more skewed towards photo content
2021-12-24 08:44:49
but with per-image tables, I think I can default to non-photo huffman and correct it for photo, since they're usually bigger
Scope
2021-12-24 08:56:02
Also, what improvements can context modeling bring?
_wb_
2021-12-24 09:13:07
It would get things closer to -e 2
2021-12-24 09:13:40
Or rather -e 2 plus rle
Scope
2021-12-24 09:17:42
Hmm, that's pretty cool if it doesn't get much slower (because even -e 1 is often noticeably better)
veluca
2021-12-24 09:31:46
I think it shouldn't be slower
2021-12-24 09:31:52
but I won't know till I try
Scope
2021-12-24 11:30:48
And -e 3 is efficient for a photo because of the special predictor?
veluca
2021-12-24 11:47:58
yup
_wb_
2021-12-24 12:52:20
I suppose you could make a huffman version of e3 that would be faster (but WP instead of ClampedGradient is going to be quite a lot slower, especially since it cannot be vectorized)
veluca
veluca next step: trying to adapt those tables per-image...
2021-12-24 01:22:59
another 4% ๐Ÿ˜„
Scope Hmm, but these changes are somehow worse for Emoji, Fractals, GameSets, Manga and PixelArt sets, but better for all others
2021-12-24 01:23:27
btw now those sets should be significantly better (I think)
Scope
2021-12-24 01:57:39
It is strange, but Emoji set is worse, 186 MB - first build, 189 MB - previous build, 191 MB - current build
2021-12-24 02:02:43
But, in other sets there is a noticeable improvement, sometimes better than `-e 1`
veluca
2021-12-24 02:10:32
emojis are tiny, right?
2021-12-24 02:10:58
in general the last one should be better for things bigger than 272x16
2021-12-24 02:11:56
ideally once I'm done with everything else I'll get a big corpus (from you? ;)) of smaller images and use them to tweak the histogram for small imgs
Scope
2021-12-24 02:13:05
Yes, Emojis is something like 32x32 and 128x128 or less if the images are not square
veluca
2021-12-24 02:29:27
that explains it
2021-12-24 02:30:28
if you can collect those small images in a zip file or something I can tweak things for them later ๐Ÿ™‚
Scope
2021-12-24 02:45:39
Yes, I uploaded all the sets from the comparison Perhaps the tweaks on all the other sets would also be useful, together with the QOI set, or could it make things worse? <@!179701849576833024> <https://drive.google.com/drive/u/2/folders/1X_F_vhNwJFhPWSW3EeSa-gGhhikkOoYd>
veluca
2021-12-24 02:50:38
probably not
2021-12-24 02:50:53
there's not a lot to tweak on larger images
2021-12-24 02:51:23
(I use statistics from a random sample of the image for those)
Scope
2021-12-24 02:53:50
Mostly Pixel Art images don't compress well, but that's probably because they need to use some other method that's more efficient for that content
veluca
2021-12-24 03:19:01
yeah gradient predictor probably not helping that much there
_wb_
2021-12-24 03:54:51
Pixel art that is NN upsampled limited-color stuff probably would benefit from Palette and the Select predictor
2021-12-24 03:56:03
Detecting local palette cases might be useful - if it can be done efficiently
2021-12-24 03:56:37
Say cases where the group has no more than 16 different rgba colors, or something like that
2021-12-24 03:57:20
(and more than 1)
2021-12-24 03:58:32
Cannot detect without an extra pass though
2021-12-24 03:59:44
Unless you cheat and use the png metadata as info
2021-12-24 04:01:33
Trying other predictors than clampedgradient might be doable - again doing a random sample to try others to see if they are better
Scope
2021-12-24 04:01:41
WebP, even with `-z 0`, compresses Pixel art quite well Also, is the gradient predictor used because it's reasonably optimal in efficiency and fast?
_wb_
2021-12-24 04:02:09
Gradient is the best general-purpose predictor in my experience
2021-12-24 04:02:29
WP is better for photo but it is a lot more complicated
2021-12-24 04:03:01
Select can be better for nonphoto
2021-12-24 04:04:08
I dunno what webp does but it probably does the extra scan to check palette
2021-12-24 04:04:58
(note: it's not a full scan in case there are more than 256 colors, so it's not _that_ expensive)
Scope
2021-12-24 04:05:03
Also, is it possible to auto-model or train some kind of optimal fixed predictor on a large amount of content, like training neural networks, or is that useless/impossible?
_wb_
2021-12-24 04:08:27
It's in principle possible to do basically -e9 on a large corpus, record all the trees (including distributions), and somehow average them into a fixed ctx model with fixed huffman codes that can be encoded quickly
Scope
2021-12-24 04:10:55
Although it may be faster and more efficient to switch between the few that are best for certain content ๐Ÿค”
_wb_
2021-12-24 04:20:48
If you have a large enough corpus of images with similar characteristics, I imagine it could be possible to make something like a `cjxl -m -e 9 --dump_tree_data` that produces output that some tool can process and then you can do `fjxl2 --use_data` to do fast encodes that are somewhat tuned to the corpus characteristics
2021-12-24 04:21:25
That would be quite cool actually
Scope
2021-12-24 04:29:25
Hmm, yeah, especially since very fast encoding/decoding is usually needed for certain content images
Fraetor
2021-12-24 04:30:50
Would something like fjxl have a place in high speed cameras and such?
Scope
2021-12-24 04:31:52
I think this is the lossy field
BlueSwordM
Fraetor Would something like fjxl have a place in high speed cameras and such?
2021-12-24 04:34:00
Ye, but dedicated HW like ASICs and DSPs would be more suited for that purpose.
Fraetor
2021-12-24 04:36:49
fair.
Scope
2021-12-24 04:39:55
A very fast and simple lossy JXL encoder would also be cool, but at the moment it is better not to waste resources on it and so far there is not much demand and hype for it, as for something like QOI
2021-12-24 04:45:06
Except maybe as some sort of Rust implementation, as an example of a JXL encoder, because many devs love Rust
2021-12-24 06:18:27
Hmm, a LZ4 QOI is a slightly more interesting ๐Ÿค”
2021-12-25 12:00:10
Deleted User
2021-12-25 12:06:54
Where is AVIF? I thought it's the best format in the universe!?
2021-12-25 12:07:59
Also, JXL 0 might be a bit misleading since -e 0 doesn't launch fjxl.
Scope
2021-12-25 12:10:34
Yep, it's simpler and it can be explained in the description later (and this is just a draft comparison, maybe I will remove or add some formats)
2021-12-25 12:19:32
Like QLIC2 is a speed-optimized equivalent of PIK or JXL `-e 3`, I also wanted to add GFWX, but it is not that good, especially on fast modes and very bad on non-photo content
2021-12-25 12:30:13
And also another fast codec, but: `ImageZero is not suited for "flat" (computer generated) graphics or grayscale images`
veluca
2021-12-25 01:58:09
interesting results ๐Ÿ˜„
2021-12-25 01:58:50
I'll probably have another version of fjxl ready soon, should be way more dense
Scope
Scope Yes, I uploaded all the sets from the comparison Perhaps the tweaks on all the other sets would also be useful, together with the QOI set, or could it make things worse? <@!179701849576833024> <https://drive.google.com/drive/u/2/folders/1X_F_vhNwJFhPWSW3EeSa-gGhhikkOoYd>
2021-12-25 02:03:44
^ I have updated the sets to more relevant ones
2021-12-25 03:14:13
There are interesting examples with a big difference, but on which QOI-LZ4 significantly improves the results (with very small speed loss) ``` FJXL - 443,089 QOI - 488,563 QOI-LZ4 - 75,950``` https://i.redd.it/5xx5ebs204f41.png
2021-12-25 03:14:29
Like, the speed difference is small between QOI and QOI-LZ4 `decode ms encode ms decode mpps encode mpps size kb rate`
2021-12-25 03:15:40
And many other similar images with flat solid areas and pixel art
Cool Doggo
Scope
2021-12-25 03:18:42
fast lossless is better than e1 on average? ๐Ÿค”
Scope
2021-12-25 03:20:31
On some sets, yes, but on average, no, a higher percentage is a larger size compared to LibPNG
Cool Doggo
2021-12-25 03:21:11
ah i thought it said -5.9% and -5.1%
Scope
2021-12-25 03:23:50
The main problems with large flat areas and transparency, as far as I noticed
Cool Doggo
2021-12-25 03:27:01
e3 does especially bad on pixel art <:woag:852007419474608208>
Scope
2021-12-25 03:29:10
Yeah, because this mode is purely for photos
2021-12-25 03:33:13
``` FJXL - 13,832 QOI - 33,761 QOI-LZ4 - 1,043``` https://de.catbox.moe/goyb5o.png
2021-12-25 03:40:21
``` FJXL - 448,136 QOI - 760,029 QOI-LZ4 - 6,502``` https://i.redd.it/w4qm60q2obh61.png
2021-12-25 04:58:20
_wb_
2021-12-25 05:20:31
I suspect that a big part of the pixel art compression depends on doing palette or not
2021-12-25 05:22:11
Detecting palette cases and doing fjxl on the index channel (with zero predictor instead of clampedgradient) would likely be overall faster for such images, and denser
Deleted User
_wb_ I suspect that a big part of the pixel art compression depends on doing palette or not
2021-12-25 08:22:23
Rescaling to 1/28th of the image size results in 1.044 Bytes. How much would signalling NN cost?
_wb_
2021-12-25 08:24:28
Upsampling can only be 2x, 4x or 8x
2021-12-25 08:25:10
Signaling cost would be a 150 bytes or so? Dunno have to check spec
2021-12-25 08:26:20
For manual encoding it could be worth doing, but I don't think the general encoder is ever going to check that the image happens to be NN upsampled and then use that trick
Deleted User
_wb_ Upsampling can only be 2x, 4x or 8x
2021-12-25 08:27:52
1/4th is at least just 17.613 Bytes.
_wb_ For manual encoding it could be worth doing, but I don't think the general encoder is ever going to check that the image happens to be NN upsampled and then use that trick
2021-12-25 08:30:45
Why not? Start checking the 8x8 pixels to the bottom left of the center for equality. On most images this will fail. Now check 4x4 or 2x2. Continue with the rest if one check succeeds.
_wb_
2021-12-25 08:42:57
Yes, I guess it could be done cheaply enough
2021-12-25 08:43:07
Is this common enough?
2021-12-25 08:43:43
Why do people not just use native resolution? In css you can say the browser has to use NN
Scope
2021-12-25 08:49:18
Sometimes it's game screenshots, sometimes it's just art style, although this kind of content is pretty well compressed by WebP even at the fastest speeds without resize (probably a bit worse than without it, but still)
_wb_
2021-12-25 08:52:05
With proper use of lz77 we could probably also compress it well without resize
Scope
2021-12-25 08:54:24
Also, just for the sake of interest, what special features does JXL have for such a fast encoder or, for example, can WebP's implementation be exactly the same (except for tiles/groups)?
Deleted User
_wb_ Why do people not just use native resolution? In css you can say the browser has to use NN
2021-12-25 09:06:10
Most places that allow for sharing of images don't support adding your own css. ;)
_wb_
2021-12-25 09:06:46
Fair enough
2021-12-25 09:08:07
WebP could probably also have fjxl style fast encoding - it wouldn't benefit from some of the advantages of jxl though so no idea where it would land in density
2021-12-25 09:08:55
YCoCg is something WebP doesn't quite have - it only has color transforms that keep everything 8-bit
2021-12-25 09:09:31
And WebP isn't planar but interleaved, so cannot exploit things like alpha runs or cocg runs as effectively
Scope
2021-12-25 09:13:21
So, fjxl does have its uniqueness ๐Ÿค”
Deleted User
2021-12-25 09:45:09
Nice tweak, fjxl converts RGB PNGs to RGB**A** JXLs so that the MP/s score will be 33% higher. :)
veluca
veluca I'll probably have another version of fjxl ready soon, should be way more dense
2021-12-25 09:54:42
so in the end it was just a 2.5% size decrease and I decided it wasn't worth the effort ๐Ÿ˜› I pushed some tweaks for emoji sets & the like (~0.5% decrease on the qoi test set) and I think I'll stop here
Deleted User
2021-12-25 10:38:36
I recorded a few lossless x264 seconds of just standing around in Dishonored. Big surprise, fjxl produces better compression (>20% denser) even for that content (when *not* using delta frames). The screen changes ever so slightly from frame to frame, thus x264 ultrafast only gains 10-15% compression strength by using P vs I frames. Both are not really feasible when considering storage limitations but still nice to see those results. Short screenshot bursts would be nice to do with fjxl or even screenshots in general so that games doesn't hang for one second while waiting for the PNG conversion.
Scope
veluca so in the end it was just a 2.5% size decrease and I decided it wasn't worth the effort ๐Ÿ˜› I pushed some tweaks for emoji sets & the like (~0.5% decrease on the qoi test set) and I think I'll stop here
2021-12-26 05:53:07
Is this without trying context modeling? Because something with a density close to `-e 2` at fast speeds would be cool and maybe that would be a candidate to replace `-e 1`, I don't think the extra `-e 0` is worth it, and also `-e 1` should match its name - lightning
2021-12-26 06:01:34
Hmm, yes, Emoji is better, the other sets so far are the same or slightly better
BlueSwordM
2021-12-26 06:25:21
`-e 0` is worth it.
2021-12-26 06:25:29
Just make it the instant transmission preset.
w
2021-12-26 06:30:33
where is fast djxl
Scope
2021-12-26 06:31:13
Perhaps there will also be here <https://github.com/libjxl/libjxl/pull/1032>
2021-12-26 06:32:33
Or maybe not, so that people use a full decoder
2021-12-26 06:56:03
But, having a fast limited decoder would also be cool, I don't think it would be dangerous to adopt and use the full format, since it is mostly needed for very specific uses and comparisons (for now, there is an encoder that can beat everyone, but not the decoder) And in the future, integrate fast encoder/decoder paths into libjxl
2021-12-26 07:02:24
`-e 1` can also be instant, but for those images on which fast-encoder works and use normal and slower encoding for all other cases where images do not fit the limits
w
I recorded a few lossless x264 seconds of just standing around in Dishonored. Big surprise, fjxl produces better compression (>20% denser) even for that content (when *not* using delta frames). The screen changes ever so slightly from frame to frame, thus x264 ultrafast only gains 10-15% compression strength by using P vs I frames. Both are not really feasible when considering storage limitations but still nice to see those results. Short screenshot bursts would be nice to do with fjxl or even screenshots in general so that games doesn't hang for one second while waiting for the PNG conversion.
2021-12-26 07:04:41
fjxl would be great if it can be as dense as lossless x264 faster and be as fast as ffv1
2021-12-26 07:07:09
as in i would definitely use it
Scope
2021-12-26 07:08:58
I think it is already faster and denser (at least not for the slowest x264 modes), but for individual frames, video formats have advantages in inter-frame compression
The_Decryptor
2021-12-26 09:25:03
There are times you don't want interframe compression (Like archival reasons), iirc that's the intended usecase for FFV1, A JXL "video stream" in MKV could be a nice replacement
w
2021-12-26 09:26:03
i want to know if delta encoding can beat the interframe compression of x264
_wb_
2021-12-26 09:45:11
Subtracting the previous frame should help, even without cropping
2021-12-26 09:45:45
Is there a format for uncompressed rgba video?
190n
2021-12-26 09:46:46
NUT container can hold it
_wb_
2021-12-26 10:00:54
That looks a bit complicated to deal with
2021-12-26 10:01:41
Something like PAM but with multiple frames would be nice
2021-12-26 10:02:17
Little-endian and with a simpler header
2021-12-26 10:04:21
4 bytes magic, uint32 width, uint32 height, uint16 nb_frames, uint16 fps, and then just 8-bit RGBA dumps of every frame
2021-12-26 10:06:12
That would be super easy to plug into fjxl and then with some extra lines of code it could subtract the previous frame and emit an animated jxl
Deleted User
w i want to know if delta encoding can beat the interframe compression of x264
2021-12-26 12:37:47
If we are talking about a simple translation where pixels stay exactly the same just at different position, then interframe x264 shines. Every other case like small dynamic noise on a static image or turning/moving in a 3D game don't really work for lossless interframes. So from my limited test recordings I would conclude: fjxl is faster than x264 ultrafast, especially for higher bitrates, fjxl wins at 3D game recordings when not using delta frames, fjxl wins at desktop (or 2D game) recordings with delta frames, except for 2D side scroller, x264 should win here but I haven't tested.
w
2021-12-26 12:38:27
my use case would be anime with noise
2021-12-26 12:41:02
it'd be a huge win if it can be < 13mb/s and be faster
w my use case would be anime with noise
2021-12-26 12:41:23
this is similar to the 3d game with slight movement case i think
Deleted User
2021-12-26 12:44:56
Is this anime you made yourself or where does one get lossless anime?
w
2021-12-26 12:45:17
filtering/encoding
Deleted User
2021-12-26 12:49:18
just keep in mind that playbck wouldn't be possible with the current JXL decoder.
_wb_ Is there a format for uncompressed rgba video?
2021-12-26 12:50:12
https://ffmpeg.org/ffmpeg-formats.html#rawvideo
w
2021-12-26 12:51:45
time to try to make a video encoder/decoder i guess
Scope
veluca so in the end it was just a 2.5% size decrease and I decided it wasn't worth the effort ๐Ÿ˜› I pushed some tweaks for emoji sets & the like (~0.5% decrease on the qoi test set) and I think I'll stop here
2021-12-27 11:56:19
So, is 2.5% a specific tuning that's not worth it because it makes the code less simple or is it some new methods and added context model? If the second, then why is `-e 2` noticeably better, because of ANS?
veluca
2021-12-27 11:57:09
it's ANS and a better ctx model ๐Ÿ™‚
2021-12-27 11:57:28
also better entropy coding in general
Scope
2021-12-27 11:59:07
Hmm, so adding some ctx model isn't worth it?
_wb_
2021-12-27 12:41:23
Perhaps it is, but it doesn't appear to be a very juicy low hanging fruit in terms of speed and implementation effort cost vs density gain.
Scope
2021-12-27 03:03:36
Yep, I meant without a noticeable speed loss, sad that some simple ways are not as efficient, except that there may be, as already mentioned, a separate mode for the palette images
_wb_
2021-12-27 03:29:26
Getting ready to leave on family holidays right now, but when kids are back in school I'll play a bit with palette
w
If we are talking about a simple translation where pixels stay exactly the same just at different position, then interframe x264 shines. Every other case like small dynamic noise on a static image or turning/moving in a 3D game don't really work for lossless interframes. So from my limited test recordings I would conclude: fjxl is faster than x264 ultrafast, especially for higher bitrates, fjxl wins at 3D game recordings when not using delta frames, fjxl wins at desktop (or 2D game) recordings with delta frames, except for 2D side scroller, x264 should win here but I haven't tested.
2021-12-28 03:08:03
im getting fjxl ~3x larger than x264 faster without delta frames fjxl ~2x larger than x264 faster with delta frames
Scope
2021-12-28 07:39:58
I think because video is usually YUV420 content
w
2021-12-28 07:40:23
for 444 8 bit i get those results
Scope
2021-12-28 07:53:00
I mean this content is not RGB originally and it is also not x264-RGB, btw, if having a 420 or 444 mode for fjxl, it is likely to be noticeably faster and more efficient, even for QOI there is a YUV420 variation (because most video sources are still YUV420) https://github.com/Chainfire/qoy
w
2021-12-28 09:21:52
well the fjxl is already yuv
2021-12-28 09:22:14
and i dont think doing 420 benefits from much in terms of efficiency for jxl
2021-12-28 09:22:41
and my results were for x264 yuv444p8 vs fjxl
_wb_
2021-12-28 09:43:35
You are giving yuv data to fjxl?
2021-12-28 09:44:04
Then it will apply ycocg to ycbcr data, which is... not a good idea
w
2021-12-28 09:44:29
it was better compression than converting it to rgb then ycocg
_wb_
2021-12-28 09:47:59
Can you hack the code to make it skip the ycocg conversion?
w
2021-12-28 09:48:17
yeah i just fed 3 separate yuv planes into here <https://github.com/veluca93/libjxl/blob/fast_ll/experimental/fast_lossless/fast_lossless.cc#L798>
_wb_
2021-12-28 09:48:25
Ok ๐Ÿ‘Œ
w
w and i dont think doing 420 benefits from much in terms of efficiency for jxl
2021-12-28 10:30:01
i want to test this for fjxl though
2021-12-28 10:30:15
where in ImageMetadata or the frame header does it say that an image is grayscale? (what bit(s))
veluca
w where in ImageMetadata or the frame header does it say that an image is grayscale? (what bit(s))
2021-12-28 11:11:58
I think it's around here: https://github.com/veluca93/libjxl/blob/fast_ll/experimental/fast_lossless/fast_lossless.cc#L350
2021-12-28 11:12:19
now, what's the serialized version of a grayscale ColorEncoding, that's a good question
Deleted User
w im getting fjxl ~3x larger than x264 faster without delta frames fjxl ~2x larger than x264 faster with delta frames
2021-12-28 12:12:18
Yes, x264 profits quite a bit when going from RGB to YUV and from ultrafast to faster.
w
2021-12-29 03:29:53
with 2 of the 3 planes being 1/4 the size, im getting ~2x smaller than x264, but i can't verify if it is valid as i cant figure out the header for grayscale
2021-12-29 03:29:57
``` output->Write(1, 0); // color_encoding.all_default (sRGB) output->Write(1, 0); // want_icc output->Write(2, 0b01); // color_space kGray output->Write(2, 0b01); // white point kD65 output->Write(2, 0b01); // primaries kSRGB output->Write(1, 0); // no gamma output->Write(6, 0b101011); // transfer kSRGB output->Write(2, 0b01); // kRelative``` close but not quite right
2021-12-29 03:32:03
is chroma subsampling a thing in jxl modular?
_wb_
2021-12-29 03:53:22
Only for frames that are YCbCr
2021-12-29 03:53:36
In RGB and XYB it does not exist
veluca
2021-12-30 12:10:38
<@!111445179587624960> how willing are you to add https://github.com/caoscott/SReC to your lossless compression benchmark?
Scope
2021-12-30 12:14:58
I've seen this encoder, but I need a Windows binary and it's also not clear how much compression depends on the trained data
2021-12-30 12:16:04
Like, it can be universal or only good if it is trained only on similar images
2021-12-30 12:25:14
Something like this might be good for pixel art, but the problem is that these are not just typical algorithms, they are more heavy neural networks that require trained model data
2021-12-30 12:41:59
veluca
2021-12-30 01:02:14
yeah hard for me to say how much you'd need to train it on specific models
2021-12-30 01:02:34
anyway it's python so running on windows shouldn't be hard
Scope
2021-12-30 01:09:47
Yes, but it needs various dependencies and also I don't have an NVIDIA GPU at the moment
veluca
2021-12-30 02:07:28
IIRC it does run on CPU, although it's a huge pain
diskorduser
Scope Yes, but it needs various dependencies and also I don't have an NVIDIA GPU at the moment
2021-12-31 05:55:37
try it on colab. may be. Oh cpu ๐Ÿ˜ฆ
Traneptora
_wb_ Is there a format for uncompressed rgba video?
2022-01-04 01:40:39
you can do it with y4m but it's "nonstandard"
w filtering/encoding
2022-01-04 01:41:16
intermediary, doesn't seem worth it
2022-01-04 01:41:25
since ffv1 is much faster than libjxl modular
w
2022-01-04 01:41:38
but if it can be faster
Traneptora
2022-01-04 01:41:52
if modular can be made faster (which I hear it can be) then sure
2022-01-04 01:42:01
VarDCT is very fast but I figure you're not interested in a lossy intermediary
2022-01-04 01:43:03
also, are you looking at signed delta, how do you plan on implementing that? lossless delta in libjxl I don't believe has a significant ratio improvement over lossless I-frames
w
2022-01-04 01:43:33
the fjxl used signed ycocg
Traneptora
2022-01-04 01:43:43
oh you're talking about JpegXL aminated
w
2022-01-04 01:43:56
well it doesnt even need to be a real format
Traneptora
2022-01-04 01:44:24
as a curiosity experiment I tried taking JpegXL vardct and subtracting the original, and then encoding the difference between the original and the quantized as lossless, so I could perfectly reconstruct the original with a lossy backdrop
2022-01-04 01:44:42
but I discovered that the lossless difference is almost always just, the same size as the original when there was grain
2022-01-04 01:45:18
I wonder if you consider it worth it
2022-01-04 01:45:39
it might actually be seriously worth looking at vardct with d=0.1 or something very low
2022-01-04 01:45:54
since it's *far* faster and it preserves grain at distances that low
w
2022-01-04 01:45:58
isnt vardct lossless possible
Traneptora
2022-01-04 01:46:01
No
2022-01-04 01:46:05
it's only lossy
2022-01-04 01:46:38
I've found that d=LOW is almost good enough though, like x264 crf=4
2022-01-04 01:46:54
it's not lossless, but you wouldn't be able to tell
2022-01-04 01:48:35
either way, once my patch for libjxl ffmpeg encoder gets merged this might get a lot easier to test
2022-01-04 01:48:40
since you'll be able to pipe into ffmpeg
w
2022-01-04 01:51:14
epic
Traneptora
2022-01-04 01:53:42
it's sitting on the ML but I think it's being delayed because they're scrambling about 5.0 release and didn't want it in there
w
2022-01-04 01:54:23
is 4.4 still a mess
Traneptora
2022-01-04 01:54:30
idk ยฏ\_(ใƒ„)_/ยฏ
2022-01-04 01:54:53
they're also waiting for me to add a fate test but I already did, just haven't sent that patch to the list yet. it's on my laptop I used on vacation which doesn't have my private key on it cause I forgot to put it there
_wb_
2022-01-04 06:14:57
https://twitter.com/_michaeldsmith_/status/1478414688325046275?t=m51r3p8qq1YSc7a0ld9M9g&s=19
Scope
2022-01-04 06:35:11
Yeah, as I said before it would be good to have some kind of benchmark utility or at least integrate different codecs into qoibench, because many people will compare total time combined with different PNG decoders
_wb_ https://twitter.com/_michaeldsmith_/status/1478414688325046275?t=m51r3p8qq1YSc7a0ld9M9g&s=19
2022-01-05 10:29:59
Also not quite clear what options were used for compression, was it default and `-qstep 0` (or with what option can I get lossless?) for OpenJPH? Because there are different options to improve compression, also the default compression is a bit lossy as I remember and it's strange that kakadu compressor is the same as OpenJPH, but much faster ๐Ÿค”
2022-01-05 10:31:34
And since the speed difference between JXL `-e 1` and FJXL is not that big, it is noticeable that PNG decoding takes significant time
_wb_
2022-01-05 10:38:32
Yes, the speed measurements are not very accurate
2022-01-05 10:39:49
I dunno about htj2k, but I think j2k only really has one way to do lossless (besides bitstream reorderings)
Scope
2022-01-05 10:41:01
``` -qstep (0.00001...0.5) quantization step size for lossy compression; quantization steps size for all subbands are derived from this value. {The default value for 8bit images is 0.0039}```
_wb_
2022-01-05 10:42:52
That value is just below 1/255, which is presumably enough to make it lossless?
Scope
2022-01-05 10:43:27
๐Ÿค” https://github.com/aous72/OpenJPH/issues/68
2022-01-05 10:43:47
```With this image, -qstep 0.03, the JPEG image and HTJ2K image look roughly the same. Values > 0.03 produces worst quality, and smaller values produces better quality. Qstep should be 0.5 or smaller, and for 8 bit images, it not useful to be smaller than 1/256 = 0.0039.```
2022-01-05 10:44:35
But, is it true lossless or not?
_wb_
2022-01-05 10:44:50
It can do true lossless, yes