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

on-topic

Whatever else

veluca
2022-06-25 09:41:52
yeah that's weird
2022-06-25 09:42:31
could just be the swapped channels though
2022-06-25 09:42:42
which messed with CfL
yurume
2022-06-25 09:42:48
in fact this is *after* correcting the swapped channel in DC ๐Ÿ˜‰
2022-06-25 09:43:07
otherwise all DC coefficients would have been off
2022-06-25 09:47:03
let me explain what the right (trace from jxsml, sorry I was confused ๐Ÿ™‚ actually means:
2022-06-25 09:48:01
this is a particular DCT8x8 varblock before and after the HF dequantization (but before CfL)
2022-06-25 09:48:42
jxsml did the LF dequantization much earlier and pasted resulting coefficients directly to the same place that HF coefficients are eventually decoded into
2022-06-25 09:49:18
the only divergence from the spec right now is that the LF dequantization factors for channel 0 and 1 are swapped
2022-06-25 09:50:54
on the left (libjxl) I've matched the format by printing the same thing before and after DequantBlock, where LF and HF coefficients in the former are combined manually
2022-06-25 09:54:24
for the apparent CfL, I realized that I can just print the state after CfL in jxsml and HF coefficients seem to totally match libjxl!
2022-06-25 09:55:00
so I guess channels are not exactly swapped but just factors are off?
2022-06-25 11:40:48
after some hours of headache, swapping LF channels worked and it turns out that CfL for LF and HF happen in different places; the apparently incorrect LF channel 2 was actually post-CfL.
2022-06-25 11:42:40
this is no longer false-colored, the general hue is now correct, but there are some strong block artifacts
2022-06-25 11:43:11
most likely bug(s) in IDCT
2022-06-26 01:31:47
fixed block artifacts, I somehow put 1/sqrt(2) in place of sqrt(2) (why????), now it's quite smooth
2022-06-26 01:34:21
remaining blocky artifacts disappear when I disable LF smoothing, so there's another place to find bugs
2022-06-26 02:01:15
great, LF smoothing bug was a rather simple one. after fixing an off-by-one error in PNG writer and the final linear-to-sRGB conversion, this is the first ever correct VarDCT image produced by jxsml!
2022-06-26 02:02:07
(sans epf)
veluca
2022-06-26 05:20:21
nice!
_wb_
2022-06-26 06:09:43
Very cool, now the two main things are done (vardct and modular) and there's only the optional coding tools left.
2022-06-26 06:10:09
(optional for an encoder I mean)
yurume
_wb_ Very cool, now the two main things are done (vardct and modular) and there's only the optional coding tools left.
2022-06-26 06:46:43
well not exactly done, for example I have this hot mess ๐Ÿ™‚
_wb_
2022-06-26 06:47:23
Partially done let's say :)
yurume
2022-06-26 06:59:09
I should also write all the issue I have been ignoring so far (I have taken notes though)
Jyrki Alakuijala
monad d1 targets near-visually-lossless at 1000 pixels viewing distance. At worst this should allow a slight difference only noticeable with a flip test.
2022-06-28 08:17:07
originally this was the goal, we have slipped from it a bit when focusing more on less embarrassing performance at d3 to d8 and on encoding speed -- I think we need to go back to optimizing d1 robustness at some later stage
Traneptora That said, lossless JXL is not particularly fast
2022-06-28 08:22:29
we have ideas on how to improve lossless decoding speed to similar levels of PNG and WebP lossless, we just haven't been able to prioritize implementing/exploring them -- we are focusing on the ABI/API (libjxl 1.0), security, bug fixing, progressive, and HDR
szabadka
2022-06-29 08:52:47
There were some changes in the main jxl decoder loop recently, and as a result there are some guarantees now for the return values of JxlDecoderReleaseInput, meaning that one can infer the file positions of certain codestream elements from it. I documented these here: https://github.com/libjxl/libjxl/pull/1546 Any suggestions for further improving the input handling are welcome.
_wb_
2022-06-29 09:30:35
<:This:805404376658739230> <@853026420792360980> <@886264098298413078>
Traneptora
2022-06-29 02:58:47
noice
yurume
2022-06-30 04:23:21
today in jxsml: implemented all the transforms except for Hornuss (which is not used in this particular example), and the result is this patchwork
2022-06-30 04:25:53
https://gist.github.com/lifthrasiir/137a3bf550f5a8408d4d9450d026101f#file-jxsml-c-L3999-L4119 featuring not yet verified "optimized" AFV4x4 implementation
2022-06-30 04:30:28
not very sure which transform(s) are at fault, probably larger ones are not working at all
_wb_
2022-06-30 04:35:47
These are nice for the <#805007255061790730> channel
yurume
_wb_ These are nice for the <#805007255061790730> channel
2022-06-30 04:40:29
posted (https://discord.com/channels/794206087879852103/805007255061790730/992107107342102689), the full image is about 20 MB in png so I had to downscale though
2022-07-01 08:20:50
today in jxsml: turned out that I've implemented initial transposition incorrectly in larger DCTs, here's a bit better patchwork
veluca
2022-07-01 10:49:12
oh not bad at all ๐Ÿ˜„
2022-07-01 10:49:31
it's not *too* hard to convince the encoder to skip emitting some blocks
2022-07-01 10:49:54
but it's also not hard to visualize the choices
2022-07-01 10:50:19
so figuring out which transforms are wrong shouldn't be *too* hard
yurume
2022-07-02 01:16:58
I do have some sort of map, but I think many transforms are _not_ entirely buggy so that I can't pinpoint particular transforms easily; the map for instance shows that at lest DCT8x16 and DCT16x8 have that sort of problem
2022-07-02 01:17:48
and my code organization is too crappy that I can't easily tell the code is correct or not, I should set up some naming convention to ease my verification first
2022-07-02 01:18:32
and I should play Satisfactory less lol (in case you haven't realized from my Discord profile)
improver
2022-07-02 01:21:09
i haven't been doing pmuch anything valuable lately it feels kinda good to be unproductive & weather is nice out too
joeybuddy96
2022-07-02 04:38:43
uhhh, the tutorials on caniuse, github, and jpegxl.info don't match up with how Edge Canary works on Windows 11. Been hunting for Local State, but it doesn't exist in the same location where it used to. Got it working with Chrome Canary and Firefox Nightly on Win11 at least.
2022-07-02 04:40:38
Maybe Msft is still salty about XR not being widely adopted, lol. XL isn't in the flags/experimental features page in Edge anymore.
_wb_
2022-07-02 05:07:09
It isn't? Wonder what happened there...
novomesk
2022-07-02 08:07:24
Someone requested JXL support at Samsung forum ( https://us.community.samsung.com/t5/Galaxy-S21/Saving-images-as-JPEG-XL/m-p/2305032 ). Many people don't know what JXL is yet.
JendaLinda
joeybuddy96 uhhh, the tutorials on caniuse, github, and jpegxl.info don't match up with how Edge Canary works on Windows 11. Been hunting for Local State, but it doesn't exist in the same location where it used to. Got it working with Chrome Canary and Firefox Nightly on Win11 at least.
2022-07-02 08:30:25
I don't remember the details, but in MS Edge, it was necessary to manually edit some config file and it had to be done from a different OS because otherwise Windows just reverted the file back. But I'm not using MS Edge anymore, it got very slow and laggy few versions ago.
diskorduser
2022-07-03 12:34:53
Time to spam miui forums.
fab
2022-07-03 12:57:01
No
diskorduser
2022-07-03 02:53:59
Don't you want jxl support in miui cam app?
32 Bit Link
2022-07-04 02:45:53
~~RAW or bust~~ <:BanHammer:805396864639565834>
diskorduser
2022-07-04 03:05:05
There is already an option for dng on many OEM camera apps.
Fraetor
2022-07-04 11:57:36
What does the [Emu128] option mean? I've just noticed it showing up recently.
2022-07-04 11:58:55
Ah, so its an compile target for non SSE CPU's then?
2022-07-04 11:59:35
Thanks.
Razor54672
2022-07-08 05:31:28
Yeah, I am using the S21 and thought of leaving it there in case someone from the team saw
2022-07-08 05:31:55
I hope it gets implemented soon enough, as I see no reason for delays
DZgas ะ–
2022-07-08 12:36:16
jpeg XL can use modular and vardct in one image? technical?
Fraetor
2022-07-08 12:44:40
With patches, yeah.
_wb_
2022-07-08 01:38:56
Or using layers
DZgas ะ–
2022-07-08 02:42:37
<:Thonk:805904896879493180>
yurume
2022-07-09 12:18:58
today in jxsml: before and after
2022-07-09 12:20:04
varblock boundary is artificially added; the main difference was to fix the natural order, which was incorrectly written as if C <= R due to the wrong reading and I forgot to fix it later
veluca
2022-07-09 12:37:08
ah nice progress
_wb_
2022-07-09 02:06:03
So now dct8x8, 8x16 and 16x8 work?
yurume
2022-07-09 06:09:29
DCT8x8 and above share the same code, so I should say the majority but not entirety of them work
2022-07-09 06:10:01
varblocks with red borders here are DCT16x16, which seems to be more fragile
2022-07-09 06:10:27
8x16 and 16x8 has become definitely more stable
ziemek.z
joeybuddy96 uhhh, the tutorials on caniuse, github, and jpegxl.info don't match up with how Edge Canary works on Windows 11. Been hunting for Local State, but it doesn't exist in the same location where it used to. Got it working with Chrome Canary and Firefox Nightly on Win11 at least.
2022-07-10 02:09:31
I wrote that GitHub tutorial, haven't looked into it for a while. Yeah, I've also had some problems enabling JXL in later editions of Edge, I couldn't find that flag either. Fortunately if you set it up in an older version, it also works in later ones. Just checked in my Edge 103, it works.
Razor54672
2022-07-14 03:20:09
Does ImageGlass support flicker test comparison of images?
2022-07-14 03:20:23
Or any other image viewer that supports JXL for that matter?
2022-07-14 03:20:51
It'd be really convenient because right now I just use tiling to do side-by-side comparisons
Eugene Vert
Razor54672 Or any other image viewer that supports JXL for that matter?
2022-07-14 03:30:04
qimgv has an option to keep zoom level when switching images (`lockZoom` shortcut in settings)
_wb_
Razor54672 Or any other image viewer that supports JXL for that matter?
2022-07-14 04:12:51
What I often end up doing is just opening two images in two browser tabs and switching rapidly between those with keyboard shortcuts.
spider-mario
Razor54672 Or any other image viewer that supports JXL for that matter?
2022-07-14 06:33:38
I believe the one that is in the libjxl codebase supports it
2022-07-14 06:34:25
build with `cmake -DJPEGXL_ENABLE_VIEWERS=ON` and then `tools/comparison_viewer/compare_images a.jxl b.jxl`
2022-07-14 06:35:05
(needs Qt5, and currently only ported to Windows and Linux, not macOS)
2022-07-14 06:36:49
it can optionally take a third image which will be shown in the middle (or with the up/down arrow key)
Jyrki Alakuijala
yurume 8x16 and 16x8 has become definitely more stable
2022-07-15 11:26:46
I don't use the 8x8 DCT blocks much, since there is no implicit low-frequency spatial interpolation there, and they induce blockiness -- in pik we had beautiful interpolation, but we removed that in jpeg xl when we added variable size dcts
2022-07-15 11:27:00
that's why there is a lot of 16x8s
2022-07-15 11:28:05
(I have some ideas on how to improve on that)
Traneptora
_wb_ What I often end up doing is just opening two images in two browser tabs and switching rapidly between those with keyboard shortcuts.
2022-07-15 05:49:29
https://thebombzen.com/Orange-Diff/
2022-07-15 05:49:49
this is a thing I wrote a bit ago to compare images
2022-07-15 05:49:57
you give it two URLs and it makes it easy with just mousing in and out
2022-07-15 05:55:44
it just puts it in the query string too
2022-07-15 05:55:44
https://thebombzen.com/Orange-Diff/?imagea=https%3A%2F%2F0x0.st%2FzokR.png&imageb=https%3A%2F%2F0x0.st%2Fo1Jy.jxl
yurume
2022-07-16 12:50:27
working on jxsml public interface, which was never a concern until now
veluca
2022-07-16 02:33:03
what made it a concern?
yurume
2022-07-16 02:46:25
ah, I meant that I never really thought about that, so the entire architecture was oblivious of the API
Fox Wizard
2022-07-18 07:04:42
<@179701849576833024>was it on purpose that the 2 newest cjxl versions on your artifacts thing don't work on their own anymore? :p
veluca
2022-07-18 07:05:20
I certainly didn't do it on purpose :P also it's a GitHub issue not mine, I just download the artefacts from there :P
Fox Wizard
2022-07-18 07:05:33
They now require jxl.dll and jxl_threads.dll
veluca
2022-07-18 07:05:54
Ah, yes
2022-07-18 07:06:10
It may make sense to link them statically on windows
Fox Wizard
2022-07-18 07:06:21
And the executable is like... 10% the size. Guess it's cjxl_ng and not cjxl
_wb_
2022-07-18 08:09:58
The total size should be smaller, I hope
The_Decryptor
2022-07-18 11:42:19
cjxl is now much smaller, but djxl isn't
2022-07-18 11:42:24
Like 600KB vs. 5MB
JendaLinda
2022-07-19 09:29:19
Interesting, I'm testing the fresh, new cjxl and I see this: JPEG XL encoder v0.7.0 66afb51 [SSE4,SSSE3,Emu128] Read 640x400 image, 4226 bytes, 452.2 MP/s Encoding [VarDCT, lossless, effort: 7], Compressed to 6717 bytes (0.210 bpp). 640 x 400, 1.64 MP/s [1.64, 1.64], 1 reps, 4 threads.
2022-07-19 09:30:12
Didn't know that VarDCT can do lossless. Looks like an oversight.
Traneptora
JendaLinda Didn't know that VarDCT can do lossless. Looks like an oversight.
2022-07-19 09:47:44
it can't, that's a bug
2022-07-19 09:48:02
how did you trigger it?
JendaLinda
2022-07-19 09:49:01
I've got a png file and encoded did using just -d 0
Traneptora
2022-07-19 09:49:49
cause if I run `cjxl -d 0 foo.png foo.jxl` it uses modular
2022-07-19 09:50:06
lemme update to master and try agin
JendaLinda
2022-07-19 09:50:37
I will try one more thing.
2022-07-19 09:53:52
I've tried another PNG and it's the same thing. The output is actually lossless though.
Traneptora
2022-07-19 09:54:04
like bit-exact lossless?
2022-07-19 09:54:06
interesting
2022-07-19 09:54:15
what happens if you run`jxlinfo` on the file?
The_Decryptor
2022-07-19 09:56:08
https://github.com/libjxl/libjxl/blob/66afb51bb4f132f205ba16d236993ebf8fdba89f/tools/cjxl_main.cc#L488-L492 < It doesn't take distance into account
JendaLinda
2022-07-19 09:56:42
JPEG XL image, 3784x2664, (possibly) lossless, 8-bit RGB num_color_channels: 3 num_extra_channels: 0 have_preview: 0 have_animation: 0 Intrinsic dimensions: 3784x2664 Orientation: 1 (Normal) Color space: RGB, D65, sRGB primaries, sRGB transfer function, rendering intent: Perceptual
Traneptora
2022-07-19 09:58:49
It still has a discontinuity at quality=30...
2022-07-19 10:00:51
looks like it's just a bug in the printing
2022-07-19 10:09:39
<@688076786525143117> <@268637846355574786> https://github.com/libjxl/libjxl/issues/1627
yurume
2022-07-19 01:15:17
it's pretty annoying (not _difficult_) to make the existing source code even vaguely stream-aware
2022-07-19 01:17:04
so I don't want to make jxsml to be able to fully pause and resume, which will definitely make it much more complex
2022-07-19 01:17:31
but I do have to ensure that a partial reading doesn't cause a fatal error
2022-07-19 01:18:22
and so far jxsml has assumed that everything is in the (consecutive) memory
2022-07-19 01:18:45
so some hard error conditions now have to be soft, which doesn't fit well within the current architecture
veluca
yurume it's pretty annoying (not _difficult_) to make the existing source code even vaguely stream-aware
2022-07-19 01:20:16
*yes*
2022-07-19 01:20:59
it's one of the reasons why I really like coroutine-based control flow, it makes such things *almost* trivial
yurume
2022-07-19 01:21:04
time to take a look at libjxl to see how it did ๐Ÿ˜‰
2022-07-19 01:21:23
yeah, if coroutines are available that's generally a way to go, but sadly C doesn't have one
veluca
2022-07-19 01:21:47
in short: for headers it generally tells you "nope, too little data", "error" or "success"
2022-07-19 01:22:01
for most other things, it works on group-level granularity
2022-07-19 01:22:28
i.e. either you decode an entire new group, or you decode nothing
2022-07-19 01:22:45
the main exception is the ICC stream, which doesn't have a length, so it has some resuming logic
yurume
veluca in short: for headers it generally tells you "nope, too little data", "error" or "success"
2022-07-19 01:23:19
yeah, that looked like a good middle ground to me as well but there is some complication specifically in jxsml
2022-07-19 01:24:04
jxsml so far didn't distinguish (let's call) soft errors from hard errors, any non-zero `jxsml_err` terminates the decoding and propagates to the caller
2022-07-19 01:24:39
the "too little data" condition is now a soft error, so it looked like that the existing `shrt` (for "short") error can be repurposed for this
2022-07-19 01:25:05
and then I realized that I never guaranteed that jxsml error codes are distinct!
2022-07-19 01:25:58
I mean, the error string `"shrt"` *is* unique in the source code, but it gets translated to `jxsml_err` type and that can coincide with other error strings
2022-07-19 01:26:22
so that made me reconsider the whole error code system
2022-07-19 01:27:03
but I realized that, while describing all those problems, I can make the softness of the error code independent from the error code itself
yurume I mean, the error string `"shrt"` *is* unique in the source code, but it gets translated to `jxsml_err` type and that can coincide with other error strings
2022-07-19 01:28:37
I should note that this is a bit contrived concern, since this can't happen when `CHAR_BIT <= 8`
2022-07-19 01:29:13
and I like how the error code is rendered in the source code (almost every string literal is an error code, increasing the visibility)
veluca
2022-07-19 01:30:50
pretty sure standard C requires CHAR_BIT >= 8
yurume
2022-07-19 01:31:14
yeah, just in case though ๐Ÿ˜‰
2022-07-19 01:31:47
I even thought about translating all characters into ASCII in such cases
2022-07-19 01:32:05
```c #if CHAR_BIT <= 8 #define JXSML__1(c) (uint32_t) (c) #else #define JXSML__1(c) (uint32_t) ('0' <= (c) && (c) <= '9' ? (c) - '0' + 0x30 : \ (c) == 'a' ? 0x61 : (c) == 'b' ? 0x62 : (c) == 'c' ? 0x63 : (c) == 'd' ? 0x64 : \ (c) == 'e' ? 0x65 : (c) == 'f' ? 0x66 : (c) == 'g' ? 0x67 : (c) == 'h' ? 0x68 : \ (c) == 'i' ? 0x69 : (c) == 'j' ? 0x6a : (c) == 'k' ? 0x6b : (c) == 'l' ? 0x6c : \ (c) == 'm' ? 0x6d : (c) == 'n' ? 0x6e : (c) == 'o' ? 0x6f : (c) == 'p' ? 0x70 : \ (c) == 'q' ? 0x71 : (c) == 'r' ? 0x72 : (c) == 's' ? 0x73 : (c) == 't' ? 0x74 : \ (c) == 'u' ? 0x75 : (c) == 'v' ? 0x76 : (c) == 'w' ? 0x77 : (c) == 'x' ? 0x78 : \ (c) == 'y' ? 0x79 : (c) == 'z' ? 0x7a : (c) == '!' ? 0x21 : (c) == '?' ? 0x3f : 0) #endif #define JXSML__4(s) (jxsml_err) ((JXSML__1(s[0]) << 24) | (JXSML__1(s[1]) << 16) | (JXSML__1(s[2]) << 8) | JXSML__1(s[3])) ```
Traneptora
2022-07-19 06:05:04
I find the easiest way to do it is to have an encode thread that simply blocks if input is not available
2022-07-19 06:06:42
<@268284145820631040> `sizeof(char)` is by definition 1
2022-07-19 06:07:04
so provided that there's exactly 8 bits in a byte, then this macro is unnecessary
2022-07-19 06:07:36
I don't see any reason to attempt to run on hardware that doesn't follow that standard
yurume
2022-07-19 06:08:15
I thought that the code's intention to support `CHAR_BIT > 8` case is clear enough
Traneptora
2022-07-19 06:08:28
.... why?
2022-07-19 06:08:37
there's no hardware where there's more than 8 bits in a byte
yurume
2022-07-19 06:09:06
`CHAR_BIT` is a compiler contract, not necessarily an architecture contract
2022-07-19 06:09:43
so there _do_ exist some platforms where `CHAR_BIT` is larger than 8, regardless of architectures (and there also do exist some architectures where `CHAR_BIT > 8` is necessary, but they are much rarer)
2022-07-19 06:10:32
I know they are very rare and not practical to ensure the proper support, but given that the code is supposed to be a portable C code I don't see the reason to check about that kind of technicalities
2022-07-19 06:10:48
I will never actively test on those platforms though
Traneptora
2022-07-19 06:10:51
I don't see the point in supporting anything other than exactly 8 bits in a byte
2022-07-19 06:11:17
since you can't test on those weird scenarios, saying you support them has security implications
2022-07-19 06:11:28
it's better to refuse to support code you cannot test
2022-07-19 06:12:28
cause I can immediately see that you #define JXSML__4 with an 8-bit assumption
2022-07-19 06:12:57
`(JXSML__1(s[0]) << 24)` should probably say `(JXSML__1(s[0]) << (3 * CHAR_BIT))`
yurume
2022-07-19 06:12:58
you have a good point, though "support" can mean a multitude of things and it seemed like a low level of support is achievable without too much cost
Traneptora
2022-07-19 06:13:20
and I'm sure the code is riddled with that implicit assumption that `CHAR_BIT == 8`
yurume
2022-07-19 06:15:16
I thought I'm aware of all such assumptions (mostly bit readers), but I realized that I'm not sure about file handling on those platforms
2022-07-19 06:15:46
yeah, that alone is enough to revisit my position
Traneptora
2022-07-19 06:16:08
oh btw yurume, how buggy is the latest version of the spec?
2022-07-19 06:16:24
when it comes to VarDCT or Modular
2022-07-19 06:16:55
Lynne is busy so I might just write my own jxl decoder but I'm not really interested in doing so if the spec is still quite buggy
yurume
2022-07-19 06:17:39
I'm relatively certain that I've found most Modular bugs, but VarDCT implementation is still on the way and it will take a lot to check if the supposed "bug" is actually a bug or just my mistake
Traneptora
2022-07-19 06:17:52
hm
2022-07-19 06:18:18
in order to decode modular, I already have a working entropy decoder, I wonder how much extra needs to be done
yurume
2022-07-19 06:18:39
one quick way is to grep "spec" in the current jxsml code
Traneptora
2022-07-19 06:18:56
I mean I wonder how much extra needs to be implemented
yurume
2022-07-19 06:21:05
to decode Modular you will need entropy decoder (you've done this), MA tree parser and evaluator, predictor, and some transformation support (not all of them is required, you can for example skip Squeeze for now)
_wb_
2022-07-19 06:22:31
If you target fjxl output, you can skip squeeze and the weighted predictor, which are probably the two hairiest ingredients of modular...
yurume
2022-07-19 06:23:53
the approximate number of LoC in jxsml is as follows: entropy decoder takes ~800 LoC, predictor takes ~350 LoC, two out of three inverse transforms take ~250 LoC, and the remainder including MA tree parser and evaluator takes ~400 LoC
_wb_
2022-07-19 06:30:47
Those 350 lines for prediction is mostly the weighed predictor, no? The others are basically oneliners...
yurume
2022-07-19 06:32:09
ah, I have groupped them wrong, yes, 350 lines include predictor and MA tree evaluator and most of prediction is for wp.
2022-07-19 06:32:42
more accurately, predictor takes ~150 lines and evaluator takes ~200 lines
Jyrki Alakuijala
2022-07-19 07:26:56
wp was designed by Alexander Rhatushnyak
2022-07-19 07:28:28
Select (developed originally for webp lossless) and the last added predictor (developed for delta palette) were by me
Traneptora
Traneptora <@688076786525143117> <@268637846355574786> https://github.com/libjxl/libjxl/issues/1627
2022-07-20 07:48:00
update: https://github.com/libjxl/libjxl/pull/1637
2022-07-20 07:57:37
hm, that sounds like a solid amount to implement
yurume the approximate number of LoC in jxsml is as follows: entropy decoder takes ~800 LoC, predictor takes ~350 LoC, two out of three inverse transforms take ~250 LoC, and the remainder including MA tree parser and evaluator takes ~400 LoC
2022-07-20 07:58:28
how buggy is the spec with regard to this? I feel like I could always cross-reference jxsml to see what's wrong but I'd prefer to not have to do that
yurume
2022-07-20 07:59:11
weighted predictor is pretty buggy and I think you can't develop it without a reference to at least libjxl or jxsml
Traneptora
2022-07-20 07:59:40
hmmmm
2022-07-20 07:59:57
I wonder if there's a newer version of the spec that has most of your modular mode findings fixed
2022-07-20 08:00:22
jxsml is much more readable than libjxl so I referenced it when working on my entropy decoder
yurume
2022-07-20 08:01:18
(for Modular) I think there is no major bug besides from wp, if you already went through image headers, ICC and entropy decoder
Traneptora
2022-07-20 08:01:40
image header, frame header, ICC, and entropy decoders have been done, yea
2022-07-20 08:01:54
I'll have to work on the weighted preditor then
2022-07-20 08:02:06
or rather, have to cross-referece
2022-07-20 08:02:09
I'll probably do that one last then
_wb_
2022-07-21 06:15:30
I can make an updated spec draft with the WP fixed
yurume
2022-07-21 10:02:36
today in jxsml: writing a design document can help from time to time
fab
2022-07-21 11:46:48
What font is it
yurume
2022-07-21 12:46:56
Nanum Gothic Coding https://github.com/naver/nanumfont (because I need those fonts to have a proper Hangul support)
diskorduser
2022-07-21 03:15:24
g look weird on that font at small sizes.
yurume
2022-07-24 09:31:11
https://cbloomrants.blogspot.com/2015/09/library-writing-realizations.html
2022-07-24 09:38:37
this rings much true especially because I'm designing the very API of jxsml
2022-07-24 09:39:20
my current design should allow the following to work without any modification: ```c jxsml image; jxsml_from_file(&image, "path/to/image.jxl"); jxsml_frame *frame; while ((frame = jxsml_next_frame(&image))) { int32_t width, height, stride; uint8_t *ptr = jxsml_frame_u8(frame, JXSML_RGBA, &width, &height, &stride); // ptr[4 * (y * stride + x) + channel] is the pixel data } jxsml_free(&image); ```
2022-07-24 09:42:40
note the missing error check; every API call will check for the last error and would not continue, so there should be no frame returned by `jxsml_next_frame` at all if the file can't be read
2022-07-24 09:44:40
`jxsml_frame_u8/u16/f32` etc. accepts a channel argument which can be a "pseudo" channel like `JXSML_RGBA` (in which case the result will be an interleaved data)
2022-07-24 09:46:55
since `jxsml_frame_u8` etc. should not fail once you are given `jxsml_frame*`, I think it would need some sort of contortion like in-place conversion from separate channels to interleaved channels, but if that's possible I like this design a lot more than alternatives
2022-07-28 03:32:19
today in jxsml: provisional documentation (or rather, its table of contents)
Traneptora
2022-07-29 09:13:58
what actually *is* XYB
2022-07-29 09:14:32
I figure Y is xyY luminance but what about X and B
spider-mario
2022-07-29 10:32:45
Y is actually not the same as in XYZ/xyY
2022-07-29 10:36:55
if (r', g', b') = cbrt(opsin absorbance matrix ร— (r, g, b) + opsin absorbance bias) then X is (r' โˆ’ g')/2, Y is (r' + g')/2 and B is b'
2022-07-29 10:37:00
(if I got things right)
_wb_
2022-07-29 10:52:14
It's basically L-M,L+M,S with a cube root + bias transfer function
2022-07-29 10:53:00
Color blind people (protanopia or deuteranopia) can just drop the X and it will be fine
diskorduser
2022-08-01 02:11:02
https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html#:~:text=This%20is%20currently%20supported%20for,scaling%20down%20the%20main%20image. Does anyone know any alternative or fork which support jxl?
2022-08-01 03:02:51
nvm. found one. https://github.com/olokelo/jxlpy
Silikone
_wb_ It's basically L-M,L+M,S with a cube root + bias transfer function
2022-08-01 04:11:06
LMS was meant to address the non-constant luminance of YCbCr, right?
2022-08-01 04:11:59
But then what is YcCbcCrc that I have also seen references to?
2022-08-01 04:13:18
Or am I confusing it with ICtCp?
_wb_
2022-08-01 06:00:07
LMS models the response of the three types of cone cells
2022-08-01 06:06:12
Then what transfer curve to apply is another thing
Traneptora
spider-mario if (r', g', b') = cbrt(opsin absorbance matrix ร— (r, g, b) + opsin absorbance bias) then X is (r' โˆ’ g')/2, Y is (r' + g')/2 and B is b'
2022-08-03 01:21:17
`(r', g', b') = cbrt(opsin absorbance matrix ร— (r, g, b) + opsin absorbance bias)` so so if you have an `(r, g, b)` vector you take an affine transformation on it, and then cube-root it component-wise to get `(r', g', b')` but what color space is the initial rgb vector in?
yurume
2022-08-03 01:40:31
in my understanding that affine transformation (with suitable parameters) should be enough for sRGB
2022-08-03 01:40:47
according to the spec: "The resulting RGB samples correspond to sRGB primaries and a D65 white point, and the transfer function is linear. [...] The decoder can choose different primaries or white point by first multiplying inv_mat by a matrix converting from sRGB to the desired primaries and/or from D65 to the desired white point."
Traneptora
2022-08-03 04:51:53
oh, so `(r, g, b)` is linear sRGB
2022-08-03 04:54:02
how does that work with wide gamut, are r, g, and b just float values with out of gamut (i.e. `< 0 or > 1`) permitted?
yurume
2022-08-03 05:17:49
I assume it gets just extrapolated
_wb_
2022-08-03 06:20:38
Yes, just out of range values for wide gamut
2022-08-03 06:20:56
Which is not an issue when working with float
yurume
2022-08-03 06:21:23
today in jxsml: finally got the pseudo-streaming code compiled, fixing all sort of fallouts...
2022-08-03 06:21:42
and I really need to write a proper test
_wb_
2022-08-03 06:21:44
Can also use a different matrix to convert xyb to rgb with wider gamut primaries
Traneptora
2022-08-03 05:27:09
how does grayscale work then?
2022-08-03 05:27:29
if `r = g = b` that doesn't necessarily imply that `r' = g'` and that `b' = 0`
2022-08-03 05:33:02
so how can you drop the X/B channels in that case
_wb_
2022-08-03 06:58:35
What is typically encoded is X,Y, B - 1.0*Y (the default chroma from luma factor for B is -1.0)
2022-08-03 06:59:09
In grayscale, X is 0 and Y=B.
Traneptora
2022-08-03 10:51:51
ah mb
2022-08-03 10:51:59
Y=B makes more sense than B=0
Jyrki Alakuijala
Traneptora what actually *is* XYB
2022-08-04 01:35:46
XYB is something that I fitted to my eyes, and later tested that it works better than traditional colorspace for other humans, too
2022-08-04 01:36:10
'colors as seen by Jyrki' ๐Ÿ˜›
2022-08-04 01:36:38
Luca normalized it a bit differently for JPEG XL so that it was easier to model grayscale
2022-08-04 01:37:12
I didn't use Lab, XYZ or other classically approved approaches to derive XYB
2022-08-04 01:37:27
I just went for whatever works best
2022-08-04 01:39:40
I used several monitors for it, photography processing monitors from EIZO and NEC as well as a google pixelbook and a simple old Dell monitor
2022-08-04 01:40:16
all experiments used pixels that were roughly 900 pixels away from the eye
2022-08-04 01:40:53
in the original XYB there are two colorspaces and a logarithmic compression function
2022-08-04 01:41:25
one colorspace is for low frequency colors, involving a lot more blue (S receptor) sensitivity
2022-08-04 01:41:51
another colorspace for high frequency colors (roughly wavelength 8 pixels and shorter)
2022-08-04 01:42:07
this one has less blue impact in it
2022-08-04 01:42:38
(and even that is just ignored at even shorter spatial wavelengths)
2022-08-04 01:42:58
... now a question -- how do we generate colors with spatial wavelengths
2022-08-04 01:43:30
one can do it with for example having some background color, let's take gray (0.5, 0.5, 0.5) for simplicity
2022-08-04 01:44:26
let's add a color (0.0, 0.1, -0.1) to it -- we add it to some number of consequent pixels, I'd usually use 8 pixels
2022-08-04 01:44:57
then the next neighboring eight pixels I'd use the opposing color (0.0, -0.1, 0.1)
2022-08-04 01:45:10
repeat a few times, and you have a spatial high frequency color experiment
2022-08-04 01:45:34
I usually repeated this 4 or 8 times
2022-08-04 01:46:07
sometimes I'd use text with dilation shadow to experiment this in a more complex setting
2022-08-04 01:46:40
the original XYB has a biased logarithmic compression function
2022-08-04 01:47:01
in JPEG XL we still have it, but we approximate part of it with a biased cubic root
2022-08-04 01:47:51
the other part we put explicitly in the adaptive quantization matrix (which is just wrong, because the quantization affects more than just one pixel) -- but it turns out to be helpful in any case and makes a better balance of bright and dark areas
2022-08-04 01:48:41
biasing the logarithm makes the compression to be linear at the lowest intensity (like the sRGB linear segment) then roughtly gamma=2.6 and logarithmic at very high values
yurume
2022-08-06 07:52:36
today in jxsml: fixed an unbelievably stupid bug ```diff JXSML_ALWAYS_INLINE int jxsml__(ceil_lg,N)(jxsml__uintN_t x) { - return x > 2 ? JXSML__N - JXSML__CLZN(x - 1) : 0; + return x > 1 ? JXSML__N - JXSML__CLZN(x - 1) : 0; } ```
2022-08-06 07:53:39
I have almost finished a restructuring and am now writing some initial tests, and that test caught this bug
improver
2022-08-06 12:29:09
i bet you meant >= 2 hehe
yurume
2022-08-06 01:39:57
well the code operates on `x - 1` so I must have simplified `x - 1 > 0` wrongly
2022-08-10 10:04:18
today in jxsml: I now have a fully tested inverse transformation (including Hornuss) and coefficient order code and something is still wrong
2022-08-10 10:05:22
those glitches only appear in _some_ AFV varblocks and _some_ DCT16x16 varblocks or larger
_wb_
2022-08-10 11:35:57
That's intriguing
2022-08-10 11:36:23
All or none is more expected
2022-08-10 11:37:09
Something about the adaptive quant weights maybe?
yurume
2022-08-10 11:37:21
yeah, that's probably the next target to test
2022-08-10 11:38:01
I think there is something with strong horizontal stripes seen in glitched DCT16x16+ varblocks
_wb_
2022-08-10 11:49:46
Did you compare dequanted coeffs before idct between jxsml and libjxl?
yurume
2022-08-10 11:51:16
I have a code for doing that, but there are too many varblocks there and it will take some time to see the actual culprit (in fact, this is why I switched to a much smaller image)
2022-08-10 11:51:47
alternatively: I think libjxl does have some sort of debugging dump code, is it documented somewhere?
2022-08-10 09:17:13
okay, fixed AFV; this is yet another incorrect default parameters, this time in DCT4x4 (AFV also refers to this)
2022-08-10 09:18:38
```diff #define JXSML__DCT4X4_DCT_PARAMS \ - {843.649426659137152f, 289.6948005482115584f, 137.04727932185712576f}, \ - {0.0f, 0.0f, -0.25f}, {0.0f, 0.0f, -0.25f}, {0.0f, 0.0f, -0.5f} // (4) + {2200.0f, 392.0f, 112.0f}, {0.0f, 0.0f, -0.25f}, {0.0f, 0.0f, -0.25f}, {0.0f, 0.0f, -0.5f} // (4) ```
2022-08-10 09:19:21
since errors are only in the first channel, glitches appeared only for some varblocks where that channel is not all zeroes
_wb_
2022-08-10 09:32:20
I sometimes wonder why we bother making a spec instead of some minimalistic unoptimized readable reference decoder implementation. Specs are not executable and that makes it super easy to get unnoticed bugs in them...
2022-08-10 09:36:34
When jxsml is done, we should probably declare it an alternative reference decoder at some point. I have a feeling it will be more useful than libjxl to be an "executable spec" for other implementers to use as a starting point / reference.
yurume
2022-08-11 12:09:28
okay, I think I'll refactor things a bit more
2022-08-11 12:09:48
I'm fed up with doing manual 2D offset calculations by now
2022-08-11 12:10:11
there would be `jxsml__view2d` type or similar instead
2022-08-11 12:12:52
I originally didn't plan to make such types because I wasn't sure which operation would be needed for them and I thought the complexity can be probably confined (libjxl also seemed fine without such types, only lightly typed), but oh my, ever-transposing matrices make everything confusing
2022-08-11 12:13:45
for a long time I already had comments like `/*RxC*/` to make sure that I haven't mixed dimensions, but by now it feels inadequate
2022-08-11 12:14:10
and I think I have a good list of all operations I would actually need
2022-08-11 12:29:27
```c // current: JXSML_STATIC void jxsml__inverse_dct32(jxsml__st *st, float *buf) { float scratch[64], tmp; int32_t x, y; tmp = buf[000] + buf[010]; buf[010] = buf[000] - buf[010]; buf[000] = tmp; jxsml__inverse_dct(st, scratch, buf, 2, 16); jxsml__transpose2d(st, buf, scratch, 8, 8); jxsml__inverse_dct(st, scratch, buf, 3, 8); for (y = 0; y < 8; ++y) for (x = 0; x < 8; ++x) buf[y * 8 + (x % 2 * 4 + x / 2)] = scratch[y * 8 + x]; } // hopefully: JXSML_STATIC void jxsml__inverse_dct32(jxsml__st *st, float *buf0) { float scratch0[64]; jxsml__view buf = jxsml__make_view(8, 8, buf0); jxsml__view scratch = jxsml__make_view(16, 4, scratch0); int32_t x, y; { float *p00 = jxsml__view_xy(buf, 0, 0), *p10 = jxsml__view_xy(buf, 1, 0); float pp00 = *p00 + *p10, pp10 = *p00 - *p10; *p00 = pp00; *p10 = pp10; } jxsml__reshape_view(&buf, 16, 4); jxsml__inverse_dct_view(st, &scratch, buf); jxsml__transpose_view(&buf, scratch); jxsml__inverse_dct_view(st, &scratch, buf); jxsml__view_vshuffle_oddeven_to_halves(buf, scratch); } ```
2022-08-11 12:31:12
what I needed was to identify operations like "shuffle_oddeven_to_halves" so that they can be individually verified
Jyrki Alakuijala
2022-08-15 04:13:38
I wonder what is more intellectually challenging -- coming up with the new formats or trying to implement the first decoder from the spec
2022-08-15 04:14:12
in any case, highest respect to you yurume
yurume
yurume today in jxsml: provisional documentation (or rather, its table of contents)
2022-08-15 07:44:56
today in jxsml: a prototype of the "Quick Start" section of the documentation
2022-08-15 07:45:59
you may notice minor changes from the previous example codes, and that's a result of me pondering about various failure modes
2022-08-15 07:47:14
for example `jxsml_frame_u8x4` (now `jxsml_frame_pixels_u8x4`) used to return the frame's width, height and stride into the out pointers, but I switched to a dedicated struct because out pointers can be pretty tricky to use
2022-08-15 07:48:35
for example jxsml always uses `int32_t` for typical integers, including conceptually unsigned integers like width and height; this means that those out parameters have a type of `int32_t*`.
2022-08-15 07:49:00
aaaand I think many people especially more proficient in C will assume `size_t*` instead ๐Ÿ™‚
2022-08-15 07:50:18
using structs seems more robust in this kind of type mistakes
2022-08-18 09:22:53
today in jxsml: yet another facepalm, this time in DCT4X8 dequantization matrix... ```diff jxsml__dct_quant_weights(4, 8, bands, n, scratch); for (c = 0; c < 3; ++c) { for (y = 0; y < 8; ++y) for (x = 0; x < 8; ++x) { - raw[y * 8 + x][c] = scratch[(y / 2) * 4 + x][c]; + raw[y * 8 + x][c] = scratch[(y / 2) * 8 + x][c]; } raw[001][c] /= params[0][c]; } ```
2022-08-18 09:23:49
it (hopefully) looks like the last major bug from dequantization matrix handling
2022-08-18 09:24:29
(difference)
2022-08-19 03:20:05
I'm now sure that the remaining artifact is very likely from LLF reconstruction, which explains weird strips; those values are relatively large (say, 5) and overwhelm IDCT and subsequent processes
_wb_
2022-08-19 05:30:04
That makes sense
fab
2022-08-19 07:52:21
x
2022-08-19 07:52:36
ah firefox fixed it
2022-08-19 07:53:41
still it crashes one page too times on windows 7
2022-08-19 07:53:52
i would like a better font
2022-08-19 07:54:04
i' m using that
2022-08-19 07:54:06
https://github.com/niklas-ekholm/Bookish-Variable
2022-08-19 07:54:23
but i need a 3.0 version.
2022-08-19 07:54:29
he is at 2.012
2022-08-19 07:55:15
look it isn't updated in 5 years
2022-08-19 07:57:36
before I used iosevnya and was useful for github
2022-08-19 07:58:12
i did also webp2
2022-08-19 07:58:13
cwp2 C:\Users\Use\Music\d\a.png -o C:\Users\Use\Music\d\as.wp2 dwp2 C:\Users\Use\Music\d\as.wp2 -o C:\Users\Use\Music\d\e.png webp2 makes the orange where there is red more saturated but has good quality don't know if we need them if there is jpeg xl for %i in (C:\Users\Use\Music\dd\*.png) do cjxl -d 1 -e 7 "%i" "%i.jxl"
2022-08-19 07:59:26
svt 1.2.1-7 is the first in a month with no encoder improvements; same as svt 1.2.1-6
2022-08-19 08:00:55
look he has also this project
2022-08-19 08:00:57
https://github.com/Heptazhou/Saranya/releases/tag/v15.5.2-1
2022-08-19 08:01:46
yesterday also I did a lot of changes for jxl and av1 italian wiki
2022-08-19 08:05:55
look like on jpeg xl the contributions of other users are inexistent
2022-08-19 08:06:16
and last was 24 june 2022
2022-08-19 08:07:40
av1 was 12 august 2022, 18,27 july and 10 july 2022
2022-08-19 08:09:38
3 july and 15 april
Brinkie Pie
2022-08-19 08:51:14
> <#794206087879852106>
yurume
yurume I'm now sure that the remaining artifact is very likely from LLF reconstruction, which explains weird strips; those values are relatively large (say, 5) and overwhelm IDCT and subsequent processes
2022-08-20 11:14:57
I've found a quite substantial spec bug in LF-to-LLF transformation, but that was somehow unrelated to this glitch... how?
2022-08-20 11:15:22
will have a dinner and revisit this
Traneptora
2022-08-20 09:24:26
anyone know the color temperature of D65 off the top of their head?
yurume
2022-08-20 09:26:10
isn't that supposed to be 6500 K?
Traneptora
2022-08-20 09:26:19
is it? that's the question
2022-08-20 09:27:47
I looked it up on wikipedia, it appears that is the intent yea
2022-08-20 09:27:57
D50 is 5000K, D65 is 6500K, etc.
2022-08-20 09:28:10
> The CCTs of the canonical illuminants, D50, D55, D65, and D75, differ slightly from what their names suggest. For example, D50 has a CCT of 5003 K ("horizon" light), while D65 has a CCT of 6504 K (noon light).
2022-08-20 09:28:18
> As explained in a previous section, this is because the value of the constants in Planck's law have been slightly changed since the definition of these canonical illuminants, whose SPDs are based on the original values in Planck's law. In order to match all significant digits of the published data of the canonical illuminants the values of M1 and M2 have to be rounded to three decimal places before calculation of SD.
yurume
2022-08-20 09:28:22
yes, it is *supposed* but not exactly AFAIK
yurume will have a dinner and revisit this
2022-08-20 10:50:27
yay, after hours of debugging it boiled down to the layout of LLF coefficients, again (hah)
2022-08-20 10:54:09
let's imagine DCT16X16 varblock for example, its LLF coefficients (4 of them) logically precede all remaining HF coefficients (252 of them), but in the coefficient order they are actually interleaved, especially if you want to reuse a coefficient array as a matrix after simple reshaping (LLF coeffs will be then at indices 0, 1, 16 and 17)
2022-08-20 10:55:11
and I seemed to keep forgetting that LLF coefficients are not necessarily first coefficients, mixing conventions here and there
2022-08-20 10:59:42
so the stripe glitch happened because, well, basically *unquantized* LLF coeffs (large) overwrote *quantized* HF coeffs (small)
2022-08-20 11:01:13
at the root of all this struggle is my original design to keep LLF coeffs and HF coeffs in the same array
2022-08-20 11:02:14
I think this is still possible, but won't be any clearer than the alternative
2022-08-20 11:02:52
that is to split LLF coeffs and HF coeffs, dequantize separately and only combine them right before IDCT (as libjxl does)
2022-08-20 11:03:20
aaargh.
BlueSwordM
Traneptora anyone know the color temperature of D65 off the top of their head?
2022-08-20 11:40:12
That would be a CCT of 6500K.
w
2022-08-21 12:42:17
um akshually it's xyY 0.3127 0.329 which is closer to 6504
yurume
2022-08-21 12:43:12
hahaha
2022-08-21 01:34:53
much better. (I accidentally deleted all HF coefficients for B)
2022-08-21 01:54:11
almost! (fixed incorrect argument ordering to `jxsml__forward_dct2d_scaled_for_llf`, causing most LLF coefficients to be NaN)
2022-08-21 02:07:03
aaaand yes
2022-08-21 02:07:21
the last bug fixed was to correctly transpose LLF coefficients during the final merger
2022-08-21 02:08:04
a larger sample also works, differences exist solely because of postfilters
2022-08-21 02:11:44
to celebrate this moment I've updated a long-neglected gist: https://gist.github.com/lifthrasiir/137a3bf550f5a8408d4d9450d026101f
_wb_
2022-08-21 06:26:08
๐Ÿ‘๐Ÿ’ช๐Ÿ‘๐ŸŽ‰
2022-08-21 06:27:11
Does this mean both Modular and VarDCT are now working? Except probably multi-pass?
2022-08-21 06:28:46
That's great! The things left now should be relatively easy since they're mostly independent and not that complicated things.
2022-08-21 06:36:23
Gaborish should be very simple. EPF is a bit more stuff but still only a (fancy) filter. Patches are easy, just work to implement all the blend modes and saving reference frames correctly (but most of that work is overlaps with what is needed for frame blending). Splines and noise can be tested pretty much in isolation from everything else so should also be relatively easy.
2022-08-21 06:38:05
Getting Modular and VarDCT right is the hard part, because they both consist of quite a few interdependent components so when there are spec bugs or implementation bugs, it's tricky to figure out what exactly is going wrong...
yurume
_wb_ Does this mean both Modular and VarDCT are now working? Except probably multi-pass?
2022-08-21 07:37:52
yes, no multipass and JPEG yet.
_wb_
2022-08-21 07:38:36
What's missing for jpeg?
yurume
2022-08-21 07:39:07
YCbCr conversion and JPEG-specific upsampling I think?
_wb_
2022-08-21 07:39:24
YCbCr is easy enough to add
2022-08-21 07:39:36
For 4:4:4 jpegs
yurume
2022-08-21 07:39:38
basically everything not triggered by typical images encoded with `cjpeg`
2022-08-21 07:39:59
yeah, color space conversion should not be that hard, upsampling is probably a next big task
_wb_
2022-08-21 07:41:29
The upsampling is maybe a bit trickier, or rather not the upsampling itself but knowing where the coeffs of the downsampled channels are. Spec might be a vague or wrong about that...
yurume
2022-08-21 07:45:24
by the way: https://gist.github.com/lifthrasiir/137a3bf550f5a8408d4d9450d026101f
2022-08-21 07:46:24
I've picked the name.
_wb_
2022-08-21 08:02:42
J40? What does it mean?
2022-08-21 08:03:24
4 does kind of contain an X and an L, with some imagination and depending on font I guess
yurume
2022-08-21 08:14:38
Hint: Roman numerals.
_wb_
2022-08-21 08:19:44
Ah lol
2022-08-21 08:20:09
XL is indeed 50-10=40
2022-08-21 08:21:42
Now we need a j2k implementation called JMM ๐Ÿ™‚
yurume
2022-08-21 08:22:12
Oh that's lovely
2022-08-21 08:22:33
Anyway, XL being equal to 40 occurred to me suddenly and I knew this is it
_wb_
2022-08-21 08:22:38
I like it
2022-08-21 08:43:44
The old JPEG we often call JPEG 1. JPEG 2000 is also known as JPEG 2 (e.g. .jp2), but you could also say it's JPEG 10 (X) since they use .jpx for the extended file format of part 2. Then I suppose you could say JPEG XR is a kind of JPEG 20 (XX), JPEG XT is JPEG 30 (XXX), which brings us to JPEG XL which is JPEG 40. ๐Ÿ˜…
yurume
2022-08-21 08:59:51
JPEG XR (aka JPEG 2010), JPEG XT (aka JPEG 2015), JPEG XL (aka JPEG 2020)? :-p
monad
2022-08-21 05:47:11
I agree with this name. https://discord.com/channels/794206087879852103/794206170445119489/827096470590193674
yurume
2022-08-23 04:21:08
today in j40 (formerly jxsml): after some refactoring...
2022-08-23 04:23:12
I'm in process of refactoring most if not all 2D array operations into more defined system, and fortunately everything seems to work except for this
2022-08-23 04:38:05
okay, this is just a PNG writer bug, which didn't honor strides
diskorduser
yurume today in j40 (formerly jxsml): after some refactoring...
2022-08-23 05:19:21
What's this jxsml/j40? Is is some sort of jxl art?
yurume
2022-08-23 05:20:03
J40 is an independent self-contained reimplementation of JXL decoder, currently in development
improver
2022-08-23 05:36:55
JEI forty sounds pretty nice but does it refer to something?
2022-08-23 05:37:38
just curious
yurume
2022-08-23 05:42:42
40 from a Roman numeral, I like stupid names :p
_wb_
2022-08-23 07:19:18
XL is a roman number, unlike XR, XS and XT we can actually pretend to be JPEG version 40 ๐Ÿ™‚
yurume
2022-08-23 07:54:43
it seems that I'm pretty good at coming up with stupid names ๐Ÿ˜‰
2022-08-23 07:56:37
roadroller (JS code packer), cursive script object notation (JSON superset), walrus (web authentication library), unison (pan-Unicode bitmap font), kailua (type checker for Lua), esotope (esoteric programming language implementation collection), ...
_wb_
2022-08-23 08:50:38
the stupidest name I ever came up with was APOPCALEAPS: https://sneyers.info/jon_old/apopcaleaps/
yurume
2022-08-23 09:33:49
I would have named it Popcorn (for POP COMposer), as rn and m is not really distinguishable
2022-08-23 09:35:02
basically I like a name that is i) short enough, ii) possibly provoking what it does (but not required) and iii) when one realizes why it's named so, one would facepalm
necros
2022-08-24 04:43:30
can someone upload latest win binary? main site is dead
The_Decryptor
2022-08-24 04:46:47
https://github.com/libjxl/libjxl/actions/workflows/release.yaml < I grab them from here
necros
2022-08-24 04:50:49
<@268637846355574786>Thanx bud
veluca
necros can someone upload latest win binary? main site is dead
2022-08-24 07:00:33
yeah trying to figure out what's up with my home internet...
2022-08-24 07:03:28
well whatever was the issue they fixed it, artefacts repo should be up again
Jyrki Alakuijala
yurume 40 from a Roman numeral, I like stupid names :p
2022-08-24 10:46:09
I love it
yurume
2022-08-24 05:31:33
https://twitter.com/jyzg/status/1562403716468297728 oh, you posted a link to that gist ๐Ÿ˜‰
2022-08-24 05:32:04
I kinda expected to see this link in the wild much earlier, but okay
2022-08-24 07:33:02
today in j40: realized that, for example, `(J40_RGB, J40_U8X3)` output pair might result in a fractional stride in terms of elements as opposed to bytes
2022-08-24 07:35:27
`J40_U8X3` "pixel" format is supposed to return `uint8_t[3]` for each pixel, but I may have to change that to `uint8_t` and let users do the necessary calculation (e.g. `pixels[y * stride + x * 3]` as opposed to `pixels[y * stride + x]`)
2022-08-24 07:36:14
but `y * stride + x * 3` is really unappealing, even more prone to error than `(y * stride + x) * 3`
2022-08-24 07:37:15
probably I will instead make sure that for u8x3 formats and likes there is no padding at all
2022-08-24 07:38:37
uh, actually, thinking about that, *all* pixel formats are more usable when there is no padding, so I probably should drop the possibility of padding at all??
2022-08-24 07:45:34
yes, that sounds much better plan
veluca
2022-08-24 07:46:38
problem is that a bunch of other programs *need* that padding
_wb_
2022-08-24 07:46:54
it can be quite convenient for various reasons to have arbitrary strides
veluca
2022-08-24 07:47:09
i.e. I think gdk will allocate buffers with a certain stride and it's up to you to make sure you fill it right
yurume
2022-08-24 07:47:24
hmm!
_wb_
2022-08-24 07:48:08
e.g. encoding a crop or decoding to a rect inside an image buffer can be easily done when padding is allowed
yurume
veluca i.e. I think gdk will allocate buffers with a certain stride and it's up to you to make sure you fill it right
2022-08-24 07:51:09
I've looked up gdk-pixbuf documentation and it seems that you can actually create a buffer with rowstride at your choice (`gdk_pixbuf_new_from_data`), as I would expect from pretty much every pixel buffer library
veluca
2022-08-24 07:51:33
fair
2022-08-24 07:51:50
but in general a few things have odd requirements on strides
2022-08-24 07:51:57
possibly HW motivated?
yurume
2022-08-24 07:52:05
yeah, 4-byte boundary seems more common especially in older formats
2022-08-24 07:52:19
(e.g. I think BMP has one)
2022-08-24 07:53:15
the third solution is to discourage the direct access to `pixels` and give a dedicated function/macro/whatever for accessing each row
2022-08-24 07:54:14
I'm already doing this internally (`J40__U8_PIXELS` etc.), so probably I should do that in the public API as well
2022-08-24 07:56:37
```diff - fwrite(pixels.ptr + y * pixels.stride, 4, pixels.width, out); + fwrite(j40_row_u8x4(pixels, y), 4, pixels.width, out); ```
2022-08-24 07:56:45
hmm
2022-08-24 07:58:09
I can actually do some crazy C macro to shorten that into `J40_ROW(pixels, y)`, but well...
_wb_
2022-08-25 05:09:14
<@604964375924834314> do you have any recommendations for a HDR monitor? I still need to let Cloudinary buy me one
spider-mario
_wb_ <@604964375924834314> do you have any recommendations for a HDR monitor? I still need to let Cloudinary buy me one
2022-08-25 05:26:08
I havenโ€™t tried it but on paper, https://www.asus.com/ch-en/Displays-Desktops/Monitors/ProArt/ProArt-Display-PA32UCX-PK/ looks good if within budget
diskorduser
2022-08-25 05:29:06
Is it better than apple pro display xdr?
spider-mario
2022-08-25 05:35:18
cheaper, more dimming zones, hardware calibration (including uniformity), works with non-mac machines
BlueSwordM
_wb_ <@604964375924834314> do you have any recommendations for a HDR monitor? I still need to let Cloudinary buy me one
2022-08-25 11:32:14
You want the Samsung Odyssey Neo G7 1440p/4k if you want something top notch in that regard if you cab calibrate it.
w
2022-08-26 12:56:08
odyssey neo is va ๐Ÿ’€
BlueSwordM
w odyssey neo is va ๐Ÿ’€
2022-08-26 02:46:50
Yeah, good VA.
2022-08-26 02:46:58
Not mid range VA.
w
2022-08-26 02:47:43
all va is mid range va if it has to be curved
yurume
2022-08-27 03:24:21
today in j40: I'm reading EPF and oh corresponding libjxl code was much more complex than I thought
2022-08-27 05:35:12
https://discord.com/channels/794206087879852103/803574970180829194/1012784002509312010 regarding this btw: is there a small enough CMS out there? Is lcms2 the best choice? Skcms seems to implement a good chunk, but I don't know much about tradeoffs and problems with skcms.
The_Decryptor
2022-08-27 05:41:15
I know of ArgyllCMS, and Mozilla has qcms but I think that's focused more on speed than functionality
yurume
2022-08-27 06:26:23
ah, I should mention the context: so J40 as it stands can't handle ICC profiles, so my current plan is to reject any file that requires them by default, but that can be overriden by a macro like `J40_USE_LCMS2` which would require lcms2. but if I have a small enough (in terms of LoC) CMS then it may make sense to bundle it alongside with J40.
2022-08-27 06:27:03
I agree that having a defined color profile is one of the strengths of JPEG XL and don't want for J40 to ruin that
_wb_
2022-08-27 07:13:31
As far as I understand, skcms cannot convert TO lookup-table profiles (like e.g. cmyk profiles), but for jxl purposes I think it is feature-complete.
yurume
2022-08-27 07:15:17
yeah, that shouldn't be a problem (ideally J40 should be able to convert to sRGB without a special library and can optionally utilize lcms2 or similar for other profiles)
_wb_
2022-08-27 07:19:46
If the jxl file has some weird icc profile (non-enum rgb, or cmyk), and is not using xyb, then a cms library will be needed
2022-08-27 07:20:26
But for the case of xyb or for enum rgb, it should be possible to do things without cms library
yurume
2022-08-27 07:21:00
does libjxl detect "conventional" profiles and use compact metadata? I think it does regenerate profiles for those compact metadata, but not sure about the opposite direction.
_wb_
2022-08-27 07:21:21
It does, but iirc it only does that when doing lossy
2022-08-27 07:22:03
When doing lossless, it will store the icc profile as is even if it is just an enum space, just to be sure
yurume
2022-08-27 07:22:27
maybe I should detect those cases myself then
_wb_
2022-08-27 07:24:34
(for lossless jpeg recompression this is necessary to reproduce bit-exact jpeg files, for lossless pixels it is not necessary but iirc we do it anyway just because there are subtle variants of e.g. sRGB that have slightly differently rounded constants so technically it's not lossless to replace that with the Enum version of it)
yurume
2022-08-27 07:25:10
yeah, I've seen multiple different approximations to sRGB in terms of ICCv2 profiles
fab
2022-08-28 01:11:11
<@268284145820631040>
2022-08-28 01:11:15
https://en.m.wikipedia.org/wiki/JPEG_XL
2022-08-28 01:11:49
I uniformed the style of writing between English and Italian
2022-08-28 01:12:13
There was an advice that was a list
2022-08-28 01:12:44
Now you can make the racist you're Italian you aren't supposed to fix this article
2022-08-28 01:13:07
Or actually fix the wrong declaration
2022-08-28 01:13:34
Because every two language contains information copied by Jon Sneyers
yurume
2022-08-28 01:13:49
please refrain from claiming what I have never said
fab
2022-08-28 01:13:56
Ok
2022-08-28 01:14:13
So you won't do
yurume
2022-08-28 01:14:41
what?
2022-08-28 01:15:53
honestly speaking I had & have a hard time understanding what you really meant, both in the previous conversation and this time
2022-08-28 01:16:49
(especially the "racist" bit)
2022-08-28 01:18:30
I tried to give my best effort advice for contributing to Wikipedia for the first time, but that doesn't mean you have to agree to me all the time; you can always ignore my advice and maybe that's a way to go
2022-08-28 01:19:12
but if you don't want to care about my advice, please do not ping me about that
fab
2022-08-28 01:19:35
Sorry
2022-08-28 01:20:18
There are errors in my writing
2022-08-28 01:20:21
Modularย (lossless,near lossless/paletteย delta) based from FUIF โ€“ responsible, among others, for efficient lossless content encoding
2022-08-28 01:21:03
It makes think im saying fuif is responsible and is a tool of the JXl
2022-08-28 01:21:23
Think alone will get my edits removed
2022-08-28 01:21:42
Because English can know I'm not English
2022-08-28 01:23:37
Also few bits about Jon Sneyers
2022-08-28 01:24:39
Without the context on GitHub isnt a problem but i repeat adaptive quantization weights like without explaining what fuc is that
2022-08-28 01:25:04
Like if you go to the aac page is explained what is LFE
2022-08-28 01:25:44
a reconstruction of frequencies to the 120hz and can be max 16 channels and the audio is stereo
2022-08-28 01:25:59
The JPEG XL article Is orphan
2022-08-28 01:26:16
It doesn't explain nothing about vardct
2022-08-28 02:37:25
2022-08-28 02:37:38
I did all this
2022-08-28 02:38:01
The mpeg part looks like is wrote from a non native
2022-08-28 02:38:42
The prepositions are strange
2022-08-28 02:39:01
I tried to make less awful as possible
2022-08-28 02:39:54
No Is originally wrote on English
2022-08-28 02:40:03
I'm Italian but i wrote on English
2022-08-28 02:40:17
I used sura and vani fonts
2022-08-28 02:40:43
The question is i'm not English
fab It makes think im saying fuif is responsible and is a tool of the JXl
2022-08-28 02:41:01
Like this
2022-08-28 02:41:19
Hope they don't revert
2022-08-28 02:43:16
I finished editing jpeg xl at 15:06
2022-08-28 02:43:38
The italian at 15:05
2022-08-28 02:43:46
But don't Watch the time
2022-08-28 02:43:52
Time is not important
2022-08-28 02:44:03
It doesn't say rhe the quality
2022-08-28 02:44:55
https://en.m.wikipedia.org/wiki/Special:MobileDiff/1107152458
2022-08-28 02:45:05
Also this I did
2022-08-28 02:45:18
I added details about YouTube
2022-08-28 02:45:23
Only one source
2022-08-28 02:45:33
Too few
2022-08-28 02:45:51
This probably will be cancelled
yurume
2022-08-29 02:56:57
epf requiring at most *three* previous and next rows makes my brain exploding
veluca
2022-08-29 07:00:31
why? ๐Ÿ˜„
yurume
2022-08-29 07:01:59
well it's easy to do in a naive way, but an optimized version would have to juggle lots of temporary buffers :S
veluca
2022-08-29 07:03:01
don't I know that...
yurume
2022-08-29 07:03:45
I think libjxl already does the same thing in stage_epf.cc?
veluca
2022-08-29 07:04:10
yep, lots of magic to optimize that stuff
yurume
2022-08-30 05:29:25
today in j40: Hayasaka helpfully reported that every image from JPEG transcoding will crash j40, and it all boils down to the fact that I didn't think u(32) was that frequently used ๐Ÿ˜‰
2022-08-30 05:30:27
to answer other question: july.jxl depends on patches which j40 doesn't support yet.
2022-08-30 05:31:14
yes, unfortunately
2022-08-30 05:31:33
I think every image produced by fjxl works at the moment