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

adoption

Adoption of jxl: what software supports jxl already, how to get more adoption?

Dejay
Kampidh nope, unfortunately global animated need to be enabled for multipage, otherwise it will saved as multilayered instead
2024-10-30 09:42:33
Ok now with animated set and all frames set to "page end" VipsDisp doesn't display it properly any more. Like shows only parts of the image, my guess is that it cycles through frames at max speed. Which isn't the fault of frame stitcher of course
2024-10-30 09:43:51
But it's interesting to see that VipsDisp decodes the frames "on demand" when switching frames. Like it doesn't just decompress all the pages on load
2024-10-30 09:59:35
Oh wow there are actually public domain comics. Check out THE HANGMAN #1 <https://comicbookplus.com/?dlid=86397> where Bob Dickering becomes the hangman to avenge his brothers death while taking two boy buddies with him on his war on crime adventure!
2024-10-30 10:46:44
*To protect people's sanity, this comic book has been locked away in a multi page JXL file that nobody can read. But will a mad scientist unleash this forbidden book from the 1942 on the world?!*
tufty
Dejay But it's interesting to see that VipsDisp decodes the frames "on demand" when switching frames. Like it doesn't just decompress all the pages on load
2024-10-30 10:56:09
actually right now it decodes the whole thing on load decode-on-page-load is on the todo list
Dejay
tufty actually right now it decodes the whole thing on load decode-on-page-load is on the todo list
2024-10-30 10:57:12
Huh I could have sworn I saw individual tiles popping up. Or does VipsDisp load the file into a tiled image?
2024-10-30 10:59:54
Could also be the UI system uploading / swapping image tiles to the GPU mem
A homosapien
Dejay Huh I could have sworn I saw individual tiles popping up. Or does VipsDisp load the file into a tiled image?
2024-10-30 11:02:39
Chunked decoding is a thing yes
RaveSteel
2024-10-30 11:15:18
Some image viewers support jumping one frame using keybinds, so those work fine for these kind of JXL images xd
Dejay
2024-10-30 11:26:48
I think for a multi page document reader on desktop you'd want 4 different fullscreen modes: Select / Autodetect: - Comic book: Single/Double/Wide page, zoom 100% screen height - Webtoon: Single page vertical scroll, Zoom ~800 pixel width or ~25% screen width - PDF / scanned document: Single page vertical scroll or like Comic Book, zoom 100% screen width - Manga: right to left (inverse page order?)
jonnyawsom3
Kampidh whoops careful when opening multipage image in krita, as it can trigger a deadlock ><
2024-10-31 12:35:35
Could pages be imported as layer groups perhaps?
tufty
Dejay Huh I could have sworn I saw individual tiles popping up. Or does VipsDisp load the file into a tiled image?
2024-10-31 12:44:17
vipsdisp image display is based on pyramids of tiles .... it generates a sparse pyramid of 256x256 tiles, loads them on your GPU as textures, then scales and composites them to the screen it needs to do this to do smooth zooming on huge images (eg. 500k x 500k pixels) tile generation is decoupled from image display, so on page flip it starts generating the tiles and the screen only updates some time later as threads in the worker pool complete so if page flip is faster than pyramid generation, you can see tiles from one frame in the next
2024-10-31 12:46:01
I'd like to load tiles from jxl on demand (it does this for other formats, like tiled tiff), but the jxl chunk interface isn't a great fit for libvips, so for now it just decompresses the whole thing to a temp file and makes the pyramid from that
Dejay
tufty vipsdisp image display is based on pyramids of tiles .... it generates a sparse pyramid of 256x256 tiles, loads them on your GPU as textures, then scales and composites them to the screen it needs to do this to do smooth zooming on huge images (eg. 500k x 500k pixels) tile generation is decoupled from image display, so on page flip it starts generating the tiles and the screen only updates some time later as threads in the worker pool complete so if page flip is faster than pyramid generation, you can see tiles from one frame in the next
2024-10-31 01:39:06
Thanks for the info! VIPS handling gigapixel images is pretty cool
Demiurge
2024-10-31 05:55:07
Vips is the gigachad image library
Dejay Oh wow there are actually public domain comics. Check out THE HANGMAN #1 <https://comicbookplus.com/?dlid=86397> where Bob Dickering becomes the hangman to avenge his brothers death while taking two boy buddies with him on his war on crime adventure!
2024-10-31 05:58:02
I read that as "war crime adventure."
2024-10-31 05:58:21
I've been playing too much metal gear...
Kampidh
Could pages be imported as layer groups perhaps?
2024-10-31 06:53:19
I'll gonna put that to a to-do, for now I've proposed a fix to load as a normal animation frames instead
CrushedAsian255
2024-10-31 06:54:09
Is JXL frame stitcher available on non Windows?
Kampidh
2024-10-31 06:57:33
Not currently, maybe gonna try to fiddle around with WSL again for linux deployment like what I did with jxl batch converter
CrushedAsian255
Kampidh Not currently, maybe gonna try to fiddle around with WSL again for linux deployment like what I did with jxl batch converter
2024-10-31 06:58:08
Is it open source? I could possible make something at lease CLI for Unix
2024-10-31 06:58:19
Don’t know JXL api though
Kampidh
2024-10-31 07:01:18
Yep, the frame stitcher source code is on that same repo as the link above. Could be a great help if someone can compile that on Unix systems xD
CrushedAsian255
Kampidh Yep, the frame stitcher source code is on that same repo as the link above. Could be a great help if someone can compile that on Unix systems xD
2024-10-31 07:08:57
Dumb question I’m guessing, but I __can__ fork it right?
Kampidh
2024-10-31 07:09:22
Of course ^^
CrushedAsian255
2024-10-31 07:10:53
I’m terrible with UI but I could probably get a CLI version compiling
2024-10-31 07:11:40
Although not right now, end of year exams
tufty
Dejay Thanks for the info! VIPS handling gigapixel images is pretty cool
2024-10-31 08:35:34
the biggest libvips image i know of is 1,600 gigapixels heh https://www.epfl.ch/labs/emplus/projects/diagram/
jonnyawsom3
2024-10-31 08:48:08
Damn, just outside of JXL spec haha
_wb_
2024-10-31 08:53:25
Outside Level 10. Not outside the spec. Just doesn't conform to any current profile/level.
tufty
2024-10-31 08:58:08
480k x 5m pixels from memory
_wb_
2024-10-31 09:02:39
spec allows up to about 1g x 1g pixels, though Level 10 limits it to about 1100 GPx
0xC0000054
2024-10-31 09:05:02
Apparently Microsoft's WIC codec for JXL in Win11 v24H2 is still incomplete, the developer of Paint.NET posted on the Paint.NET Discord that it just throws an exception when you try to use it.
jonnyawsom3
_wb_ spec allows up to about 1g x 1g pixels, though Level 10 limits it to about 1100 GPx
2024-10-31 09:08:01
Right, yeah. I was thinking back to our "Earth in a file" idea with 1m per pixel resolution
tufty 480k x 5m pixels from memory
2024-10-31 09:09:38
> Typical image file sizes for 8 bit colour ranged from between 1.3 TB and 1.5 TB (per scroll?) . This is simply doubled for the 16 bit versions given that the files are saved as uncompressed RGB values. > 3805340 x 425000 pixels, 1.62 terapixels
2024-10-31 09:14:36
So roughly 4m x 400k
2024-10-31 09:15:29
The bottom of this article has file formats and processing https://www.epfl.ch/labs/emplus/projects/murten-panorama-digital-twin-scanning-project-the-making-of/
0xC0000054 Apparently Microsoft's WIC codec for JXL in Win11 v24H2 is still incomplete, the developer of Paint.NET posted on the Paint.NET Discord that it just throws an exception when you try to use it.
2024-10-31 09:16:33
Yeah, they added it to the background selection but it does nothing since there's no code to run, just registry entries
0xC0000054
2024-10-31 09:19:47
I am a little surprised the would add it to the selection if it isn't yet supported. But it could be like their WebP and AVIF WIC codecs where they plan to use an addon MS store package that has to be installed for it to work.
jonnyawsom3
2024-10-31 09:23:12
Yeah, that's what we've seen evidence for
CrushedAsian255
2024-10-31 09:53:33
is the actual image available as it would be funny to see how long it would take to encode
Traneptora
2024-10-31 09:53:53
~~with hydrium~~
CrushedAsian255
2024-10-31 09:54:11
hydrium would end up taking 4 seconds
Traneptora
2024-10-31 09:56:45
maybe, being single threaded is not great for its perf vs libjxl
2024-10-31 09:57:22
but I'm not going to implement threading because most low-memory environments where it shines aren't going to be multithreaded anyway
CrushedAsian255
2024-10-31 09:58:00
is hydrium for lossy or lossless?
2024-10-31 09:58:30
also how would it work for something like that really big panorama, as wouldn't it have to store the pixels that were incoming?
2024-10-31 09:58:41
or do you have to pass pixels in group by group?
Traneptora
2024-10-31 09:58:41
it's fixed quality, currently at around d=1
2024-10-31 09:58:50
and no the library accepts pixels one tile at a time
CrushedAsian255
2024-10-31 09:59:14
tile = 2048x2048 group?
Traneptora
2024-10-31 09:59:29
choice between 256x256 up to 2048x2048
2024-10-31 09:59:30
power of two
2024-10-31 09:59:39
if the input is from a PNG then generally you'll need to buffer between 256 and 2048 scanlines of that PNG file
2024-10-31 09:59:54
since PNG goes in scanline order
CrushedAsian255
Traneptora if the input is from a PNG then generally you'll need to buffer between 256 and 2048 scanlines of that PNG file
2024-10-31 10:00:02
so scanline caching is up to the end user
Traneptora
2024-10-31 10:00:21
ye, though if you want to maintain super duper ultra low memory you decode the PNG multiple times
CrushedAsian255
2024-10-31 10:00:44
wouldn't that kill cpu?
Traneptora
2024-10-31 10:00:53
yes
2024-10-31 10:01:32
libhydrium accepts tiles, and the default frontend which decodes PNGs (the library doesn't) decodes enough scanlines to make a group at a time
2024-10-31 10:01:49
so if you want 256x256 tiles you need to decode 256 scanlines before those tiles are available
tufty
2024-10-31 10:31:31
ah I found the discussion where the software guy on the project talks about generating the final output image https://github.com/libvips/libvips/discussions/3939
2024-10-31 10:32:06
though he doesn't give a time to generate the deepzoom image
jonnyawsom3
2024-10-31 10:38:12
Huh, a museum in London. Makes sense when you think about it and what VIPS is best at. I'm actually heading up to the city Saturday to meet some friends haha
tufty
2024-10-31 10:50:05
oh, you're uk? yes, I was at the NG 1990 - 2005, I did all their imaguing research
jonnyawsom3
2024-10-31 11:04:57
Yeah, I'm down near Brighton but travel up every 3 weeks for a social event
Kleis Auke
tufty wasm-vips has animated JXL support too https://wasm-vips.kleisauke.nl/playground/
2024-10-31 02:33:51
Here's a [sample playground link](https://wasm-vips.kleisauke.nl/playground/?modules=jxl&deflate=dVJNa9wwEP0rw1KwAxtpU-hlm81hQw-BQqG09LBeGtmelZXKGiHJcUPIf-9Y3q7poRhkzcd782ZGh5WUcHC765sj9KhchICuxQCDS8ZC6hDYBjrla0vN0KNLlWPUQ680QqQhNLiFLiUft1LGRIH9QhNpi8qbKBrqZUujs6TaKEasex_oCZskKGjJtpdm4oqyVa4xTv-slePvvbAUo8WYQb5yFhPLGPraKda2g2fjo8gyxMVdFjM4Q-bGijV82GzW8Fo5gA6N7tJ28lTu7epj5XIzP4JJmHsMGAfLdQgU1JbqyjXkIjs2XNFjOFHoWSYKR2M54ecwDWk_nE48ud2iUYwT7TeaI2Uhnn7bYsGkm_9QzglkkSegy8d7ZXkVBP-wsYN-wbtXJrlmcW_QG2tNREbylB8XmpTb4EoOR9jztTxcxB55KpBePC-wyDuQk0LIc1mw379-ZjifogmoEn6pp-2xXU7RJdf0mvP-PpJz8ieLk1Uyv86981_E0HDmmZt9F4zGdAbsXx7asmClfkjFlVDe80O874xtS2aYiFbr1W1rnsG0u2o1J1aru1vJvrsc5eP4Bw) now that wasm-vips v0.0.11 was released (which uses libvips 8.16).
tufty
Dejay *To protect people's sanity, this comic book has been locked away in a multi page JXL file that nobody can read. But will a mad scientist unleash this forbidden book from the 1942 on the world?!*
2024-10-31 03:19:04
the stable branch of libvips now has multipage jxl support https://github.com/libvips/libvips/pull/4231
2024-10-31 03:19:25
and that comic views correctly in vipsdisp
Demiurge
2024-11-01 02:33:29
the fast progress of vips is amazing
2024-11-01 02:33:57
vips doesn't support HDR transfer curves for any image format yet right?
0xC0000054
Demiurge the fast progress of vips is amazing
2024-11-01 03:43:54
I was just looking at the code. They have a streaming implementation for input, which is understandable given that app's use case. Most other libjxl users (including my own Paint.NET plugin) just load the entire JXL image into memory for processing. It is also one of the few implementations I have seen with animation/multi-page support.
Demiurge
2024-11-01 03:48:12
It's my favorite general purpose image library, a great replacement for imagemagick
2024-11-01 03:49:36
although imagemagick/graphicsmagick is still used a lot too, so it would be great if there was collaboration there.
2024-11-01 03:56:50
Oh, cool! You just released an update to the jxl plugin!
2024-11-01 03:57:28
thanks :)
2024-11-01 04:11:40
I think the most important thing when it comes to adoption to a new format is convenient and available tools that can utilize it so it's great how vips and paint.net have good compatibility thanks to great people donating their skill and time. Thanks tremendously
CrushedAsian255
tufty the stable branch of libvips now has multipage jxl support https://github.com/libvips/libvips/pull/4231
2024-11-01 04:24:31
So hang on. JXL supports multi page multilayer animations ?
Tirr
2024-11-01 04:26:40
surprisingly yes
VcSaJen
2024-11-01 04:27:11
I can't wait for default Jpeg XL support in Paint.net.
Tirr
2024-11-01 04:27:40
each page can be animated separately
CrushedAsian255
Tirr each page can be animated separately
2024-11-01 04:28:53
Can pages reference previous pages?
VcSaJen
2024-11-01 04:29:12
How does it work if pages themselves are internally implemented as frames?
CrushedAsian255
2024-11-01 04:30:56
I think each frame counts as a frame that page special frame with time code
Tirr
VcSaJen How does it work if pages themselves are internally implemented as frames?
2024-11-01 04:32:22
it's up to image viewer application, it could treat a frame with duration `0xffff_ffff` as the end of single animation and turn it into a page
w
2024-11-01 04:32:52
which means it DOESNT work
2024-11-01 04:33:00
because if there's no standard then there's no POiNT
Tirr
2024-11-01 04:33:45
durations are defined in the standard, and `0xffff_ffff` magic code is also in the standard
w
2024-11-01 04:34:03
then it shouldnt be up to the app
2024-11-01 04:34:36
if it's up to the app then it's a broken standard
CrushedAsian255
2024-11-01 04:35:40
As in the app can request to enable pagination
2024-11-01 04:36:01
Some apps don’t want to / don’t need to / can’t handle pages
w
2024-11-01 04:36:15
then all may as well not have it
A homosapien
2024-11-01 04:36:44
Oh God I hope this doesn't become another TIFF situation
w
2024-11-01 04:36:47
see: random features in every other format
2024-11-01 04:36:54
they may as well not exist
CrushedAsian255
2024-11-01 04:37:44
Just cause not everything will use a feature doesn’t mean it’s not useful for those which do support said feature
w
2024-11-01 04:39:48
nuh uh
CrushedAsian255
A homosapien Oh God I hope this doesn't become another TIFF situation
2024-11-01 04:42:48
TIFF PTSD
Tirr
2024-11-01 04:48:45
as I remember, an image has TPS, keyframes have their duration as unit of ticks, and if duration is `0xffff_ffff` then it's not an animated keyframe but a page in multipage image. how to interpret no-`0xffff_ffff` image and all-`0xffff_ffff` image is obvious, but how about mixed ones? I agree that it's not so clear, though the spec doesn't reject such images as invalid. then how should apps react to those images?
0xC0000054
VcSaJen I can't wait for default Jpeg XL support in Paint.net.
2024-11-01 05:15:26
Paint.NET's main developer (Rick Brewster a.k.a. rickbrew) recently said on the Paint.NET Discord that he wants to add JPEG XL support after 5.1 releases. Quoting that [post](<https://discord.com/channels/751565809972936735/1010984760782377160/1300910354766757959>): > After 5.1 stable releases I want to get JPEG XL support in the main app. Since the WIC codec that comes with Win11 v24H2 doesn’t actually work (just throws ComponentInitializeException), that leads me to think that out-of-processing libjxl could be a good direction to go in if it still exit()s
Quackdoc
2024-11-01 05:16:17
> Since the WIC codec that comes with Win11 v24H2 what?
2024-11-01 05:16:39
there is an included wic?
0xC0000054
Quackdoc there is an included wic?
2024-11-01 05:18:42
Yeah. But it doesn't work yet, hence why he is looking at bunding my Paint.NET JPEG XL plugin.
Quackdoc
2024-11-01 05:19:01
neat I guess, kinda
0xC0000054
Quackdoc neat I guess, kinda
2024-11-01 05:22:55
Sadly Microsoft has a history of shipping half-baked WIC codecs through their store. IIRC their WIC AVIF codec can't even open all of the test images they contributed to the AVIF test image repository because it lacks transparency support. 🤣
Quackdoc
2024-11-01 05:23:35
yeeee
Demiurge
Tirr as I remember, an image has TPS, keyframes have their duration as unit of ticks, and if duration is `0xffff_ffff` then it's not an animated keyframe but a page in multipage image. how to interpret no-`0xffff_ffff` image and all-`0xffff_ffff` image is obvious, but how about mixed ones? I agree that it's not so clear, though the spec doesn't reject such images as invalid. then how should apps react to those images?
2024-11-01 05:38:25
The spec needs to clarify this with specific guidance. Should the animation loop?
2024-11-01 05:41:36
And yes pages can theoretically reference previous pages since they are just frames, but someone actually needs to write an encoder that is smart enough to detect redundancy between frames and do that, which might not ever happen
Tirr
Demiurge The spec needs to clarify this with specific guidance. Should the animation loop?
2024-11-01 05:47:01
I guess the animation cannot loop, because the last frame doesn't have actual duration
0xC0000054
Demiurge The spec needs to clarify this with specific guidance. Should the animation loop?
2024-11-01 05:56:06
Yeah. I haven't read the spec, but I would have thought that mixing animations and multi-page images would be invalid. Using an animated frame duration of 0xffff_ffff to mean multi-page is a clever trick, but it makes the format harder to use versus having a basic_info field that specifies if a multi-frame image is an animation or not. Adding layer support is on my long-term feature Wishlist for the Paint.NET JPEG XL plugin, but I still need to reject animated images because my plugin does not have the UI for configuring animations.
username
0xC0000054 Paint.NET's main developer (Rick Brewster a.k.a. rickbrew) recently said on the Paint.NET Discord that he wants to add JPEG XL support after 5.1 releases. Quoting that [post](<https://discord.com/channels/751565809972936735/1010984760782377160/1300910354766757959>): > After 5.1 stable releases I want to get JPEG XL support in the main app. Since the WIC codec that comes with Win11 v24H2 doesn’t actually work (just throws ComponentInitializeException), that leads me to think that out-of-processing libjxl could be a good direction to go in if it still exit()s
2024-11-01 06:02:34
PDN 5.1 plans to have color management in some form right? depending on what that exactly entails (I haven't looked at the beta(s)) I assume your JXL plugin would have to be updated since iirc it currently converts JXLs to sRGB on decode
0xC0000054
username PDN 5.1 plans to have color management in some form right? depending on what that exactly entails (I haven't looked at the beta(s)) I assume your JXL plugin would have to be updated since iirc it currently converts JXLs to sRGB on decode
2024-11-01 06:12:20
Yes , 5.1 will have color management. Color management is one of several areas of the plugin's code that I will have to look into. I already have a bug where the plugin will tell Paint.NET use the embedded color profile without checking if it is RGB. Paint.NET doesn't currently support HBD, it only operates in 8-bits-per-channel. So I think the XYB to sRGB code may only need to tag the loaded document with a sRGB profile.
2024-11-01 06:13:13
I haven't looked at a lot of the new 5.1 APIs, but I will after it is released.
tufty
2024-11-01 07:06:14
HDR is the slightly mysterious part, for me anyway and getting chunked load/save working sigh
0xC0000054
tufty HDR is the slightly mysterious part, for me anyway and getting chunked load/save working sigh
2024-11-01 07:12:57
HDR is mysterious, I wrote an AVIF plugin for Photoshop and I still don't understand it. Are you writing your own encoder?
Tirr
2024-11-01 07:16:29
imo color management itself is very mysterious, I've written non-trivial amount of color management code (including HDR stuff) for jxl-oxide and I don't quite still get it 😅
username
2024-11-01 07:19:37
0xC0000054
Tirr imo color management itself is very mysterious, I've written non-trivial amount of color management code (including HDR stuff) for jxl-oxide and I don't quite still get it 😅
2024-11-01 07:22:34
Yeah. Color management is one of those complex things that are best left to specialized libraries like Little CMS. My AVIF Photoshop plugin has a hack to detect a few color profiles that can be represented as CICP values, and I also synthesize ICC profiles from the CICP values when loading as Photoshop doen't understand the CICP data.
Quackdoc
2024-11-01 07:49:22
one day I will make a rust color management library, the issue is my RSI prevents any serious coding sessions.
Tirr imo color management itself is very mysterious, I've written non-trivial amount of color management code (including HDR stuff) for jxl-oxide and I don't quite still get it 😅
2024-11-01 07:49:38
tbf, I'm pretty sure people intentionally make it as verbose and hard to look into as possible
2024-11-01 07:50:49
well, I mean unless you pay for paywalled specs. looking at you sRGB
w
2024-11-01 07:54:58
you will buy spectrophotometer and calibrate
tufty
0xC0000054 HDR is mysterious, I wrote an AVIF plugin for Photoshop and I still don't understand it. Are you writing your own encoder?
2024-11-01 07:58:11
I maintain libvips ... it has HDR (scRGB etc., so float channels with values that can be outside 0-1) and CM (with little CMS), I just need to link it to libjxl correctly
Quackdoc
2024-11-01 07:59:02
HDR is significantly easier to deal with then SDR because sRGB is such a mess
2024-11-01 07:59:13
hlg and Pq are very explicit
tufty
2024-11-01 07:59:25
I think ICC 4.4 profiles can do it, but there are odd cases, like ICC profiles for SDR with CICP data hidden in comments for HDR
2024-11-01 08:00:03
lcms refuse to add support for things like that (reasonably) so loaders have to do it
2024-11-01 08:01:06
or that's my understanding right now (probably wrong)
0xC0000054
2024-11-01 08:02:06
ICC profiles can have a CICP tag that is informational. I forget which ICC 4.X version added it, but I have used that feature.
Quackdoc
2024-11-01 08:02:29
I remember the first time I opened the spec for iccmax, I gave up on ICC that very moment
2024-11-01 08:02:40
that's ICC.2 iirc
_wb_
Demiurge The spec needs to clarify this with specific guidance. Should the animation loop?
2024-11-01 08:02:55
There is a header field for that. Animations can play a fixed number of times or loop infinitely.
0xC0000054
2024-11-01 08:03:46
This is off topic, but what are the requirements for a developer role? Contributing to libjxl?
_wb_
2024-11-01 08:05:32
Only question is what to do with looping if there are multiple pages that each contain an animation. I guess this is not clear: should each page show its animation looping, or does looping just mean that after the last page the next page is the first page again? (The latter would be my interpretation of the spec, but it should probably be made explicit)
0xC0000054 This is off topic, but what are the requirements for a developer role? Contributing to libjxl?
2024-11-01 08:07:21
It's just ad hoc, devs of other implementations of jxl and of other image libraries can also have that role. Would you like to nominate someone?
Dejay
Quackdoc one day I will make a rust color management library, the issue is my RSI prevents any serious coding sessions.
2024-11-01 08:07:36
<https://svalboard.com/> might be for you
Quackdoc
tufty I think ICC 4.4 profiles can do it, but there are odd cases, like ICC profiles for SDR with CICP data hidden in comments for HDR
2024-11-01 08:07:39
I know troy sobotka complained that only ICCMax was suitable for HDR images because some tags were unsuitable
Dejay <https://svalboard.com/> might be for you
2024-11-01 08:08:02
yeah, when I get some money, I plan on looking into them very indepth
Quackdoc I know troy sobotka complained that only ICCMax was suitable for HDR images because some tags were unsuitable
2024-11-01 08:09:16
``` So for starters, ICCs shouldn’t be used for HDR as they are literally domain bound. It would require ICCMax extensions to do it properly. ... If one is serious about fixing it, the wiser approach would be to use the non-domain bound ICCMax tags. And in the CMS, which would ideally be written from scratch for display work, leverage the appropriate ICCMax tags. At least if I were tasked with designing an appropriate path, that’s where I would certainly start. curv and para tags are explicitly domain bound in ICC, and scaling or other hacks do not seem prudent. And it would help unfuck the glaring fuckup in V4 regarding achromatic axis. ```
w
2024-11-01 08:09:31
ergonomics are not real (im on the computer for 18 hours a day and have 0 issues)
Quackdoc
w ergonomics are not real (im on the computer for 18 hours a day and have 0 issues)
2024-11-01 08:09:58
insert, <god I wish that were me> here
0xC0000054
_wb_ It's just ad hoc, devs of other implementations of jxl and of other image libraries can also have that role. Would you like to nominate someone?
2024-11-01 08:11:59
I was wondering whether I could get it assigned to myself. I maintain the Paint.NET JPEG XL plugin (which uses libjxl).
tufty
Quackdoc ``` So for starters, ICCs shouldn’t be used for HDR as they are literally domain bound. It would require ICCMax extensions to do it properly. ... If one is serious about fixing it, the wiser approach would be to use the non-domain bound ICCMax tags. And in the CMS, which would ideally be written from scratch for display work, leverage the appropriate ICCMax tags. At least if I were tasked with designing an appropriate path, that’s where I would certainly start. curv and para tags are explicitly domain bound in ICC, and scaling or other hacks do not seem prudent. And it would help unfuck the glaring fuckup in V4 regarding achromatic axis. ```
2024-11-01 08:12:53
ICC 4.4 adds a full float path with parametric curves and out of range values, so you can do HDR with plain ICC profiles or that's what mm (lcms maintainer) says I think
Quackdoc
2024-11-01 08:13:51
that would likely help for sure then. I know this was back in like 2020 so it's refering to 4.3
2024-11-01 08:14:22
all I know, is that the ICC spec sucks to go through, I pity people working on it lol
tufty
2024-11-01 08:14:42
of course only other icc 4.4 programs will be able to consume your profiles sigh /shoots self
w
2024-11-01 08:15:13
of which there are 0 because icc 2 is the best
Dejay
2024-11-01 08:15:13
I can't think of really great use cases for animated multi pages. Like animated comics or presentations, but then you could also create some ad-hoc format to bundle webm files and an app to play it
Quackdoc
2024-11-01 08:15:16
ICC needs to be retired, I hope we find a better way soon, oh well, jxl metadata is good
tufty
2024-11-01 08:15:28
I have to work with DICOM as well, so the ICC spec seems OK to me hehe
2024-11-01 08:15:43
(the DICOM spec is a 2,800 page PDF)
Quackdoc
w of which there are 0 because icc 2 is the best
2024-11-01 08:16:16
v2 or icc.2 because I would rather play dodgeball with a wreckingball then use icc.2
w
2024-11-01 08:16:24
v2 is the best
2024-11-01 08:16:41
according to argyll
tufty
2024-11-01 08:17:23
I think libvips will do multipage jxl or animated JXL, but not both in a mix
Quackdoc
2024-11-01 08:17:31
yeah, v2 is woefully inadequate. but at least it's doesn't make you want to play free fall trying to implement it
tufty I think libvips will do multipage jxl or animated JXL, but not both in a mix
2024-11-01 08:17:54
I think that's probably safe lol
0xC0000054
tufty (the DICOM spec is a 2,800 page PDF)
2024-11-01 08:21:10
Not surprising. DICOM is a medical imaging standard, so I would guess it picked up a lot of different format extensions over the years. But 2,800 pages is crazy for a single PDF, I would have thought it would be split into different sections that are each their own PDF.
tufty
0xC0000054 Not surprising. DICOM is a medical imaging standard, so I would guess it picked up a lot of different format extensions over the years. But 2,800 pages is crazy for a single PDF, I would have thought it would be split into different sections that are each their own PDF.
2024-11-01 08:26:26
that's when you add the whole lot up, there are lot of more digestible versions but it's a *very* big standard, and somewhat TIFF-like, in that it's easy to write a DICOM, but the format is so flexible it's very hard (impossible?) to read an arbitrary DICOM someone might give you
_wb_
2024-11-01 08:48:34
I don't really get why you would design a format the TIFF way, that is, maximizing encoder convenience by requiring no normalization at all. Big endian or little endian? White is maxval or black is maxval? Etc etc. TIFF just allows all possible combinations so an encoder can basically just do a memcpy of whatever internal buffer format they have, but a decoder has to be able to deal with anything...
tufty
2024-11-01 09:07:25
yes, TIFF is like markup, it's descriptive not proscriptive
2024-11-01 09:08:10
i doubt if anyone has ever implemented a TIFF reader than can do all TIFF files
w
2024-11-01 09:08:12
that's kinda what happened with jpegxl no?
Dejay
2024-11-01 09:16:55
Is there a command line tool to "pack" multiple jxl files into one multi-page jxl file? And then unpack them again? That should at least be possible theoretically right?
_wb_
w that's kinda what happened with jpegxl no?
2024-11-01 09:18:17
How do you mean?
Dejay
2024-11-01 09:18:19
Not sure if an unpack would actually be that useful except for jpeg
w
2024-11-01 09:19:51
there's just too much with the format
2024-11-01 09:19:57
nobody knows what to do with pages and animation
2024-11-01 09:20:06
lossless lossy patches
2024-11-01 09:20:13
modular vardct splines
_wb_
Dejay Is there a command line tool to "pack" multiple jxl files into one multi-page jxl file? And then unpack them again? That should at least be possible theoretically right?
2024-11-01 09:20:26
Possible, yes, but tricky in the general case. There are some constraints too, e.g. you cannot mix XYB and non-XYB jxl since that's a global property, not a frame property.
w there's just too much with the format
2024-11-01 09:22:24
The difference is that in jxl all decoder complexity is motivated: it either brings more functionality or (potential for) better compression. In TIFF much of the decoder complexity is only there to make life easy for encoders.
Quackdoc
tufty i doubt if anyone has ever implemented a TIFF reader than can do all TIFF files
2024-11-01 09:34:47
for me, I just care if oiiotool can decode it lol
lonjil
w nobody knows what to do with pages and animation
2024-11-01 10:16:36
it's quite clearly defined in the standard
w
2024-11-01 10:58:36
not according to the recent chat here
CrushedAsian255
2024-11-01 12:27:28
It is defined we just all forgor
jonnyawsom3
2024-11-01 12:29:38
Not in 18181-1 at least, this is the entirety that mentions pages > If duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image.
CrushedAsian255
2024-11-01 12:31:43
Ah you mean pages *and* animation in the **same** image
jonnyawsom3
2024-11-01 12:39:42
Personally, I'd assume you treat each page like it's own image/animation, with the user moving forward and back and looping applying to the animations. Since it's far more useful than just going back to the first page, which you can already do by reloading, viewer settings, TOC, ect
2024-11-01 12:41:18
Otherwise you'll end up with animations ending before you've even read the context around it
Demiurge
Tirr I guess the animation cannot loop, because the last frame doesn't have actual duration
2024-11-01 12:48:46
That's exactly why the spec should clarify
CrushedAsian255
Otherwise you'll end up with animations ending before you've even read the context around it
2024-11-01 12:54:34
Problem is the last page has a time code of 0xffffffff so how long is the last frame last
_wb_
2024-11-01 12:56:48
You could ignore the last frame and loop the rest, and use a dummy empty frame to mark page boundaries, I guess.
CrushedAsian255
_wb_ You could ignore the last frame and loop the rest, and use a dummy empty frame to mark page boundaries, I guess.
2024-11-01 12:57:41
Having a dummy frame doesn’t seem particularly elegant though
2024-11-01 12:57:52
Also that would clash with how non animated pages work
2024-11-01 12:58:01
As they have 1 frame so it would just get ignored
_wb_
2024-11-01 12:58:45
Multiple pages with looping animations on the pages is a bit of a specific thing, though I guess it could make sense for something like a slide deck
CrushedAsian255
CrushedAsian255 As they have 1 frame so it would just get ignored
2024-11-01 01:01:12
Actually it could probably be worded like “the frame with 0xffffffff is processed as if it had a time code of 0”
2024-11-01 01:01:53
Idea; maybe it could be used as some kind of alternate frame for if the system doesn’t want to handle animated pages
2024-11-01 01:02:16
Like if the system supports animated pages, play frames 1 to N-1, if not then play frame N
2024-11-01 01:02:26
so it would not be a wasted frame
Demiurge
_wb_ You could ignore the last frame and loop the rest, and use a dummy empty frame to mark page boundaries, I guess.
2024-11-01 01:05:13
That's also what I was thinking but it's still something the spec ideally provides guidance and clarification on
_wb_
2024-11-01 01:05:27
A dummy noop frame only costs a few bytes to signal
Demiurge
2024-11-01 01:06:53
Worst case scenario you could use a tiff container :)
_wb_
Demiurge That's also what I was thinking but it's still something the spec ideally provides guidance and clarification on
2024-11-01 01:07:31
Yes. For now I am not aware of applications that can show multi-page animated jxl in a sensible way, but if there are some, we should have a good convention for how to do it and put it in the next edition of the spec.
CrushedAsian255
2024-11-01 01:08:39
I just feel like that “dummy” frame should be able to do something
jonnyawsom3
2024-11-01 01:09:00
Well, you could name it the page number, ect
CrushedAsian255
2024-11-01 01:09:59
Also it’s interprets different to how non animated pages work Non animated pages: 0xffffffff means that frame is a page Animated pages: 0xffffffff means to skip this frame and next frame is a new page
jonnyawsom3
2024-11-01 01:10:56
For animated it could inherit the previous frame duration, but that is a bit limiting
CrushedAsian255
2024-11-01 01:11:51
Actually it could just be “a frame with length of 0xffffffff is processed as if it has a length of 0”
2024-11-01 01:12:23
That would solve the interpretation issue
2024-11-01 01:12:37
As for non animated pages 0 is expected and for animated it means skip
Well, you could name it the page number, ect
2024-11-01 01:14:39
Wouldn’t you ideally want the page name to be stored in the first frame of the page?
_wb_
2024-11-01 01:17:09
I kind of like the idea of using the last frame of an animated page as an optional alternative page for non-animated display, e.g. when printing it.
2024-11-01 01:18:17
(or when showing it on a website when 'prefers-reduced-motion' is enabled)
jonnyawsom3
Not in 18181-1 at least, this is the entirety that mentions pages > If duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image.
2024-11-01 01:18:46
> If duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. Animated pages will use an optionally empty frame to mark the end of a sequence, interpreted as duration 0 by the decoder. If animation is not supported, the frame with duration 0xFFFFFFFF will be decoded instead. ?
CrushedAsian255
2024-11-01 01:18:53
Only thing is a page with 2 frames would technically be a 1 frame animation and would show up as differently with and without animation enabled, although that could be helpful in some situations, like as you say with prefer reduced motion
_wb_
2024-11-01 01:19:48
"Animated page" needs to be defined. I guess it's any page containing frames of nonzero duration.
jonnyawsom3
2024-11-01 01:20:03
Yeah, just a rough draft
CrushedAsian255
> If duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. Animated pages will use an optionally empty frame to mark the end of a sequence, interpreted as duration 0 by the decoder. If animation is not supported, the frame with duration 0xFFFFFFFF will be decoded instead. ?
2024-11-01 01:21:00
> If the duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. Any page with frames with nonzero duration shall treat the frame with duration 0xFFFFFFFF as an “alternate frame”, which is to be decoded when animation is disabled.
2024-11-01 01:21:03
How’s this
2024-11-01 01:21:25
I’m not great with specification-ese
jonnyawsom3
2024-11-01 01:29:01
> If the duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. > If `metadata.have_animation` is `true`, any page with nonzero duration frames shall treat the frame with duration 0xFFFFFFFF as a “static page”, which is to only be decoded when animation is disabled. I think this better explains what it's purpose is, although maybe it should be the last nonzero frame instead since it's already been decoded at this point
Demiurge
CrushedAsian255 Wouldn’t you ideally want the page name to be stored in the first frame of the page?
2024-11-01 01:29:47
I would think the table of contents would be best
CrushedAsian255
> If the duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. > If `metadata.have_animation` is `true`, any page with nonzero duration frames shall treat the frame with duration 0xFFFFFFFF as a “static page”, which is to only be decoded when animation is disabled. I think this better explains what it's purpose is, although maybe it should be the last nonzero frame instead since it's already been decoded at this point
2024-11-01 01:31:03
What series an empty frame?
2024-11-01 01:31:44
I don’t think that is really necessary as how much space does it take to say “make one big patch from the previous frame”
jonnyawsom3
2024-11-01 01:32:40
Let me tweak it
Demiurge
2024-11-01 01:33:02
Each page can have its own separate canvas size/dimensions right?
CrushedAsian255
2024-11-01 01:34:05
Yes , which seem to be allowed to be zero for some reason..!
Demiurge
Quackdoc one day I will make a rust color management library, the issue is my RSI prevents any serious coding sessions.
2024-11-01 01:36:26
A lot of Dvorak layout users claim the improved layout ergonomics helps with their RSI
jonnyawsom3
2024-11-01 01:37:09
Changed it a bit. Maybe just best to keep it simple and not mention specifically using a patch or a blend mode. Worst case it would just be the last frame of an animation, best case the software allows setting a static page image
> If the duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. > If `metadata.have_animation` is `true`, any page with nonzero duration frames shall treat the frame with duration 0xFFFFFFFF as a “static page”, which is to only be decoded when animation is disabled. I think this better explains what it's purpose is, although maybe it should be the last nonzero frame instead since it's already been decoded at this point
2024-11-01 01:42:32
Right... I *think* that works?
_wb_
2024-11-01 02:01:34
Have_animation is always true for multi-page, otherwise there are no frame durations...
jonnyawsom3
2024-11-01 02:14:50
Ah right, was on mobile until now so reading the spec was... Less than ideal...
_wb_
2024-11-01 02:28:18
> If the duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. In case the current page contains an animation, that is, frames with a non-zero duration have occurred after the previous page boundary (or since the start of the codestream, if it is the first page), then this frame is ignored until the animation has been repeated as many times as implied by `animation.num_loops` (i.e. it is ignored forever in case of an infinitely looping animation). Animation loops restart at the beginning of the current page and the loop count is reset at each page boundary. Applications that want to render a multi-page image without animations (e.g. for printing or for displaying page thumbnails) render each page as it is just before the page boundary, i.e. including the contents of the frame with duration 0xFFFFFFFF.
2024-11-01 02:28:24
how about something like that?
jonnyawsom3
2024-11-01 02:38:51
Sounds good to me
Demiurge
2024-11-02 02:46:39
Sounds pretty clever, I like it.
CrushedAsian255
2024-11-02 02:49:43
ah great a version 3 of the spec -_-
jonnyawsom3
2024-11-02 08:23:12
If we were doing that we could add UltraHDR transcoding :P
CrushedAsian255
_wb_ > If the duration has the value 0xFFFFFFFF, the decoder presents the next frame as the next page in a multi-page image. In case the current page contains an animation, that is, frames with a non-zero duration have occurred after the previous page boundary (or since the start of the codestream, if it is the first page), then this frame is ignored until the animation has been repeated as many times as implied by `animation.num_loops` (i.e. it is ignored forever in case of an infinitely looping animation). Animation loops restart at the beginning of the current page and the loop count is reset at each page boundary. Applications that want to render a multi-page image without animations (e.g. for printing or for displaying page thumbnails) render each page as it is just before the page boundary, i.e. including the contents of the frame with duration 0xFFFFFFFF.
2024-11-02 08:24:55
LGTM 🚀
Demiurge
2024-11-02 06:47:34
UltraHDR is a pointless technology no one asked for...
2024-11-02 06:48:16
Yet another half baked format
2024-11-02 06:49:35
Doesn't jpeg xt also have gain maps in a backwards compatible way?
2024-11-02 06:50:05
So in other words it's just reinventing the wheel?
CrushedAsian255
Demiurge Doesn't jpeg xt also have gain maps in a backwards compatible way?
2024-11-03 01:33:40
problem with JXT is they don't really like ISO formats, something something paywalled spec something something
_wb_
2024-11-03 07:16:59
So they concatenate two ISO/IEC 10918 bitstreams because ISO/IEC 18477 is an ISO format?
Demiurge
2024-11-03 10:51:33
Also open source encoders are available
2024-11-03 10:51:48
And they have money
2024-11-03 10:52:00
They like paying for things. It makes them feel important
2024-11-03 10:52:32
Especially when it's really official sounding and pretentious looking like ISO
2024-11-03 10:53:16
It makes them feel soooo legitimate and professional and like a real boy
2024-11-03 10:53:56
Like the fairy godmother coming down from heaven to grant their wish to be real
2024-11-03 11:00:26
Oh won't you sign up your name? We'd like to see you're acceptable, presentable, oh respectable, a vegetable... And watch what you say! They'll be calling you a radical! A liberal! Oh, fanatical, criminal! Take take take it yeah! (sax solo)
Dejay
2024-11-03 11:12:40
Can you remove adaptive / --photon_noise_iso from a jxl again for further editing / conversion / compression?
spider-mario
2024-11-03 11:15:21
it’s theoretically possible, but I don’t think the current tools allow it
_wb_
2024-11-03 11:24:57
Wouldn't be hard to add a decode option to skip noise, if we don't already have that.
Dejay
2024-11-03 11:26:39
Thanks, I found an issue for "jxltran" that already suggests this: <https://github.com/libjxl/libjxl/issues/871>
CrushedAsian255
2024-11-03 11:28:40
maybe some kind of advanced JPEG XL editor which lets you control all the intricate details
2024-11-03 11:29:03
jxltran --allow_expert_options
Demiurge
2024-11-04 05:51:28
Allow expert options really ought to be a compile time option 😂
2024-11-04 05:51:36
Not runtime
2024-11-04 05:52:21
Also if the original image has photon noise, technically you would be degrading the fidelity of the image by removing/omitting it
2024-11-04 05:53:42
I would not recommend it. Whatever codec you're re transcoding to should be smart enough to detect it and replace it with synthesized noise
jonnyawsom3
2024-11-04 05:53:53
Well, that depends how accurate the noise was to start with
Demiurge
2024-11-04 05:54:53
And you shouldn't do lossy to lossy anyways...
2024-11-04 05:55:45
The noise is just as much a part of the image content as color or any other image feature
jonnyawsom3
2024-11-04 05:56:44
Which is why I wish lossless photon noise was better supported, two versions of the image for a few hundred bytes
Demiurge
2024-11-04 05:57:33
What? Lossless photon noise?
jonnyawsom3
2024-11-04 05:57:55
Yeah
CrushedAsian255
2024-11-04 05:57:55
isn't noise inheriently random data ?
2024-11-04 05:58:04
why would you need *it* of all things to be lossless
2024-11-04 05:58:23
that's just burning bits to store effectively RANDOM.ORG data in your files
jonnyawsom3
2024-11-04 05:58:25
JXL noise is seeded, but either way I'm talking about the image data underneath
2024-11-04 05:59:13
Currently it applies the photon noise in XYB instead of RGB for lossless encoding
2024-11-04 06:01:02
I've seen more than enough artwork which is uploaded as "Lossless" on a Patreon only to have ISO 3200 noise splattered over the top making it a 50MB file for what used to be a fairly smooth shaded image
Demiurge
2024-11-04 06:01:18
I don't know what you mean by lossless photon noise support
jonnyawsom3
2024-11-04 06:01:33
Photon noise on a lossless JXL
CrushedAsian255
2024-11-04 06:01:38
ahh
2024-11-04 06:01:43
then its not lossless though
2024-11-04 06:02:05
i guess you mean some kind of parameter that lets you set the photon noise and then it can be removed later as an artistic choice?
jonnyawsom3
Which is why I wish lossless photon noise was better supported, two versions of the image for a few hundred bytes
2024-11-04 06:02:25
> Two versions of the image for a few hundred bytes
CrushedAsian255
2024-11-04 06:03:00
iirc photon noise is a per frame thing..?
2024-11-04 06:03:05
you could have a 2 frame image
Demiurge
2024-11-04 06:03:23
What would the point be of having a lossy feature put into a lossless file
jonnyawsom3
CrushedAsian255 i guess you mean some kind of parameter that lets you set the photon noise and then it can be removed later as an artistic choice?
2024-11-04 06:03:24
Not even that, just change the colorspace with the image space to avoid the current red-blue noise it outputs
CrushedAsian255
2024-11-04 06:04:05
one frame without noise and the other frame being ``` All { Predictor: {Set 0} } Patch { frame: 0, width: image_width, height: image_height, x: 0, y: 0 } PhotonNoise { iso: 3200 } ``` ?
jonnyawsom3
Demiurge What would the point be of having a lossy feature put into a lossless file
2024-11-04 06:04:22
Not having a second lossless file that's 20x the filesize
CrushedAsian255 one frame without noise and the other frame being ``` All { Predictor: {Set 0} } Patch { frame: 0, width: image_width, height: image_height, x: 0, y: 0 } PhotonNoise { iso: 3200 } ``` ?
2024-11-04 06:05:25
That is another way to do it that's been described before
Demiurge
2024-11-04 06:06:05
So it's a file that has the noise removed and replaced by synth noise?
CrushedAsian255
2024-11-04 06:06:27
lossless *and* we removed the noise!
jonnyawsom3
2024-11-04 06:06:58
A file that has synth noise instead of a noise filter applied in Photoshop for example
CrushedAsian255
2024-11-04 06:07:18
that would be ˜nice˜
2024-11-04 06:07:24
how tf did that symbol happen
Demiurge
Currently it applies the photon noise in XYB instead of RGB for lossless encoding
2024-11-04 06:08:01
Is that a spec bug or a libjxl bug? Sounds like a libjxl bug
A file that has synth noise instead of a noise filter applied in Photoshop for example
2024-11-04 06:09:21
You have already traveled miles away from any semblance of lossless after getting those heavy duty filters involved
A homosapien
2024-11-04 06:11:04
If I hallucinate hard enough, all files are lossless really <:galaxybrain:821831336372338729>
2024-11-04 06:11:12
It's just a matter of perception
CrushedAsian255
2024-11-04 06:12:10
\> encode image to quality 1 jpeg \> re-encode image to png \> publish as "lossless" \> profit
jonnyawsom3
Demiurge Is that a spec bug or a libjxl bug? Sounds like a libjxl bug
2024-11-04 06:13:02
> Using the additive noise AR, AG, AB and the strength SR and SG, the X, Y and B samples of each input pixel are modulated as specified by the following code, in which base_correlation_x and base_correlation_b are defined in I.2.3. Hmmm
CrushedAsian255
2024-11-04 06:13:31
so it only works for XYB?
2024-11-04 06:13:34
no way to do RGB?
jonnyawsom3
Demiurge You have already traveled miles away from any semblance of lossless after getting those heavy duty filters involved
2024-11-04 06:13:47
Don't blame me, blame the artists that insist noise is a vital component of their digital artwork :P
CrushedAsian255
2024-11-04 06:15:05
what do you think of my amazing music!
_wb_
2024-11-04 08:42:40
It is a bit annoying that you cannot mix XYB and RGB in a single image, but that would have complicated things too much. For the art-with-noise thing, you'll have to use d0.1 or something to get the nice noise.
Fox Wizard
CrushedAsian255 what do you think of my amazing music!
2024-11-04 09:27:01
Very beautiful song. All those frequencies are in perfect harmony
spider-mario
2024-11-04 09:30:43
a very accessible foray into microtonality and polymetre as well
_wb_ It is a bit annoying that you cannot mix XYB and RGB in a single image, but that would have complicated things too much. For the art-with-noise thing, you'll have to use d0.1 or something to get the nice noise.
2024-11-04 12:01:33
(or use lossless AVIF)
2024-11-04 12:01:43
_ducks_
_wb_
2024-11-04 12:28:40
if you want really fancy artistic noise, you can also consider making some jxl art noise patterns and alpha blending or patch blending it over your image 🙂
HCrikki
2024-11-04 07:47:39
updated 3rd-party jxl addon for Paint.NET integrates libjxl 0.11.0 in place of 0.8.2 previously PDN author wants jxl out of the box so updated working support in the addon helps get there
Dejay
2024-11-05 06:46:48
Photon noise looks pretty nice to break up the monotony of some images or shading. Similar to paper texture in a book.
2024-11-05 06:46:50
So you might have a (near) lossless master image with photon noise that you archive and then want to create a web version from it. But when you recompress it with cjxl it becomes bigger! So you'd want cjxl to detect and remove synth photon noise, then reapply the same parameters when re-encoding.
2024-11-05 06:47:05
That was my thought, not sure how many people actually use it though
2024-11-05 06:47:26
There is a similar issue with AV1 too
2024-11-05 06:58:13
For video it helps when you reduce the bitrate too much and things become too smooth, to add "faux detail" so the video doesn't look so synthetic
2024-11-05 06:58:41
For pictures I imagine the same, also it's like better dithering
2024-11-05 07:09:42
I mean say what you want about jpg artifacts, but the do create new detail!
2024-11-05 07:10:11
Sometimes you never miss something until you loose it 😄
jonnyawsom3
2024-11-05 07:21:38
You made me stumble across this while looking for something else https://docs.amd.com/r/en-US/Vitis_Libraries/codec/guide_L2/kernels/jxlEnc.html
2024-11-05 07:28:21
Seems to be an FPGA implementation
2024-11-05 07:31:51
Dejay
2024-11-05 07:37:47
Oh nice it's a compute implementation not CPU or hardware
jonnyawsom3
2024-11-05 07:42:59
Ah
Dejay Oh nice it's a compute implementation not CPU or hardware
2024-11-05 10:58:48
Looked into it more and no, this is a WIP FPGA implementation for silicon, unless I'm reading it wrong
Dejay
Looked into it more and no, this is a WIP FPGA implementation for silicon, unless I'm reading it wrong
2024-11-05 01:05:04
Oh sorry, I assumed because of "_compute". But hardware makes more sense
Demiurge
2024-11-05 05:01:15
What does the non-xyb noise look like
2024-11-05 05:03:35
Is it a bug if a non xyb file has photon noise?
_wb_
2024-11-05 05:27:31
no
2024-11-05 05:28:25
it just doesn't look that nice, since it gets applied to RGB instead of XYB so it makes much less sense perceptually
jonnyawsom3
Demiurge What does the non-xyb noise look like
2024-11-05 05:43:33
It mostly appears teal, but in brigher areas there's some red too
2024-11-05 05:44:51
`--photon_noise_iso=64000` with just `-d 0` to make it RGB with lossless. Interestingly the encode speed also slows down massively
2024-11-05 05:50:16
Weirdly it also allows an extra 0 on the value when JPEG transcoding
lonjil
2024-11-05 07:55:23
it's called photon noise, but it doesn't oeprate correctly on physical light data? 😭
_wb_
2024-11-05 08:36:46
It was designed for XYB, that is it assumes the second component is luma and that changing it does not change the color. This is not true for the G component of RGB.
lonjil
2024-11-05 08:38:54
Would it work well with permuted YCoCg? 😄
_wb_
2024-11-05 09:07:38
Better, I guess. But modular RCTs are undone before applying noise, sadly.
Quackdoc
Looked into it more and no, this is a WIP FPGA implementation for silicon, unless I'm reading it wrong
2024-11-06 09:11:42
its both
2024-11-06 09:11:57
> The AMD Vitis™ software platform is a development environment for developing designs that includes FPGA fabric, Arm® processor subsystems, and AI Engines.
2024-11-06 09:12:50
well in theory, if it's designed for fpga, assume it will only be good on fpga
2024-11-06 09:15:35
vitis specifically is, and I quote > Vitis Codec Library is an open-sourced library written in HLS C/C++ for the acceleration of image processing. It aims to provides reference designs for image codec algorithms that fit the Xilinx Alveo Series acceleration cards. The APIs in Vitis Codec Library have been classified into two layers, namely L1/L2. Each targets to serve different audience.
Dejay
It mostly appears teal, but in brigher areas there's some red too
2024-11-06 09:37:28
So is this going to be fixed in the decoder? It seems you'd just need to apply/covert the noise layer differently when lossless decoding
2024-11-06 09:43:22
Interestingly the right looks more like digital sensor noise
2024-11-06 09:46:17
I wish the film grain in av1 would look like photon noise. Afaik in av1 it's only 1 pixel large, so higher resolution changes the perception of it
2024-11-06 09:47:53
I know film grain is different phenomenon, but imho photon noise is what you really want because it's a quantum phenomenon of the sensor size. Afaik our visual cortex constantly filters photon noise
CrushedAsian255
2024-11-06 09:49:05
film grain is more just like adding a special effect it ends up feeling like
Dejay
2024-11-06 09:52:34
I suspect it's somehow pleasurable to our visual cortex because we're always looking for detail, so detailed images have their own beauty. And filtering detail from noise is "fun" because we're so good at it
BlueSwordM
Dejay I wish the film grain in av1 would look like photon noise. Afaik in av1 it's only 1 pixel large, so higher resolution changes the perception of it
2024-11-07 02:35:09
Sir Dejay, photon noise does exist in AV1 stuff. We've been using it for years as another form of different looking grain synthesis.
spider-mario
Dejay I wish the film grain in av1 would look like photon noise. Afaik in av1 it's only 1 pixel large, so higher resolution changes the perception of it
2024-11-07 09:34:03
https://aomedia.googlesource.com/aom/+/refs/heads/main/examples/photon_noise_table.c
CrushedAsian255
2024-11-07 10:11:30
JPEG XL would be perfect for PDF/A
Dejay
BlueSwordM Sir Dejay, photon noise does exist in AV1 stuff. We've been using it for years as another form of different looking grain synthesis.
2024-11-07 10:27:41
Huh maybe I got it wrong. I assumed the photon noise in jxl can be lower frequency or the "photon grain" can be larger than one pixel. Afaik if you take a photo with a 1" sensor, the frequency of the photon noise should be fixed no matter what resolution you scan. So the noise frequency should stay the same between 2160p and 1080p, which isn't the case for av1. But I think it isn't the case for jxl either
CrushedAsian255
2024-11-07 10:28:08
isn't it controllable ?
Dejay
2024-11-07 10:35:50
Well now I don't know any more. Theoretically the frequency or "size" of the photon noise should be dependent on focus length and sensor size, not on the resolution. Maybe I fooled myself thinking it looks different in jxl 😄
CrushedAsian255
2024-11-07 10:40:07
is photon noise based on IP address or by focal length?
spider-mario
Dejay Well now I don't know any more. Theoretically the frequency or "size" of the photon noise should be dependent on focus length and sensor size, not on the resolution. Maybe I fooled myself thinking it looks different in jxl 😄
2024-11-07 10:46:03
frequency depends on resolution rather than focal length, AFAICT
CrushedAsian255
2024-11-07 10:46:58
also did i just say IP address lol i mean ISO
spider-mario
2024-11-07 12:28:45
in the libjxl/aom implementation, ISO is just used as a proxy for the focal plane exposure that the image was probably made from
2024-11-07 12:32:36
in principle, ISO should be more or less “10 lx·s ÷ ‘focal exposure of a mid-tone’ ”, and that will be true of the processed image generated by the camera (if you hold ISO and exposure fixed, the resulting image will look dark or bright on that basis; if you keep ISO fixed but exposure floating, it will try to target an exposure that makes the image look good; and if you keep the exposure fixed and ISO floating, it will roughly match the ISO to that exposure, such that the output image looks good)
2024-11-07 12:33:20
but if you then take the raw image and develop it independently, the correspondence might break unless you recompute an appropriate ISO value (which a recent amendment to ISO 12232:2019 allows)
CrushedAsian255
2024-11-07 12:34:27
https://tenor.com/view/jfk-clone-high-i-like-your-funny-words-magic-man-jack-black-gif-18659433
2024-11-07 12:34:35
I don’t really do photography
2024-11-07 12:35:06
All I know is light + camera = image
spider-mario
2024-11-07 12:35:16
https://www.iso.org/standard/79168.html > The ERS can be used when > - a camera records a processed file, either scene‐referred or output‐referred, or > - a camera raw file is processed. > > Additionally, in the raw file processing case, the ERS to be recorded in the file can be displayed by the raw processing software, to allow it to be set to a specific value by the user.
jonnyawsom3
2024-11-07 01:04:47
I do wonder if cjxl could check for an ISO EXIF tag to match photon noise too, but without the adaptive noise learning it probably wouldn't match (not actually sure if that code still works, seems to just use a lot of time and memory to do nothing)
spider-mario
2024-11-07 02:37:46
one thing that would be hard to estimate the impact of is noise reduction (the code simulates the noise one would get without it, but it would be rare for there not to be any)
2024-11-07 02:38:04
(also, there’s still that unknown factor by which the libjxl version is off)
Mine18
2024-11-08 09:38:11
posted on Reddit: https://www.obviousidea.com/announce_light_image_resizer_7-1_native_jxl_support/
username
2024-11-09 12:10:07
https://github.com/Aleksoid1978/MPC-BE/releases/tag/1.8.1
jonnyawsom3
2024-11-09 12:28:14
> Added support for JPEG XL image files for the logo and album art (requires WIC decoder installed). Can't tell if they mean the broken Windows 11 one or this https://github.com/saschanaz/jxl-winthumb
username
2024-11-09 12:29:14
I think it might just check for any WIC codec that registers itself for ".jxl"
2024-11-09 12:29:52
commit is here: https://github.com/Aleksoid1978/MPC-BE/commit/d50af6fd4ccc18922b7abb200dc2c5c37fccf806
Quackdoc
2024-11-09 08:31:22
so what browsers for android current support jxl [Hmm](https://cdn.discordapp.com/emojis/1113499891314991275.webp?size=48&quality=lossless&name=Hmm)
Mine18
Quackdoc so what browsers for android current support jxl [Hmm](https://cdn.discordapp.com/emojis/1113499891314991275.webp?size=48&quality=lossless&name=Hmm)
2024-11-09 09:31:28
probably Thorium and Firefox Nightly (maybe?)
2024-11-09 09:33:12
could try regular firefox with a jxl extension
Quackdoc
Mine18 probably Thorium and Firefox Nightly (maybe?)
2024-11-09 09:39:12
thorium works, relationship with cromite ended
yoochan
2024-11-09 10:24:41
Waterfox mobile doesn't
HCrikki
2024-11-09 01:42:53
its not gone from cromite, it will restore it at some point and iinm is in debug builds. upstream chromium enforced a new parameter cromite author is afaik still researching how it affects his changes
2024-11-09 01:46:25
existing or WIP, the integrations always need eyeballs and testing to confirm things work as supposed to - even early adopters lack understanding of many concepts introduced in jxl compared to the old formats and any help there can get wips and test branches reach stable and sooner
Quackdoc
2024-11-09 02:28:29
good cause thorium crashing for me now lol
VcSaJen
2024-11-09 05:47:02
Waterfox still crashes the tab when CMYK jxl is accessed.
Quackdoc
2024-11-09 06:02:14
lol
CrushedAsian255
Quackdoc good cause thorium crashing for me now lol
2024-11-09 10:32:45
could be this issue https://github.com/Alex313031/Thorium-MacOS/issues/67#issuecomment-2448952447
Meow
2024-11-10 11:44:57
https://www.waterfox.net/docs/releases/6.5.1/ > Updated the JPEG-XL library to the latest version. This should stop various websites that serve .jxl files from crashing in the tab they’re loaded.
2024-11-10 11:45:09
that -
HCrikki
2024-11-10 04:39:30
image hosting script Picsur freshly added jxl as a conversion target with sharable links (for 0.5.7 or next release). Its pretty much an imgur clone with autoconversion
2024-11-10 04:39:34
https://github.com/CaramelFur/Picsur/commit/5b1f0a59bcd9e3a849ec51e92064cbc036d91a19
jonnyawsom3
2024-11-10 04:43:58
*Definately* doesn't have transcoding support, but nice nonetheless
Demiurge
2024-11-11 01:55:34
Definitely
jonnyawsom3
2024-11-11 11:08:55
Definitely
CrushedAsian255
2024-11-11 12:29:19
Definitely
spider-mario
2024-11-11 12:35:00
Defiantly
CrushedAsian255
2024-11-11 12:35:37
Deafeningly
_wb_
2024-11-11 01:42:52
Definitively
CrushedAsian255
2024-11-11 01:43:13
Distractingly
Foxtrot
2024-11-11 03:05:22
`def init(): ely()`
Oleksii Matiash
2024-11-13 10:06:26
Include gain maps to jxl, great idea 🤦‍♂️
CrushedAsian255
2024-11-13 10:07:28
i hope this is hdr to sdr gain maps and not the other way round
2024-11-13 10:08:05
HDR -> SDR makes a little bit of sense, something something artistic control, SDR to HDR gain maps only exists for backwards compatibility, which isn't a concern for JPEG XL
Oleksii Matiash
2024-11-13 10:10:29
Seems no, not the only way
CrushedAsian255
2024-11-13 10:11:03
can you export one and send it
Oleksii Matiash
CrushedAsian255 can you export one and send it
2024-11-13 10:28:15
2024-11-13 10:29:22
It was real hdr, no gain mapped
2024-11-13 10:30:33
And this one is with "maximize compatibility' checked, twice in size, so probably gain map is there
2024-11-13 10:31:25
Still no direct jxl support in Photoshop 2025, only via Camera Raw 😦
CrushedAsian255
2024-11-13 10:32:03
``` box: type: "jhgm" size: 3807293, contents size: 3807285 Gain map (jhgm) box: version = 0, 3807136-byte gain map, 141-byte metadata ```
2024-11-13 10:32:08
not sure which way round that goes
2024-11-13 10:32:54
I am guessing it's HDR -> SDR, as the `jxlp` box is the same size in both files
Oleksii Matiash
2024-11-13 10:35:24
No, it is real hdr, iiuc
CrushedAsian255
2024-11-13 10:37:26
as in the jxl codestream is true HDR, and the gain map is to convert the HDR to SDR
2024-11-13 11:02:58
It is odd that gainmap is called “maximise compatibility”
2024-11-13 11:03:17
Where I would hope any jpeg xl enabled system knows how to gain map
Quackdoc
Oleksii Matiash Seems no, not the only way
2024-11-13 11:31:10
hdr srgb is wild
Oleksii Matiash
Quackdoc hdr srgb is wild
2024-11-13 11:32:03
srgb in general is.. not the ideal in 2024, tbh
Quackdoc
2024-11-13 11:32:19
It would be nice if they gave an option as to which way a gain map goes, but granted is HDR -> SDR really a "gain map" [av1_dogelol](https://cdn.discordapp.com/emojis/867794291652558888.webp?size=48&name=av1_dogelol)
Oleksii Matiash srgb in general is.. not the ideal in 2024, tbh
2024-11-13 11:33:29
so I guess in this case, they do mean sRGB is the gamut, what transfer does it use? pq?
2024-11-13 11:33:46
I hate that we still use srgb to refer to gamut tho
Oleksii Matiash
Quackdoc so I guess in this case, they do mean sRGB is the gamut, what transfer does it use? pq?
2024-11-13 11:34:59
Sorry, I'm total noob in HDR, it never interested me because lack of monitors. For me gamut wider than srgb is much more important
CrushedAsian255
Quackdoc It would be nice if they gave an option as to which way a gain map goes, but granted is HDR -> SDR really a "gain map" [av1_dogelol](https://cdn.discordapp.com/emojis/867794291652558888.webp?size=48&name=av1_dogelol)
2024-11-13 11:38:57
It’s more just an artistic thing
Quackdoc
Oleksii Matiash Sorry, I'm total noob in HDR, it never interested me because lack of monitors. For me gamut wider than srgb is much more important
2024-11-13 12:10:16
the gamut of sRGB is *fine* it's not good, it;s not bad, it does the job for the most content consumption, the real issues with sRGB is the transfer, the transfer is a mess
CrushedAsian255
2024-11-13 12:11:36
Is sRGB transfer that one with the weird hump for CRT compatibility or something?
Oleksii Matiash
Quackdoc the gamut of sRGB is *fine* it's not good, it;s not bad, it does the job for the most content consumption, the real issues with sRGB is the transfer, the transfer is a mess
2024-11-13 12:13:56
My hobby is nature photography, and it is more than easy to be limited by sRGB gamut. Actually sky is the first candidate to be clipped, second are flowers. Also I have an ~AdobeRGB monitor, and trust me, it is a day and night compared to usual sRGB monitors
Quackdoc
CrushedAsian255 Is sRGB transfer that one with the weird hump for CRT compatibility or something?
2024-11-13 12:14:31
well the real use of it is processing
w
2024-11-13 12:21:29
it's not even that big of a problem
2024-11-13 12:21:32
you just need to get calibrated
2024-11-13 12:21:37
YOU are the problem
Oleksii Matiash
2024-11-13 12:23:40
Unblocking you was a mistake, thank you for confirmation
CrushedAsian255
2024-11-13 12:23:40
Please wait… calibrating left eye
Oleksii Matiash Unblocking you was a mistake, thank you for confirmation
2024-11-13 12:23:52
Hey 😦
w
2024-11-13 12:26:05
<:clueless:1186118225046540309>
_wb_
CrushedAsian255 Where I would hope any jpeg xl enabled system knows how to gain map
2024-11-13 08:51:48
Probably if anything does it, it would be the Adobe software that created it in the first place. Other than that, I am not aware of any applications of jxl that take gain maps into account.
2024-11-13 08:54:31
So "maximize compatibility" should really be called "make it look better on SDR displays in naive viewers that do bad color management / tone mapping, at the cost of making the file twice as large and not rendering in HDR anymore in nearly all applications that do support HDR jxl"
jonnyawsom3
2024-11-13 08:55:08
"Minimize HDR"
_wb_
2024-11-13 08:55:21
"Maximize file size"
jonnyawsom3
2024-11-13 08:57:21
Minimum quality, maximum filesize, less compatibility
2024-11-13 08:57:38
That's the Adobe guarantee
Laserhosen
2024-11-13 10:24:32
"Include losemap"
CrushedAsian255
_wb_ Probably if anything does it, it would be the Adobe software that created it in the first place. Other than that, I am not aware of any applications of jxl that take gain maps into account.
2024-11-13 10:44:22
What is the bitstream spec for the jhgm box
jonnyawsom3
2024-11-15 06:28:05
Continuing from https://discord.com/channels/794206087879852103/805176455658733570/1307041682952556564 <@688076786525143117> try these. I get the same blue image with broken Alpha handling
JendaLinda
2024-11-15 06:46:28
Copy & pasted directly from IrfanView with all three transparency settings.
2024-11-15 06:46:57
It even copies alpha into clipboard.
2024-11-15 06:48:50
Transparent background = keep alpha Gray background = apply alpha, I'm using #c0c0c0 background color. Black background = ignore alpha.
jonnyawsom3
2024-11-15 06:51:17
Oh wait, do you *have* color management enabled?
JendaLinda
2024-11-15 06:52:51
I don't use color management.
jonnyawsom3
2024-11-15 06:52:59
That'll be why then
Oleksii Matiash
2024-11-16 06:35:40
CMS in IrfanView is broken in random way 😦 It works with transparency for old formats, but does not for jxl, webp, avif. Btw, it seems that avif always have some sort of alpha channel, even if it is not used, so avif always looks wrong in IV with CMS on
Tirr
2024-11-16 06:12:50
this popped up as a dependent of jxl-oxide https://github.com/google/neuroglancer/pull/653
Quackdoc
2024-11-16 06:30:14
thats a neat usecase and also a nice example on integration
jonnyawsom3
2024-11-16 08:04:28
> Once this merges, we'll start using JXL (lossless at the very least) on an industrial scale. Beautiful
2024-11-16 09:02:31
Looks good too, automatic JPEG to JXL transcoding with (apparently) layered files https://github.com/seung-lab/cloud-volume/commit/40840a96d83c91c65141893212b1ba69de0547c2
Demiurge
_wb_ Probably if anything does it, it would be the Adobe software that created it in the first place. Other than that, I am not aware of any applications of jxl that take gain maps into account.
2024-11-18 09:26:15
Why not make it mandatory that the base image is HDR and the gain map is only needed for SDR? Isn't it simple to convert or "invert" the gain map?
2024-11-18 09:27:22
You could make sdr base image illegal in the jxl spec and decoders...?
_wb_
2024-11-18 09:31:51
We could, but then recompressing UltraHDR becomes illegal.
2024-11-18 09:33:26
Current proposed spec text has a note saying: > NOTE Since JPEG XL supports HDR baseline images, the recommended way for encoders to use gain maps is to encode the HDR image as the baseline image, using the gain map only to define a preferred tone mapping for SDR displays (or HDR displays with insufficient HDR headroom).
Demiurge
_wb_ We could, but then recompressing UltraHDR becomes illegal.
2024-11-18 09:47:16
Is there not simple math to "invert" the gain map?
2024-11-18 09:47:36
Or is it uglier than that
2024-11-18 09:48:06
I know the loss of quality already happened when it was encoded as SDR with a low res HDR gain map
2024-11-18 09:48:51
Isn't there a way to "invert" it without making it worse, since the loss already happened?
spider-mario
2024-11-18 09:50:14
you’d make the SDR worse
2024-11-18 09:50:39
since it would now go through two gain maps in total (original gainmap + lossy HDR reencoding + inverse gainmap)
_wb_
Demiurge Isn't there a way to "invert" it without making it worse, since the loss already happened?
2024-11-18 09:52:30
not if you still want to be able to reconstruct the original UltraHDR file. Of course you could just convert the UltraHDR to real HDR and encode just that (with or without an HDR->SDR gain map), which is what I would recommend to do with such images, but if you want a lossless recompression of UltraHDR to be possible, then you need a SDR->HDR gain map where both the main image and the gain map are a recompressed JPEG.
Demiurge
_wb_ not if you still want to be able to reconstruct the original UltraHDR file. Of course you could just convert the UltraHDR to real HDR and encode just that (with or without an HDR->SDR gain map), which is what I would recommend to do with such images, but if you want a lossless recompression of UltraHDR to be possible, then you need a SDR->HDR gain map where both the main image and the gain map are a recompressed JPEG.
2024-11-18 10:28:45
Maybe ultraHDR was a big mistake and should be aborted before people are in too deep... 😂
_wb_ not if you still want to be able to reconstruct the original UltraHDR file. Of course you could just convert the UltraHDR to real HDR and encode just that (with or without an HDR->SDR gain map), which is what I would recommend to do with such images, but if you want a lossless recompression of UltraHDR to be possible, then you need a SDR->HDR gain map where both the main image and the gain map are a recompressed JPEG.
2024-11-18 10:31:03
I would recommend against reversible compression too because of how much space is wasted... or maybe if feasible and practical a pixel-lossless transform if not a bitstream-lossless one
CrushedAsian255
2024-11-18 10:37:59
Maybe only allow SDR->HDR gain maps for UltraHDR images
_wb_
Demiurge I would recommend against reversible compression too because of how much space is wasted... or maybe if feasible and practical a pixel-lossless transform if not a bitstream-lossless one
2024-11-18 10:41:56
It would still save 20%, and if you require bit-exact reconstruction of the original file it could be a good idea. If you don't need that, then I wouldn't bother with gain maps at all and just encode an HDR image from scratch from reconstructed HDR pixels.
CrushedAsian255
2024-11-18 10:43:15
is there a way to convert the HDR->SDR gainmap back to a SDR->HDR gainmap as an extension to `jbrd`?
2024-11-18 10:43:58
I feel like including support for both SDR->HDR and HDR->SDR gainmaps would overcomplicate the format
2024-11-18 10:44:13
especially because SDR->HDR gainmaps should really never be a thing
_wb_
Demiurge Maybe ultraHDR was a big mistake and should be aborted before people are in too deep... 😂
2024-11-18 10:44:14
Yes, I think it is, but phones are producing these things now and Android is actively pushing more phones to do it, so I am a bit torn between the need to deal with it and the desire to ignore it and hope it will just disappear.
CrushedAsian255
2024-11-18 10:44:50
like can you take an SDR image and the SDR->HDR gainmap and convert that to a HDR image and a HDR->SDR gainmap in a way which is reversible?
_wb_
2024-11-18 10:45:16
You cannot just change the gainmap, you then also have to change the main image, which would ruin any chance of reconstructing the original ultrahdr file
CrushedAsian255
2024-11-18 10:45:32
or maybe just declare UltraHDR images as not part of the de-facto JPEG spec
_wb_ Yes, I think it is, but phones are producing these things now and Android is actively pushing more phones to do it, so I am a bit torn between the need to deal with it and the desire to ignore it and hope it will just disappear.
2024-11-18 10:45:51
however this is a good point
2024-11-18 10:46:18
currently how does the JXL gainmap box work? is it a jpeg or another jpegxl codestream?
2024-11-18 10:46:31
or is it a seperate format
_wb_
2024-11-18 10:47:59
it's another jxl... which could itself be a recompressed jpeg, so in principle we could define a slight extension to the jbrd procedure (we'd need to define a new box for it to keep things backwards compatible) that reconstructs an UltraHDR by just reconstructing the main image first and then concatenating the reconstructed jpeg from the gain map box.
CrushedAsian255
2024-11-18 10:48:43
is it just a 18181-1 or can it be a 18181-2 ?
2024-11-18 10:49:06
if its a 18181-2 it could have it's own `jbrd` box
Demiurge
_wb_ Yes, I think it is, but phones are producing these things now and Android is actively pushing more phones to do it, so I am a bit torn between the need to deal with it and the desire to ignore it and hope it will just disappear.
2024-11-18 11:09:01
That is funny and tragic at the same time
_wb_
2024-11-18 11:10:30
This is all 18181-2 stuff, the jbrd and gain map box are defined there, part 1 has no boxes at all, just defines the codestream itself.
Demiurge
_wb_ You cannot just change the gainmap, you then also have to change the main image, which would ruin any chance of reconstructing the original ultrahdr file
2024-11-18 11:11:33
I just wonder if there is a clever neat mathematical transform that can apply the gainmap in dct space maybe, and invert the gainmap.
2024-11-18 11:12:22
Or, maybe some near-lossless, irreversible conversion would be acceptable
_wb_
2024-11-18 11:12:49
I don't think that's possible, since the gain map spec doesn't even define which exact upsampling to use for the gain map, so it's rather horribly underspecified...
Demiurge
2024-11-18 11:13:07
Or even "visually-lossless" but with guarantees that it won't be a larger file
CrushedAsian255
_wb_ This is all 18181-2 stuff, the jbrd and gain map box are defined there, part 1 has no boxes at all, just defines the codestream itself.
2024-11-18 11:13:11
i mean is the jxl in the gainmap box allowed to be an entire `18181-2` file or just a `18181-1` codestream
_wb_
2024-11-18 11:14:04
First we thought only codestream, but allowing arbitrary nested 18181-2 file seems a better idea if we want to allow putting a recompressed jpeg there...
Demiurge
_wb_ I don't think that's possible, since the gain map spec doesn't even define which exact upsampling to use for the gain map, so it's rather horribly underspecified...
2024-11-18 11:14:08
Oh my god it's worse than I imagined... well then you need to test how the most common implementation upscales it...
CrushedAsian255
Demiurge Oh my god it's worse than I imagined... well then you need to test how the most common implementation upscales it...
2024-11-18 11:14:54
im pretty sure [libultrahdr](https://github.com/google/libultrahdr) is the reference implementation
_wb_
2024-11-18 11:15:42
so funny that they put "a true HDR image format" in their project title, as if they're trying to convince themselves
Demiurge
2024-11-18 11:16:23
I think the bare minimum you need to do is a way to convert it irreversibly, but with guarantees that it won't be larger and even guaranteed transparent.
CrushedAsian255
_wb_ First we thought only codestream, but allowing arbitrary nested 18181-2 file seems a better idea if we want to allow putting a recompressed jpeg there...
2024-11-18 11:16:40
only problem with letting the gainmap be an arbitrary 18181-2 file is what should the decoder do if the gainmap sub-file has metadata boxes or its own gainmap
Demiurge
2024-11-18 11:17:12
As long as you can guarantee that then it shouldn't matter if you can't get the original file back
2024-11-18 11:17:25
It should die anyways
2024-11-18 11:17:40
Really it should die
CrushedAsian255
2024-11-18 11:18:17
Which is better? Phone takes UltraHDR images Phone takes true HDR AVIF images
Demiurge
2024-11-18 11:18:41
Hdr avif obviously
CrushedAsian255
2024-11-18 11:18:46
100%
Demiurge
2024-11-18 11:18:48
But apparently it takes sdr heif
_wb_
2024-11-18 11:18:57
anything other than the main image of the gainmap sub-file just gets ignored for the purpose of the semantics of the gain map, but can be used in the reconstruction of the original bitstream — e.g. there will be XMP stuff there in case of UltraHDR
Demiurge
2024-11-18 11:19:02
Even hdr heif is sdr
CrushedAsian255
2024-11-18 11:19:05
that's option 3, the worst of both worlds
_wb_ anything other than the main image of the gainmap sub-file just gets ignored for the purpose of the semantics of the gain map, but can be used in the reconstruction of the original bitstream — e.g. there will be XMP stuff there in case of UltraHDR
2024-11-18 11:19:16
ahh that makes sense
2024-11-18 11:19:35
is it literally just two jpegs concatenated, JFIF and everything?
Demiurge
_wb_ anything other than the main image of the gainmap sub-file just gets ignored for the purpose of the semantics of the gain map, but can be used in the reconstruction of the original bitstream — e.g. there will be XMP stuff there in case of UltraHDR
2024-11-18 11:19:55
You don't want infinitely nested matroyshka dolls though do you?
CrushedAsian255
Demiurge You don't want infinitely nested matroyshka dolls though do you?
2024-11-18 11:20:09
my gainmap has a gainmap which has a gainmap ...
2024-11-18 11:20:12
what about my usecase?
Demiurge
2024-11-18 11:20:13
Why not keep it flat?
2024-11-18 11:20:24
Enforce metadata flatness
CrushedAsian255
2024-11-18 11:20:32
maybe only allow 1 layer of nesting
Demiurge
2024-11-18 11:20:51
Infinite matroshka is hellish nightmare world for decoder devs