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

contact-devs

Bring stuff to the attention of jxl devs here

Deleted User
2021-06-07 10:43:57
Everybody loves you! (except AOM)
Everybody loves you! (except AOM)
2021-06-07 10:50:28
> (except AOM) (but they should ;_;)
tufty
2021-07-22 05:23:39
hello all, oss-fuzz has found a possible buffer overflow in libjxl master
2021-07-22 05:24:07
it's only a read out of bounds, so probably not too serious ok to open an issue?
veluca
2021-07-22 06:00:57
sure, please do
2021-07-22 06:01:19
I wonder why our ossfuzz didn't find it...
tufty
2021-07-22 06:45:36
ok done https://github.com/libjxl/libjxl/issues/347
2021-07-22 06:46:50
we have a different set of seed files I guess or perhaps I've cocked up my libjxl interface code heh
veluca
2021-07-22 07:51:16
likely the seed
2021-07-22 07:51:30
or this is another manifestation of some bug our oss-fuzz also found ๐Ÿ˜›
Deleted User
2021-07-27 03:27:25
When can we use JXL with Chrome by default? Everything is fuzzed out, right?
_wb_
2021-07-27 04:15:47
It's a political question more than a technical one at this point, I think. But yes, no more fuzzing bugs for a while would be good.
Deleted User
2021-07-27 04:45:45
Has the political question already been turned down or is there anything we can do?
frank cilantro
2021-07-28 07:01:38
(oops wrong channel most likely)
_wb_
Has the political question already been turned down or is there anything we can do?
2021-07-28 07:18:20
I don't know if there's anything that can be done โ€” maybe Chrome decision makers will more likely approve enabled-by-default if Firefox does so too, and I think Firefox has a more open discussion about it so possibly more community input can help there (both to improve the jxl integration in firefox and to argue in favor of enabling it by default).
Scientia
2021-08-04 01:16:31
oo i found an error, i think i'll put it on github
2021-08-04 01:41:28
https://github.com/libjxl/libjxl/issues/407
_wb_
2021-08-04 07:06:10
Thanks, could be a bug in the dct block type selection heuristics. Pinging <@532010383041363969>
Jyrki Alakuijala
Has the political question already been turned down or is there anything we can do?
2021-08-04 11:12:49
There are several approaches that are possible for browser integration. One is to start by slicing out the non-AVIF-competing part, i.e., the lossless coding, and ship that first. Likely it would need another Media type (or just use the existing, and then have another Media type for the full JPEG XL). It seems to me that lossless jpeg recompression doesn't compete with AVIF, and possibly the same for lossless pixel compression (similar to PNG and WebP lossless), possibly also delta palettization. Another approach is to wait for some adoption and enthusiasm and show that JPEG XL is a significantly more attractive offering than AVIF for some of the needs (such as photography). "The water will always find a way." Another approach is to get several AOM members (such as Facebook, Netflix, Adobe, etc.) enthusiastic and deploy JPEG XL in their systems, and them bringing their enthusiasm to the AOM. Another approach is to work with AOM's video/image quality group to introduce new image quality metrics that better indicate the strengths of JPEG XL approach. Building on WASM, showing it works and is desireable, could help to convince Chrome/AOM. Working with camera manufacturers and/or review entities like dpreview.com could make the photography value more clear to AOM/field.
2021-08-04 11:28:21
One practical piece of evidence that could help to convince AVIF is to show that JPEG XL is one generation ahead. We could do a human study that shows the difference between Mozjpeg->WebP, WebP->AVIF and AVIF->JPEG XL differences. If we can show that AVIF to JPEG XL is a larger jump than Mozjpeg to WebP and/or from WebP to AVIF, then it might be launchable by AOM's own criteria, and possibly could be placed on AOM's roadmap of open Web platform codecs. My own experience and evidence that I have is that JPEG XL is the only modern codec that significantly improves the median and average image byte use case, at around 1-2 bpp, and if a study is able to focus on the average image byte (instead of 0.2 BPP images), it is not difficult to show a 30+ % improvement from AVIF to JPEG XL.
Scope
2021-08-04 11:40:59
In my opinion, slicing up the format and splitting it into different parts is not the best solution and can cause more problems than benefits in the future, it's better to choose other ways by all means. And as I said before, even if support in browsers is not enabled by default, if there is a possibility it is worth to improve its functionality, for example progressive decoding, faster lossless decoding, possibly consider multithreading for large images (in Firefox it already works) and other useful features for Web usage and there is time for that, I don't think it's better to do it in haste, only after enabling by default. And to demonstrate lossless benefits, it is also worth having a more optimized option that would be most useful in practice and I think that is something closer to WebP lossless, i.e. fast enough in speed, but also more efficient than other formats (currently JXL is denser in compression, but not always better in speed/efficiency, also sometimes decoding speed may not be fast enough on large lossless images) Also do not forget about the importance of Windows users as the most popular non-mobile OS and the need to at least support and update the official builds and something like WIC decoder (until there will be similar from Microsoft, but for example their AVIF decoder is not the best and can not properly decode most of the images)
fab
2021-08-05 02:40:47
windows 11 is enough; i 100% agree with scope; with apple you can talk seriously later when there is an event or something
Deleted User
2021-08-05 02:48:17
<@!532010383041363969> Can JPEG support be added to the JXL decoder to promote it as next-gen "Jpeg to piXeLs" converter? This wouldn't collide with AVIF and the use of decoding actual JXLs would be just a little bonus.
fab
<@!532010383041363969> Can JPEG support be added to the JXL decoder to promote it as next-gen "Jpeg to piXeLs" converter? This wouldn't collide with AVIF and the use of decoding actual JXLs would be just a little bonus.
2021-08-05 02:52:15
guetzli 2.0 won't happen
Deleted User
fab guetzli 2.0 won't happen
2021-08-05 03:05:22
What does Guetzli have to do with image decoding?
fab
What does Guetzli have to do with image decoding?
2021-08-05 03:18:44
jpg image encoder with some jxl optimizations was called a guetzli 2.0 by jyrki and he told that it can happen in this year or next year https://discord.com/channels/794206087879852103/872039185220001892/872197235595673611
Deleted User
fab jpg image encoder with some jxl optimizations was called a guetzli 2.0 by jyrki and he told that it can happen in this year or next year https://discord.com/channels/794206087879852103/872039185220001892/872197235595673611
2021-08-05 03:22:45
This doesn't answer my question: What does your comment have to do with my initial post?
fab
This doesn't answer my question: What does your comment have to do with my initial post?
2021-08-05 03:23:47
ok, i understood
Jyrki Alakuijala
<@!532010383041363969> Can JPEG support be added to the JXL decoder to promote it as next-gen "Jpeg to piXeLs" converter? This wouldn't collide with AVIF and the use of decoding actual JXLs would be just a little bonus.
2021-08-09 12:51:11
Yes, we could do this and likely add 10 bit framebuffer dynamics to it, too, so that 'good old' jpeg could be used for HDR10. Would you consider adding an issue for this?
Deleted User
2021-08-09 02:38:57
<@!532010383041363969> Is that issue visible enough or should I create a new one on GitHub?
<@!532010383041363969> Is that issue visible enough or should I create a new one on GitHub?
2021-08-09 02:57:24
I don't think that we should duplicate GitLab issues on GitHub.
veluca
2021-08-09 03:22:44
I don't think there's anything wrong in doing so - I don't know how much we'll look at gitlab issues...
_wb_
2021-08-09 03:40:30
Feel free to duplicate any gitlab issue on github, and then link to it on the gitlab issue so it can be closed there.
Jyrki Alakuijala
<@!532010383041363969> Is that issue visible enough or should I create a new one on GitHub?
2021-08-09 04:24:22
I see. I thought you meant that we could build a new universal jpeg decoder -- for example for Chrome integration.
Deleted User
Jyrki Alakuijala I see. I thought you meant that we could build a new universal jpeg decoder -- for example for Chrome integration.
2021-08-09 05:42:32
While we're at it... JPEG XT and Knusperli integration, please? ๐Ÿฅบ
Jyrki Alakuijala
2021-08-09 07:03:57
...and epf ๐Ÿ™‚ ?
Justin
2021-08-10 08:36:21
Hey there! After writing Jon on Twitter, he forwarded me to this Discord. Happy to get to know you, guys. My name is Justin and I am one of the creators of avif.io. In disregard of our AVIF solution, we are also currently building a JXL converter with C++, emscripten, WASM & libjxl. Now, for our avif solution, we show users the conversion progress of a single file. I can't seem to find an option for this in libjxl, but I'm also known for being a little blind. Do you offer this type of granular progress tracking?
Fraetor
2021-08-10 11:26:37
A note about the migration to GitHub should probably be added to the readme on Gitlab. The only place it is currently mentioned is in the one issue saying not to make more issues.
_wb_
Justin Hey there! After writing Jon on Twitter, he forwarded me to this Discord. Happy to get to know you, guys. My name is Justin and I am one of the creators of avif.io. In disregard of our AVIF solution, we are also currently building a JXL converter with C++, emscripten, WASM & libjxl. Now, for our avif solution, we show users the conversion progress of a single file. I can't seem to find an option for this in libjxl, but I'm also known for being a little blind. Do you offer this type of granular progress tracking?
2021-08-11 07:26:03
<@768090355546587137> do we have callbacks for progress tracking in the encode api? I assume gimp/photoshop would also want that...
Deleted User
Fraetor A note about the migration to GitHub should probably be added to the readme on Gitlab. The only place it is currently mentioned is in the one issue saying not to make more issues.
2021-08-11 11:22:39
GitLab mirrors GitHub, so I don't think that it'd be possible to add info to just GitLab and not GitHub.
Fraetor
2021-08-11 11:29:11
Fair. It could be added to the Gitlab description text, but if the Gitlab is going to remain up to date, then it's not too critical.
Deleted User
2021-08-11 11:40:46
I'm revisiting old GitLab issues, are those issues actually fixed (they have `fixed` label)? https://gitlab.com/wg1/jpeg-xl/-/issues/85 https://gitlab.com/wg1/jpeg-xl/-/issues/182 https://gitlab.com/wg1/jpeg-xl/-/issues/199
veluca
2021-08-11 11:40:57
first one yes
2021-08-11 11:41:20
other two should be going by the comments
Scope
2021-08-16 03:55:21
<@!794205442175402004><@!179701849576833024><@!532010383041363969> Also, `--resampling` still does not work with speeds higher than `-s 7`
Dirk
2021-08-17 08:47:31
Can I poke someone here to get a new release of brotli? We are having some problems with a static jpeg-xl build in ImageMagick. Someone told me that this fixes it: https://github.com/google/brotli/commit/09b0992.
veluca
2021-08-17 08:52:10
I'll ask
Jyrki Alakuijala
2021-08-17 10:15:11
We will make a new release -- but it will take some time for us. Would two weeks work for you?
2021-08-17 11:27:02
<@!693227044061839360> would you file a public issue on this on github.com/google/brotli? Please indicate the time frame you need the release. The main person resposible is out-of-office right now, but we can rotate the duties if this is urgent.
veluca
2021-08-17 11:34:46
<@!693227044061839360>
Dirk
2021-08-17 12:44:49
This is not an urgent matter, only an issue for people who want to use jpeg-xl statically together with ImageMagick
2021-08-17 12:55:43
So two weeks would be okay
2021-08-17 12:55:58
Do you still want me to open an issue?
veluca
2021-08-17 01:01:36
the likelyhood of us forgetting about it if it's not urgent and there is no issue is somewhere around 110%
Justin
_wb_ <@768090355546587137> do we have callbacks for progress tracking in the encode api? I assume gimp/photoshop would also want that...
2021-08-17 10:24:49
*shameless ping* <@768090355546587137>
xiota
2021-08-19 03:23:18
Hello. This is my first time on discord. I have a question about how to process a JXL file that has different original and data profiles. The original is an ICC profile, and the data profile looks like something JXL uses internally. Which profile should be used when decoding the file?
_wb_
2021-08-19 05:42:10
The profile you get from the decoder :)
xiota
2021-08-19 07:25:49
Both profiles can be obtained from the decoder by passing JXL_COLOR_PROFILE_TARGET_DATA or JXL_COLOR_PROFILE_TARGET_ORIGINAL to JxlDecoderGetColorAsICCProfile(). Some images seem to need DATA, others work better with ORIGINAL. If I ignore the color profile, everything seems to work fine, but I get screwy results when I try to use the profiles.
veluca
2021-08-19 08:32:54
that seems odd, in theory the decoder ought to return you pixels in the JXL_COLOR_PROFILE_TARGET_DATA colorspace...
xiota
veluca that seems odd, in theory the decoder ought to return you pixels in the JXL_COLOR_PROFILE_TARGET_DATA colorspace...
2021-08-19 09:39:16
When I use JXL_COLOR_PROFILE_TARGET_DATA, 3/4 of my test images appear to decode correctly. Notably, `djxl` decodes only 2/4 of them correctly. I'll look at the code I'm using to encode to see if I made a mistake. It may have to do with setting linear/gamma correctly.
2021-08-19 02:32:48
What colorspace conversions is the encoder doing behind the scenes? I know there's RGB to XYB when encoding (whatever that is), but then it converted back to RGB during decoding (?) So... say, I encode an AdobeRGB image. When it's decoded, is it still AdobeRGB, or is it something else?
veluca
2021-08-19 03:11:41
<@!768090355546587137> <@!604964375924834314>
_wb_
2021-08-19 03:18:55
djxl converts back to the original space (which is why it needs lcms/skcms), the libjxl_dec api cannot always do that though because it doesn't depend on lcms/skcms - so if the original color space is exotic (some weird arbitrary ICC profile that does not correspond to one of the 'known' (enum) color spaces like sRGB/P3/etc), it might e.g. convert XYB to linear RGB and return a color profile that corresponds to linear RGB (instead of the original one)
paperboyo
_wb_ djxl converts back to the original space (which is why it needs lcms/skcms), the libjxl_dec api cannot always do that though because it doesn't depend on lcms/skcms - so if the original color space is exotic (some weird arbitrary ICC profile that does not correspond to one of the 'known' (enum) color spaces like sRGB/P3/etc), it might e.g. convert XYB to linear RGB and return a color profile that corresponds to linear RGB (instead of the original one)
2021-08-19 03:21:52
> 'known' (enum) color spaces Is there a list somewhere?
_wb_
2021-08-19 03:23:38
in the spec and in the code, but basically it's anything that can be expressed as whatever RGB primaries + whitepoint + a transfer curve that is either a pure gamma curve (including linear), the sRGB transfer function, the PQ one or the HLG one (if I didn't forget any)
2021-08-19 03:24:41
so I think that should cover most of the common RGB spaces, like sRGB, Display P3, DCI-P3, AdobeRGB 1998, ProPhoto, Rec.2100 (PQ or HLG), etc
xiota
2021-08-19 03:25:01
[list is at `include/jxl/color_encoding.h`] ... So if I start from an AdobeRGB original... compress to jxl... jxlinfo reports the "original" profile is an ICC profile and the "data" profile is a "JPEG XL encoded color profile". Then I decode to back to a viewable image... is it [supposed to be] in sRGB (or similar)? As far as I can tell, that's what's happening. If I apply an AdobeRGB profile, the colors are wrong.
paperboyo
2021-08-19 03:27:20
Are sRGB-compatible profiles (TinysRGB, sRGBz etc) treated as if they are sRGB (regarding transfer function, I suppose)?
_wb_
paperboyo Are sRGB-compatible profiles (TinysRGB, sRGBz etc) treated as if they are sRGB (regarding transfer function, I suppose)?
2021-08-19 03:34:12
if they're close enough, then in lossy mode, yes, there are tolerances and "close enough to sRGB" will be treated as if it is sRGB. In lossless mode, it always stores the exact ICC profile just to be sure.
xiota [list is at `include/jxl/color_encoding.h`] ... So if I start from an AdobeRGB original... compress to jxl... jxlinfo reports the "original" profile is an ICC profile and the "data" profile is a "JPEG XL encoded color profile". Then I decode to back to a viewable image... is it [supposed to be] in sRGB (or similar)? As far as I can tell, that's what's happening. If I apply an AdobeRGB profile, the colors are wrong.
2021-08-19 03:38:45
it is supposed to be in the profile the decoder returns - this can be anything really: if lossless encoding was done, it will be AdobeRGB, if lossy was done, it might be linear sRGB it gives you, or it could be something else (iirc you can ask the decoder to 'try' to give you a certain enum colorspace, which it will do if the image is XYB and it has to do some conversion anyway, and it will not do it if the image is in (a different) RGB)
2021-08-19 03:38:51
at least that's how I understand things
2021-08-19 03:39:09
<@!768090355546587137> / <@!604964375924834314> please correct me if I'm wrong
veluca
xiota [list is at `include/jxl/color_encoding.h`] ... So if I start from an AdobeRGB original... compress to jxl... jxlinfo reports the "original" profile is an ICC profile and the "data" profile is a "JPEG XL encoded color profile". Then I decode to back to a viewable image... is it [supposed to be] in sRGB (or similar)? As far as I can tell, that's what's happening. If I apply an AdobeRGB profile, the colors are wrong.
2021-08-19 03:39:15
mhhh, that seems to imply that the "original" profile is not actually representable by the enum. Did you encode it with lossy or with lossless?
xiota
2021-08-19 03:48:28
I'm encoding lossy. Whatever profile I send to the encoder seems to just get attached as the original profile. If I don't attach anything, the "original" and "data" profiles are the same. I don't know how to read an ICC profile to get the parameters to let the encoder use an internal profile. / For decoding, I don't know how to send an ICC profile to the decoder. I know how to get it to give me the ICC profiles it finds in the file, but otherwise, it just seems to do its own thing. / Are the specs available anywhere, or will the standards be locked behind a paywall? / As far as the color profiles are concerned, it's fine with me as long as I know what to expect.
veluca
2021-08-19 03:57:31
lossy will encode in XYB always and I think it will decode to linear sRGB in most cases (but probably sRGB if you decode to integers), unless the original profile is represented with enums (which AdobeRGB might be but we might not detect correctly)
xiota
veluca lossy will encode in XYB always and I think it will decode to linear sRGB in most cases (but probably sRGB if you decode to integers), unless the original profile is represented with enums (which AdobeRGB might be but we might not detect correctly)
2021-08-19 04:03:35
"lossy will encode in XYB always" โ€“ So if I set `info.uses_original_profile` to true, it produces a jxl file where there is only one profile (AdobeRGB in this example), and the image displays correctly after decoding when that profile is applied. Is this against the specs? (Lossy compression, with `distance = 1` by default.) // Sorry, I'm not thinking clearly... XYB is when it's encoded/compressed... but then it gets decompressed/decoded to another profile... so if there's only one profile attached, it's reasonable for it to apply that one. The problem is when there are two different profiles attached or specified. Mainly wondering if what it seems to be doing (decoding to the "data" profile/sRGB) is what it's supposed to be doing.
veluca
2021-08-19 04:04:18
<@!768090355546587137> likely know the answer best
xiota
veluca <@!768090355546587137> likely know the answer best
2021-08-19 04:13:58
"decode to linear sRGB in most cases" โ€“ When playing with linear vs perceptual images... It seems like linear integer and perceptual floating formats don't display correctly. Looks like the gamma curves get applied twice. Maybe once by the decoder and again by the viewer.
lvandeve
xiota "lossy will encode in XYB always" โ€“ So if I set `info.uses_original_profile` to true, it produces a jxl file where there is only one profile (AdobeRGB in this example), and the image displays correctly after decoding when that profile is applied. Is this against the specs? (Lossy compression, with `distance = 1` by default.) // Sorry, I'm not thinking clearly... XYB is when it's encoded/compressed... but then it gets decompressed/decoded to another profile... so if there's only one profile attached, it's reasonable for it to apply that one. The problem is when there are two different profiles attached or specified. Mainly wondering if what it seems to be doing (decoding to the "data" profile/sRGB) is what it's supposed to be doing.
2021-08-19 04:20:05
The way to see it is not that the image displays correctly. The decoder gives you numerical pixel values, and it also gives you the color profile these pixels have. If this color profile happens to match your screen, then it displays correctly. If the color profile is different, you should convert from the profile JXL gave you to the profile you wish to display the pixels as
xiota
lvandeve The way to see it is not that the image displays correctly. The decoder gives you numerical pixel values, and it also gives you the color profile these pixels have. If this color profile happens to match your screen, then it displays correctly. If the color profile is different, you should convert from the profile JXL gave you to the profile you wish to display the pixels as
2021-08-19 04:25:48
I didn't notice before, but the `jpg` files generated by `djxl` when decoding to pixels have an ICC profile attached. However, Exiftool reports "Invalid ICC Metadata data".
lvandeve
2021-08-19 04:26:32
what happens if you decode this same image to PNG?
xiota
2021-08-19 04:31:39
`djxl -h` says "--color_space=RGB_D65_SRG_Rel_Lin defaults to original (input) color space". / I tried a few different `jxl` files... with different results... think the invalid profile one had an AdobeRGB profile attached. / The generated `png` files have no profiles attached. They all look like they're targeting sRGB (even the AdobeRGB image) because they display as intended when I turn off color management on my viewer.
lvandeve
2021-08-19 04:39:44
when using the API: for display, use JXL_COLOR_PROFILE_TARGET_DATA: this is the profile that the API gives you the pixels in. The other one, JXL_COLOR_PROFILE_TARGET_ORIGINAL, is only metadata and tells what the original image was in, but is not (at least not necessarily) what the pixels are in. In case of uses_original_profile=true then data and original will match. Also, the decoder can only return you the pixels with this profile, the decoder library at least has no CMS like skiacms or lcms built in to be able to convert it to anything else In case of uses_original_profile=false, then the decoder will convert it to a data profile for you (but also because it must e.g. for blending which must happen in the original profile as long as possible without needing a CMS, and because RGB rather than XYB output is requested) to one that the decoder knows (it can convert from xyb to a certain set of RGB profiles, including sRGB, PQ, HLG, ..., but not AdobeRGB). The JXL_COLOR_PROFILE_TARGET_DATA will tell which it is.
_wb_
2021-08-19 04:43:50
AdobeRGB should be representable by an enum, it is just some specific primaries and a gamma 2.2, so in principle we can do that in the enum, no?
xiota
lvandeve when using the API: for display, use JXL_COLOR_PROFILE_TARGET_DATA: this is the profile that the API gives you the pixels in. The other one, JXL_COLOR_PROFILE_TARGET_ORIGINAL, is only metadata and tells what the original image was in, but is not (at least not necessarily) what the pixels are in. In case of uses_original_profile=true then data and original will match. Also, the decoder can only return you the pixels with this profile, the decoder library at least has no CMS like skiacms or lcms built in to be able to convert it to anything else In case of uses_original_profile=false, then the decoder will convert it to a data profile for you (but also because it must e.g. for blending which must happen in the original profile as long as possible without needing a CMS, and because RGB rather than XYB output is requested) to one that the decoder knows (it can convert from xyb to a certain set of RGB profiles, including sRGB, PQ, HLG, ..., but not AdobeRGB). The JXL_COLOR_PROFILE_TARGET_DATA will tell which it is.
2021-08-19 04:45:03
Thanks... that's helpful for deciding which settings to use. / The `djxl` help output states it uses the original colorspace though. Does that need to be corrected or am I misunderstanding what that option is?
_wb_
2021-08-19 04:54:13
djxl does actual conversion to the original space and bitdepth, because most of the output formats are integer-based so you cannot have negative or higher than maxval values (which you could get for out-of-sRGB-gamut colors)
xiota
_wb_ djxl does actual conversion to the original space and bitdepth, because most of the output formats are integer-based so you cannot have negative or higher than maxval values (which you could get for out-of-sRGB-gamut colors)
2021-08-19 04:57:24
So the API and `djxl` have different behavior... That makes it troublesome for using colorspaces other than sRGB.
_wb_
2021-08-19 05:07:10
The api is made to avoid doing an unnecessary convert from XYB to original space if all you want to do is display the image in display space. E.g. if original space is 8-bit AdobeRGB, display space is DisplayP3, then it would be silly to convert the internal XYB to 8-bit AdobeRGB and then (at some point) convert that to DisplayP3. It is more accurate and faster to skip the AdobeRGB intermediate.
xiota
_wb_ The api is made to avoid doing an unnecessary convert from XYB to original space if all you want to do is display the image in display space. E.g. if original space is 8-bit AdobeRGB, display space is DisplayP3, then it would be silly to convert the internal XYB to 8-bit AdobeRGB and then (at some point) convert that to DisplayP3. It is more accurate and faster to skip the AdobeRGB intermediate.
2021-08-19 05:14:22
Having the decoder do color management seems to add a layer of complexity. Most other image formats don't do anything with color management so the viewers, editors, and operating systems have to take care of it. Throw in an image format that does its own color management, and color profiles may end up being applied multiple times.
spider-mario
2021-08-19 05:19:50
from the point of view of the viewers, itโ€™s not that different, is it? the viewer gets pixel data and in which colorspace it is, as it always would
xiota
spider-mario from the point of view of the viewers, itโ€™s not that different, is it? the viewer gets pixel data and in which colorspace it is, as it always would
2021-08-19 05:23:28
Using the API, the problem I was having earlier was knowing which flag to send to the decoder: JXL_COLOR_PROFILE_TARGET_ORIGINAL/DATA and knowing what color profile to apply for display. There are 4 combinations, and no one setting consistently gave results I was expecting (which is for the image to appear the way it did when it was saved). It looked like gamma curves were being applied twice in some cases.
lvandeve
2021-08-19 05:30:46
all DATA ๐Ÿ™‚
_wb_
2021-08-19 05:36:32
You don't need to 'apply' a color profile after decode (in the sense of doing a color conversion), you just need to 'attach' the profile to the pixels you get (i.e. interpret the pixels as being in the color space defined by the profile)
lvandeve
2021-08-19 05:36:57
Not sure what you mean by send to the decoder by the way: you can request the original or the data one (or both) from the decoder, it's a getter, it doesn't set anything
2021-08-19 05:37:55
Unless you mean the flag of djxl. And now that I think of it, you can indeed also set an optional profile to the jxl decoder in the API, only used in rare circumstances. Ask if you want the full details ๐Ÿ˜„
xiota
2021-08-19 05:49:25
<@794205442175402004> "interpret the pixels as being in the color space defined by the profile" ยญโ€“ doesn't that result in color conversion when displayed? / <@!768090355546587137> I don't really know what I'm doing... I'm probably getting the encoder and decoder mixed up, which further contributes to the problem. What I normally think of with camera jpgs, is the bits are what they are and the profile is just in the metadata for interpretation. but with jxl, it looks like the ยฟdecoder/encoder? may actually be doing something with the profiles besides just attaching it to the metadata.
lvandeve
2021-08-19 05:52:08
It depends again on uses_original_profile if true, then the encoder and decoder both do the same as most other image codecs like png, jpeg, etc...: they just encode/decode numeric values without any conversions to other profiles, and the attached profile is the profile those pixels have if false, then the encoder will eventually get the pixels in xyb, which is its own absolute color space. But just like any other color space, you can convert it to/from anything. The fact that the API doesn't include a color management system, means the encoder/decoder can't do any arbitrary conversion
2021-08-19 05:53:15
but you still can do it, the decoder gives all info (pixels + color profile) neede to use a CMS to do any conversion similarly, encoder requires pixel format to be in something it knows (can convert to xyb itself) when using uses_original_profile = false
2021-08-19 05:53:39
cjxl/djxl *do* include CMS, so they can convert more, and do so when encoding to/from png or jpg, using the color profile of png and jpg as intended (when reading, and when writing)
_wb_
2021-08-19 05:55:27
The lossy encoder needs to know the color profile of the input pixel values, otherwise it cannot convert to XYB and "know what it is doing", perceptually speaking (it's not a black box encoder that encodes arbitrary numbers with some loss, it does something perceptual). The lossless/modular encoder doesn't need to know the color profile, it just encodes the numbers you give it and doesn't (have to) care about what they mean.
2021-08-19 05:58:20
In any case when encoding you need to make sure that the color space you claim the pixels are in, is correct (don't just claim everything is sRGB even if it isn't or something like that).
xiota
lvandeve cjxl/djxl *do* include CMS, so they can convert more, and do so when encoding to/from png or jpg, using the color profile of png and jpg as intended (when reading, and when writing)
2021-08-19 05:58:57
If I set uses_original_profile=true, does that switch to the modular encoder? I noticed file sizes look like they double. It's still encoding lossy though... the lossless encode is 10-20x the size. // I don't understand at all the pros/cons of having both the vardct and modular encoders.
lvandeve
2021-08-19 06:02:32
For practical purposes, lossly needs xyb and uses_original_profile=false indeed So even with the behavior it has when false, with the data profile, it should be possible to eventually use and display images with any profile, including AdobeRGB
2021-08-19 06:03:03
As long as you have a CMS (skiaCMS, lcms, or part of the OS, display method or other libraries you use) it's possible
2021-08-19 06:05:01
If djxl produces a PNG without profile that the original PNG had, or JPEG with invalid profile, that may be a bug by the way
_wb_
2021-08-19 06:09:54
The reasoning is as follows: for lossy, it is fine to do color conversions because rounding errors don't matter, and better compression results can be obtained by using a perceptually relevant colorspace. Unlike YCbCr, which is not an absolute space (it can be applied to different RGB spaces and have different meanings) and also not very perceptual, jxl uses an absolute color space for that, which works for both SDR and HDR and any color gamut or bit depth. In the XYB case, the color space/profile and bit depth given in the jxl header is mostly just informative - you don't need it to interpret/display the pixel data, which is in XYB anyway, but it's useful in case you want to choose a representation to convert to if you want to save it to png, for example.
2021-08-19 06:11:55
For lossless, XYB cannot be used since it is not reversible exactly. The only kinds of color conversions you can do with lossless are simple RCTs (reversible color transforms) like YCoCg. In this no-XYB case, the colorspace/profile and bit depth in the jxl header are crucial information to interpret/display the pixel data.
2021-08-19 06:13:40
To make things easier in the decode api, the decoder just always returns pixel data in the format you request (uint8, float32, ...) along with a color profile that says how to interpret the pixel data.
xiota
2021-08-19 06:24:05
There may be problems with some of the ICC profiles I was using. GIMP works with them okay, but it looks like my other image viewer doesn't understand all of them. Maybe they don't all work with skcms. / There's always learning with new stuff. I'm probably overlooking something simple.
2021-08-19 06:31:22
Thanks for your help everyone.
lvandeve
2021-08-20 11:03:00
There are currently no callbacks for progress tracking in the encoder, but sounds useful. Do you happen to have experience with how other image codecs do it in good ways?
xiota
2021-08-20 12:16:51
Sorry for all the color questions... when I use JxlDecoderSetPreferredColorProfile, it doesn't seem to have any effect on the decoded output. Is there something I'm probably missing to use it correctly? Also, I can't find in the libjxl source where the transfer functions are applied. I just see lots of flags being passed around, like kSRGB and similar.
_wb_
2021-08-20 12:17:41
libjxl progress callback
xiota Sorry for all the color questions... when I use JxlDecoderSetPreferredColorProfile, it doesn't seem to have any effect on the decoded output. Is there something I'm probably missing to use it correctly? Also, I can't find in the libjxl source where the transfer functions are applied. I just see lots of flags being passed around, like kSRGB and similar.
2021-08-20 12:19:05
It sets a preference, but it doesn't guarantee that you will get what you prefer. You always have to use the data profile.
xiota
2021-08-20 12:23:25
Is there planned to be a function to force the color profile? Or a function to find out if the profile will be ignored? The problem I'm looking at right now is when using `decoder_oneshot` on a non-linear `jxl`, the output is nonlinear, but it seems that `pfm` files are expected to be linear. At least, that's how GIMP interprets them.
_wb_
2021-08-20 12:24:13
transfer functions are implemented here: https://github.com/libjxl/libjxl/blob/main/lib/jxl/transfer_functions-inl.h
2021-08-20 12:26:37
the preferred color profile cannot be forced because the image can be in an arbitrary icc profile space and libjxl_dec cannot convert from that
2021-08-20 12:28:24
the pfm has to be interpreted according to the icc profile, not in a default (linear) way
xiota
_wb_ transfer functions are implemented here: https://github.com/libjxl/libjxl/blob/main/lib/jxl/transfer_functions-inl.h
2021-08-20 12:30:26
when I use 'assign color profile' in GIMP, it makes no difference.
_wb_
2021-08-20 12:33:55
maybe try `convert decoded.pfm -profile decoded.icc decoded.png`
2021-08-20 12:34:00
or something like that
xiota
_wb_ maybe try `convert decoded.pfm -profile decoded.icc decoded.png`
2021-08-20 12:39:55
That's interesting... ImageMagick also seems to ignore the profile, but interprets `pfm` files as non-linear (vs GIMP interpreting them as linear). ImageMagick reads the profile, but it makes no difference in the `png` output. I suppose I can just consider this an idiosyncrasy of the PFM format. // Thanks for the help.
_wb_
2021-08-20 01:00:48
pfm and ppm are formats that just store numbers, and how to interpret them is not really specified
2021-08-20 01:01:53
one convention is that ppm is sRGB by default and pfm is linear (with sRGB primaries) but that is just a random choice and not everything makes the same choice
veluca
2021-08-22 10:19:09
Mhhh, at least some of the things in the issue have been solved - but you're right that we should probably at least reply :)
xiota
2021-08-22 10:05:34
Sorry if this is the wrong channel to ask in... does the API support making jxl files with multiple frames? I'm calling JxlEncoderAddJPEGFrame() multiple times, but djxl isn't able to process the result.
veluca
2021-08-22 10:13:38
... please file a bug? ๐Ÿ˜„
xiota
2021-08-22 10:14:40
If it's not supposed to be used that way, it isn't a bug...
veluca
2021-08-22 10:15:03
I don't know for sure, but I feel like it should work
2021-08-22 10:15:32
hence opening an issue is likely a good idea, so people that actually know can either answer or fix it ๐Ÿ˜„
xiota
2021-08-22 10:19:44
I'll look through the code and play around with it a bit more. I'll file a bug if I don't find anything.
2021-08-23 10:01:57
I'm thinking about trying to get the API to support 16-bit float and 32-bit int. It looks like the problem is ConvertFromExternal() infers float vs int based on bit depth. It looks like it's called from only a few files. Maybe a function could be written to wrap a modified ConvertFromExternal. Then the wrapper function could be removed when the existing calls are updated to use the new function. Is this something I should bother trying, or is it something that devs more familiar with the codec should be doing?
veluca
2021-08-23 10:05:12
mhh... I'll ask
2021-08-23 10:05:30
I don't personally see an issue
xiota
2021-08-23 10:08:29
Thanks. It looks like the encoder API should already support float16 and uint32 if that function didn't assume that 32 = float and 16 = int. There are some TODO comments to expand support, but I don't see how without making some changes to the function. Think it would be good to do before it's used in too many files. The decoder already works with float16. Don't know about uint32.
veluca
2021-08-23 10:17:10
uint32 is a bit tricky because you cannot do many things if you want lossless
2021-08-23 10:17:15
and you risk overflows and all
2021-08-23 10:17:51
also I'm not sure there is a lot of use for 32-bit per channel ๐Ÿ˜„
spider-mario
xiota I'm thinking about trying to get the API to support 16-bit float and 32-bit int. It looks like the problem is ConvertFromExternal() infers float vs int based on bit depth. It looks like it's called from only a few files. Maybe a function could be written to wrap a modified ConvertFromExternal. Then the wrapper function could be removed when the existing calls are updated to use the new function. Is this something I should bother trying, or is it something that devs more familiar with the codec should be doing?
2021-08-23 10:37:56
I think we have a TODO re: inferring float based on bit depth
2021-08-23 10:42:03
oh, you already said that, my bad
_wb_
2021-08-23 10:46:17
uint32 we cannot do in modular with the current code, it uses int32 buffers
xiota
spider-mario oh, you already said that, my bad
2021-08-23 10:46:46
For lossy it should work though? I think just adding `bool float_in` as a parameter would work (for lossy).
_wb_
2021-08-23 10:47:07
is there anything that works with 32-bit ints?
2021-08-23 10:48:35
16-bit ints is common, and so is 16-bit float. Anything I know with more bits uses float (and I have only seen FP24 or binary32 so far).
2021-08-23 10:49:46
(also note that there are two kinds of 16-bit float, there's binary16 with 5 exp bits and there's bfloat16 with 8 exp bits)
xiota
2021-08-23 10:52:33
The type is named `JXL_TYPE_FLOAT16` and `jxlinfo` with `jxl` encoded from `exr` with `cjxl` reports 5 exp bits. I'd think bfloat16 would need a new type, like `JXL_TYPE_BFLOAT16`. Re uint32; if there weren't a type for it, I wouldn't have thought to bother. GIMP has a setting for uint32, but I don't think it's actually used by anyone for anything. It was probably added as future proofing.
_wb_
2021-08-23 11:05:03
I think for jxl we shouldn't add too many io formats - I would try to have only those that are actually used (somewhat commonly) by applications. I think that's uint8, uint16, binary16, binary32.
2021-08-23 11:05:15
Possibly bfloat16, I dunno
veluca
2021-08-23 11:12:27
go ahead and do it ๐Ÿ™‚ at least for FLOAT16... BFLOAT and U32 can wait until somebody actually needs those ๐Ÿ™‚
w
2021-08-23 11:14:25
what about rgb565? does this have a place in libjxl? I was thinking just as an output format
veluca
2021-08-23 11:15:11
how common is that? I'd think it's simple enough to convert to RGB888, but...
2021-08-23 11:15:27
also the decoder cannot output it IIRC
xiota
2021-08-23 11:18:29
<@179701849576833024> Thanks... I'll go ahead and work on getting float16 working with the public API. I'm pretty sure the rest of the encoder is already set up for it because `cjxl` converts `exr` using float16.
veluca
2021-08-23 11:18:56
or maybe you'll find new and interesting bugs, you never know ๐Ÿ˜›
xiota
veluca or maybe you'll find new and interesting bugs, you never know ๐Ÿ˜›
2021-08-23 11:25:05
If the bugs are too interesting, I'll need help. I don't know anything about how the compression algorithm works.
veluca
2021-08-23 11:25:34
we'll help if needed, no worries ๐Ÿ™‚
xiota
2021-08-23 08:36:24
So I found the answer to my question about calling JxlEncoderAddJPEGFrame multiple times... apparently it's not fully implemented yet. So it's producing bad output when used that way. Maybe I can look at it and see how feasible it would be for me to change.
2021-08-25 03:08:05
Suppose a `jxl` file has an ICC profile that skcms is unable to interpret. Currently, `djxl` quits with an error. Would it be better for it to issue a warning and just attempt to decode the file using some standard default?
2021-08-25 03:23:45
Also, what is the rationale for allowing only one of JxlEncoderSetColorEncoding or JxlEncoderSetICCProfile to be used? In its current implementation, JxlEncoderSetICCProfile doesn't parse the ICC profile. So the internal color encoding won't necessarily match the image. Perhaps it should be renamed JxlEncoderAttachICCProfile (or a new function created)? Then JxlEncoderSetColorEncoding can be used to set the encoding settings and the ICC profile attached separately?
veluca
2021-08-25 07:44:42
I believe the "doesn't parse the ICC" part is not intended behaviour... File a bug?
spider-mario
2021-08-25 08:35:27
is it not? donโ€™t we currently rely on a CMS for ICC parsing?
_wb_
2021-08-25 08:43:19
do we want to have a CMS-free encoder too? I thought that was only a concern for the decoder
2021-08-25 08:46:20
what would make sense to me is an api where if you don't provide CMS callbacks, you can only encode Enum colorspaces and decode without CMS (so either to a given Enum space if the image is in XYB, or to original space if the image is not)
2021-08-25 08:46:53
and if you do provide CMS callbacks, it can encode anything and decode to any target space
BlueSwordM
2021-09-07 11:56:04
False. BSD 3-Clause is not incompatible with the GPL.
190n
2021-09-08 01:05:50
i think they're talking about libjxl's specific patent grant, not BSD 3-clause in general
veluca
2021-09-08 06:02:47
Apache 2 is IIRC not incompatible with gpl-2 either... But IANAL
_wb_
2021-09-08 06:29:30
Nothing stops you from taking libjxl _without_ the patent grant, if you think that somehow gives you more rights
2021-09-08 06:31:06
By not tying the copyright grant to the patent grant, as we did before with the Apache 2 license, it can only give you more rights, not less, afaiu
spider-mario
veluca Apache 2 is IIRC not incompatible with gpl-2 either... But IANAL
2021-09-08 08:23:55
https://dwheeler.com/essays/floss-license-slide.html says itโ€™s only GPL 3
2021-09-08 08:24:41
the 3-clause BSD is โ€œBSD-newโ€
veluca
2021-09-08 08:46:05
in all of this the question is exactly what does "compatible with" mean in the context...
_wb_
2021-09-08 08:47:49
Compatibility sounds like an undirected/symmetric thing, but it's actually a directed thing if you look at that diagram
2021-09-08 08:49:22
Also it might be useful to make a version of that diagram that includes "generic proprietary software license"
Traneptora
2021-09-09 08:19:10
well as far as I'm familiar with it, the patent grant says "you can use it for any of these things royalty free *except"* and if the patent grant had simply been omitted, there would be no promises the patent grant just is a guarantee of certain rights under certain conditions
spider-mario
2021-09-09 08:43:39
yes, it seems the exception is only for itself
2021-09-09 08:44:00
not for the โ€œregularโ€ license
_wb_
2021-09-09 08:58:12
that's the main difference between BSD3+PATENTS and Apache 2.0: in the Apache license, the copyright license is conditioned on not doing patent litigation. Such a condition is not compatible with GPLv2 (which has other conditions but not that one), but it is compatible with GPLv3.
Traneptora
2021-09-10 10:50:30
as far as I'm aware though, GPLv3 has a bunch of restrictions in it that many people find unsatisfactory. restrictions not in GPLv2
Deleted User
2021-09-19 07:17:05
<@&803357352664891472> What are your current priorities regarding JXL?
_wb_
2021-09-19 07:26:28
For me, current priorities are: - jxl adhoc group meeting tomorrow (mostly about fixed point / hw implementation) - preparing everything for the October JPEG meeting (conformance, first draft of 2nd edition of 18181-1, etc) - quality assessment (new JPEG AIC activity, getting subjective results to get more insight in jxl and avif encoder performance) - libjxl API maturation - adoption encouragement - tooling improvements - knowledge dissemination (blogposts etc) - encoder improvements
Fraetor
2021-09-19 07:55:09
Is the 2nd edition of the spec just to clarify points and best practices that were vague in the first one?
_wb_
2021-09-19 07:59:54
Yes, to integrate the profiles&levels amendment and to fix spec typos and clarify stuff. No new features or extensions or anything exciting.
2021-09-19 08:02:51
(I don't really believe in extensions/new features in a widely used interchange format. It is what it is and that's it. Only if it is only used in use cases that are relatively niche/professional and where you can update everyone involved, I think it is really possible to add new features/extensions.)
Jyrki Alakuijala
2021-09-19 10:04:15
Faster decoding with high quality options (such as Gaborish and possibly even EPF) seem to be enablers -- currently the fastest decoding to enable JPEG XL on old android turns many improvements off (like EPF and Gaborish) Reacting to users' feedback, possible security findings, image quality findings (like those from Lee) as well as finalizing the API are pretty high in the priority list.
Scope
2021-09-20 08:49:45
Also about decoding speed in browsers, Chrome still does not support multi-threaded decoding per image and the difference with Firefox implementation is very noticeable, up to 5-10 times and higher (depending on number of cores/threads in CPU) and number of images per page I think it's also worth investigating and comparing and it's better to be able to decode each image with multithreading and manage total number of threads in general, than to have no such option and expect that number of images will always be higher than number of free threads
Jyrki Alakuijala
2021-09-20 09:23:51
it is a balance between binary size and coding speed -- currently when it is behind a flag, binary size has a larger user count than the coding speed
veluca
2021-09-20 01:33:46
IIRC it is problematic in some ways, I don't remember exactly which ways
Traneptora
2021-09-20 06:01:01
What is the channel <#824000991891554375> for? Like what's there? There's no readme. Just a bunch of data.
veluca
2021-09-20 06:01:34
in what sense?
2021-09-20 06:03:59
ah, it is to post interesting *small* JPEG XL files - i.e. generated to be small, say with https://jxl-art.surma.technology/ - where you can input a text description of a decision tree / spline definition / other fun things (full doc https://jxl-art.surma.technology/wtf.html) and obtain the JXL from it
Petr
Traneptora What is the channel <#824000991891554375> for? Like what's there? There's no readme. Just a bunch of data.
2021-09-21 06:14:23
See the very beginning of that channel: https://discord.com/channels/794206087879852103/824000991891554375/824001294116454420
Traneptora
Petr See the very beginning of that channel: https://discord.com/channels/794206087879852103/824000991891554375/824001294116454420
2021-09-21 09:47:09
I see. That message should be pinned to that channel
_wb_
2021-09-21 10:14:58
Done
monad
2021-09-21 08:56:49
That kind of info would be more visible in the channel topic.
novomesk
_wb_ For me, current priorities are: - jxl adhoc group meeting tomorrow (mostly about fixed point / hw implementation) - preparing everything for the October JPEG meeting (conformance, first draft of 2nd edition of 18181-1, etc) - quality assessment (new JPEG AIC activity, getting subjective results to get more insight in jxl and avif encoder performance) - libjxl API maturation - adoption encouragement - tooling improvements - knowledge dissemination (blogposts etc) - encoder improvements
2021-09-24 08:20:27
I would put portability among priorities too.
_wb_
2021-09-24 08:36:13
Yes - anything in particular that needs to be done in that regard?
novomesk
_wb_ Yes - anything in particular that needs to be done in that regard?
2021-09-25 05:53:27
I hope that MSYS2 platform receives more attention. At least to ensure every release builds easily there and decoding/encoding work without crashes. MSYS2 is inevitable for Windows GIMP, some other image software build Windows versions there too. Windows is not only MSVC.
spider-mario
2021-09-26 09:55:04
for what itโ€™s worth, I build very often with MSYS2
2021-09-26 09:55:19
although I donโ€™t really use the GIMP plugin
xiota
2021-09-27 11:51:16
<@!604964375924834314> My 2c โ€” You should use the GIMP plugin. ๐Ÿ˜
veluca
2021-09-27 12:15:35
well, I don't use GIMP ๐Ÿ˜›
2021-09-27 12:34:50
I don't do simple image editing very often :P
spider-mario
2021-09-27 01:24:13
for the plugin to be applicable, the editing has to be both in GIMP and involving jxl files
2021-09-27 01:24:39
the latter is not yet very frequent as far as I can tell
Scope
2021-09-27 11:49:34
I also had no problems with MSYS2, but I do not use plugins and only use Clang as compiler, except that problems were and probably still are with GCC and AVX2
spider-mario
2021-09-28 08:11:16
oh, right, I use clang too
XAMPPRocky (she/her)
2021-11-04 03:15:04
Hey, I was interesting in writing my own parser/decoder for parts of the JXL spec, however I cannot find any guidance on feasibility (legal wise) of alternative implementations of `libjxl`. The standards themselves seems to be only available behind the ISO paywall, the `libjxl` implementation licenced under BSD-3, but with additional patent grants only granted to `libjxl` project. Would any of the devs be able shed any light as to whether alternative open source implementations actually possible for people to implement or is this a "Use `libjxl` or nothing" situation?
_wb_
2021-11-04 03:21:33
Alternative open source (or proprietary, even) implementations are very possible and encouraged!
2021-11-04 03:24:45
The patents are also granted for other implementations, both Google and Cloudinary filed a Type 1 declaration to ISO to make it clear that they intend to make patents universally granted, with the only reservation being defensive: if someone litigates claiming they own patents on things essential to implement jxl, Google and Cloudinary will retaliate by not granting their patents to that patent troll
Scope
2021-11-04 03:26:10
There are also <https://github.com/libjxl/jxl-rs>
XAMPPRocky (she/her)
2021-11-04 03:29:16
<@!794205442175402004> Thanks for your helpful reply! that does clear it up. P.S. I enjoyed your recent update talk on JXL. ๐Ÿ™‚ <@!111445179587624960> Oh nice, didn't see that, I only saw another `libjxl-rs` which calls into `libjxl`. I might end up just contributing to that when I find the time.
veluca
XAMPPRocky (she/her) <@!794205442175402004> Thanks for your helpful reply! that does clear it up. P.S. I enjoyed your recent update talk on JXL. ๐Ÿ™‚ <@!111445179587624960> Oh nice, didn't see that, I only saw another `libjxl-rs` which calls into `libjxl`. I might end up just contributing to that when I find the time.
2021-11-04 06:55:50
contributions are welcome! I started it mostly as a personal fun project, so no promises, but I can certainly at least review ๐Ÿ™‚
XAMPPRocky (she/her)
veluca contributions are welcome! I started it mostly as a personal fun project, so no promises, but I can certainly at least review ๐Ÿ™‚
2021-11-04 06:59:30
Cheers, yeah I'm not trying to build something for production (yet). Mostly just trying to satisfy my own personal curiosity of how image formats work, and how I do that is writing it in Rust. ๐Ÿ˜„
veluca
2021-11-04 07:01:00
FWIW, reading the C++ code may be a better way to figure out what should be done than reading the spec ๐Ÿ˜›
_wb_
2021-11-04 07:02:47
Would be good to see if an implementation from spec doesn't reveal any spec bugs though :)
XAMPPRocky (she/her) Cheers, yeah I'm not trying to build something for production (yet). Mostly just trying to satisfy my own personal curiosity of how image formats work, and how I do that is writing it in Rust. ๐Ÿ˜„
2021-11-04 07:06:00
Your direct messages are closed
XAMPPRocky (she/her)
_wb_ Your direct messages are closed
2021-11-04 07:06:39
Updated ๐Ÿ™‚
veluca FWIW, reading the C++ code may be a better way to figure out what should be done than reading the spec ๐Ÿ˜›
2021-11-04 07:21:20
That would require me to understand C++ ๐Ÿ˜„
_wb_
XAMPPRocky (she/her) Updated ๐Ÿ™‚
2021-11-04 07:29:10
Still cannot send you a message or send a friend request so I can send a message
veluca
XAMPPRocky (she/her) That would require me to understand C++ ๐Ÿ˜„
2021-11-04 07:31:33
easier than to understand the spec ๐Ÿ˜›
monad
2021-11-04 07:40:18
||*someone trying to leak the spec again*||
XAMPPRocky (she/her)
_wb_ Still cannot send you a message or send a friend request so I can send a message
2021-11-04 07:42:28
Hmm, odd I set it both on a server and global level to allow messages. I've sent a friend request, feel free to unfriend after.
_wb_
veluca easier than to understand the spec ๐Ÿ˜›
2021-11-04 07:52:27
Not sure if the libjxl code is the most readable description of the codec - a naive and slow implementation with a simple and dumb encoder would likely be a lot smaller and easier to understand
veluca
2021-11-04 07:53:47
I never said it's the *easiest* way - just that it's *easier*
_wb_
2021-11-04 07:56:03
Not sure, the spec is also not a fun or easy read, but at least in the second edition it will be somewhat structured and hopefully somewhat clear
veluca
2021-11-04 09:21:04
yeah second ed might tip the scales
novomesk
2021-11-12 09:29:47
I am trying to contribute my Qt plug-in to KDE. The KDE developer did tests with valgrind and saw a "possibly lost" memory record. Can you take a look if it is something to worry about? https://invent.kde.org/frameworks/kimageformats/-/merge_requests/41#note_338195
_wb_
2021-11-12 09:34:55
Interesting, that does look like the memory for (default) quant tables doesn't get freed. I wonder why it gets allocated in the first place in a jxlinfo scenario (where no actual decoding happens). Maybe an opportunity to save some memory in the no-decode/modular-only cases? <@179701849576833024>
veluca
2021-11-12 09:36:10
Mhhh interesting, tbh it doesn't really matter much but there is indeed no reason
2021-11-12 09:36:43
Which reminds me that I don't think we ever wrote the code to allow to keep those tables out-of-process
2021-11-12 09:37:02
Anyway, they don't get freed because they are stored in static memory
_wb_
2021-11-12 09:41:07
Is the idea that they get initialized only once per process? Are the default quant tables computed?
2021-11-12 09:41:54
(as opposed to just a bunch of values that are hardcoded directly? To save binary size?)
2021-11-12 09:43:47
And is it possible to share them between different processes?
2021-11-12 09:45:38
It's "only" 3 MB but then again when the old jpeg was made, some people couldn't imagine computers with more than 640 KB of RAM...
veluca
2021-11-13 01:23:49
In order: yes, yes, indeed to save size, you can share them in theory but not in the current code
_wb_
2021-11-13 03:13:04
We now compute all of them all of the time? Might be better not to compute them until needed (the biggest ones will never be needed with the current encoder)
Deleted User
2021-11-24 02:45:24
<@!604964375924834314> Would you explain to me very briefly, how JXL is using the 8-entry LUT to achieve noise on images? I'm wondering why the same ISO setting causes different "80 Bit stuff" (those 10 Byte in the header that make noisy images bigger than their counterparts) across different images. Is a given ISO value image-dependent or is JXLs noise in general image-dependent?
spider-mario
<@!604964375924834314> Would you explain to me very briefly, how JXL is using the 8-entry LUT to achieve noise on images? I'm wondering why the same ISO setting causes different "80 Bit stuff" (those 10 Byte in the header that make noisy images bigger than their counterparts) across different images. Is a given ISO value image-dependent or is JXLs noise in general image-dependent?
2021-11-24 04:32:16
the LUT generated by `--photon_noise`, besides the ISO value, depends only on the image resolution: https://github.com/libjxl/libjxl/blob/d182ba3ebeff9868657ff0a103f8fa0002b38f2b/lib/jxl/enc_photon_noise.h#L18
2021-11-24 04:32:36
it varies the per-pixel noise in such a way that the noise over a given fraction of the image would stay consistent
2021-11-24 04:33:20
in a sense, it assumes a fixed physical viewing size (for example โ€œfullscreenโ€), rather than 1:1 pixel mapping
Deleted User
2021-11-24 04:44:04
Ohhh, I see, interesting! So always doing a 1:1 pixel mapping would result in a constant LUT?
spider-mario
2021-11-24 04:51:14
yes, if we were to assume that images with lower resolution have a lower resolution because they are taken from a subset of the โ€œvirtual sensorโ€ that we simulate, then they would still receive the same amount of light per pixel, and so they would have the same noise per pixel as well
2021-11-24 04:51:32
and so it would look similarly noisy if shown at a correspondingly smaller physical scale than for the higher-resolution image
2021-11-24 04:51:40
(but noisier if shown at the same size)
2021-11-24 04:52:12
but so this is all encoder-side
2021-11-24 04:52:33
this is how the encoder currently chooses to use the ISO parameter to generate an appropriate LUT
2021-11-24 04:53:22
on the bitstream / decoder side, the noise is pregenerated as a separate texture, and the LUT simply indicates how much of that texture to add to the image as a function of the XYB values
_wb_
2021-11-24 06:04:46
Or I guess RGB values if you would apply this on e.g. a lossless modular image
spider-mario
2021-11-24 06:06:22
unfortunately, there is a bit of dependency on XYB in the way that it works
2021-11-24 06:06:45
technically, the bitstream allows having noise in a non-XYB image, but I am not sure that the results would be considered useful in most cases
2021-11-24 06:07:09
https://github.com/libjxl/libjxl/blob/d182ba3ebeff9868657ff0a103f8fa0002b38f2b/lib/jxl/dec_noise.cc#L233-L246
2021-11-24 06:08:41
(I tried it when I hacked noise into `jxl_from_tree` to test photon noise while it was still a perl script outputing a textual LUT)
Deleted User
spider-mario on the bitstream / decoder side, the noise is pregenerated as a separate texture, and the LUT simply indicates how much of that texture to add to the image as a function of the XYB values
2021-11-24 06:14:23
Okay, so a function that generates a LUT for `sqrt(Y) * noiseStrength` would be what I'm looking for, right?
spider-mario
2021-11-24 06:15:37
that sounds plausible, I am not 100% sure about the sqrt but probably something that looks like that equation, yes
2021-11-24 06:15:42
(and the sqrt is definitely worth a try)
2021-11-24 06:18:36
when the noise is applied in sRGB, it becomes a bit more colorful as you can see here
Deleted User
2021-11-24 06:19:25
Y from XYB is linear light from 0 to 1? So sqrt would be a simple gamma conversion. (btw, I hate slow mode ^^)
spider-mario
2021-11-24 06:22:41
sadly itโ€™s a bit more complicated, itโ€™s neither linear nor restricted to 1 ๐Ÿ˜„
2021-11-24 06:22:54
the exact relationship is https://github.com/libjxl/libjxl/blob/d182ba3ebeff9868657ff0a103f8fa0002b38f2b/lib/jxl/enc_photon_noise.cc#L60-L61 but itโ€™s roughly cubic
Deleted User
2021-11-24 06:36:36
But at least this conversion already exists. So, all in all, how much work would it be to add an option `perceptual_noise=X` that creates a noise LUT with (roughly) even amplitude across the brightness (with 1:1 pixel mapping)? ๐Ÿ˜‡
spider-mario
2021-11-24 06:40:43
mostly plumbing (in the manner of https://github.com/libjxl/libjxl/pull/307) + determining the correct equation
2021-11-24 06:41:08
it would even be possible to do the latter before the former, by just hacking `enc_photon_noise` such that it doesnโ€™t do what it currently does anymore ๐Ÿ˜„
2021-11-24 06:41:22
and then once it works, actually do it in a separate module
Deleted User
spider-mario on the bitstream / decoder side, the noise is pregenerated as a separate texture, and the LUT simply indicates how much of that texture to add to the image as a function of the XYB values
2021-11-25 02:53:15
What is the exact function? Could somebody (secretly) screenshot the mathematical formula from the spec?
_wb_
2021-11-25 03:11:23
2021-11-25 03:12:19
Deleted User
2021-11-25 03:14:20
thx, got it. You can delete it now, before someone sees that. ^^
_wb_
2021-11-25 03:41:57
I think it is fair use to quote snippets from the spec like that
2021-11-25 03:43:07
if it isn't, then it's up to ISO to send me a cease and desist letter, I guess
Deleted User
2021-11-25 04:15:44
ok, so the 8 LUT entries just map to linearly interpolated parts of Y from 0 to 1 (anything above 1 just uses LUT[7]). If we would live in a world where Y ~ brightness then I guess a noise parameter from issue #900 could simply be duplicated to each LUT entry, right?
spider-mario
2021-11-25 04:25:28
might work indeed
Deleted User
2021-11-25 07:00:05
this doesn't sound very confident :D
spider-mario
2021-11-26 07:39:54
that's just how I am in general, don't read too much into it ๐Ÿ˜
_wb_
2021-11-29 06:11:42
Asan and windows builds are currently failing on main, is someone taking a look at that?
spider-mario
2021-11-29 09:20:22
it seems that the ASAN failure started with https://github.com/libjxl/libjxl/commit/ee924953eb2d2ecbd2a32f7efde898eeff26ec70, not sure if Eugene is aware
w
2021-11-29 10:22:12
the windows builds is a simple fix too simple but also opinionated that i don't feel comfortable making a pr for
spider-mario
2021-11-29 10:35:07
whatโ€™s the problem with the Windows one? I donโ€™t see the actual error
2021-11-29 10:35:30
ah, never mind, found it
2021-11-29 10:35:37
hadnโ€™t realized ^F was not functional on that pageโ€ฆ
w
2021-11-29 10:37:33
im unsure what the style for libjxl or in general is for the c++20 initializer. for firefox, it's `/*.thing =*/thing,`
spider-mario
2021-11-29 10:39:15
for us, itโ€™s close, I think `/*foo=*/bar` would be most common
2021-11-29 10:39:19
itโ€™s what my fix does
w
2021-11-29 10:44:35
are there plans to/ is someone adding devtools to the builds?
Vincent Torri
2021-12-09 08:22:20
afaik asan is not working on windows, gcc or clang, at least last time i tried
_wb_
2021-12-09 08:24:14
We are struggling a bit with libpng
2021-12-09 08:25:01
Can you check if https://github.com/libjxl/libjxl/pull/976 helps?
Vincent Torri
2021-12-09 08:28:56
setjmp, horror !
_wb_
2021-12-09 08:31:07
Libpng's way of error handling
2021-12-09 08:31:16
Libjpeg's way too btw
2021-12-09 08:31:30
That's how it was done in the 1990s
Deleted User
2021-12-21 01:33:07
Would it be useful/beneficial if fjxl could be used for alpha of VarDCT images?
_wb_
2021-12-21 01:56:20
currently we do slightly lossy modular for alpha of vardct
2021-12-21 01:57:04
using fjxl would make it encode faster but density would probably suffer, and also there wouldn't be progressive previews of alpha
2021-12-21 01:57:32
(the advantage of doing slightly lossy is that it also gives lower res previews)
veluca
2021-12-21 01:58:11
we don't need to be *that* fast for alpha anyway ๐Ÿ˜„ there's many intermediate steps that are more reasonable tradeoffs
Deleted User
2021-12-21 02:23:27
๐Ÿ‘Œ
2021-12-22 06:10:07
Would it be useful/beneficial if fjxl could be used to realtime-compress a video capture (like desktop, presentation slides, ...) with new frames only storing the difference to the previous one?
BlueSwordM
Would it be useful/beneficial if fjxl could be used to realtime-compress a video capture (like desktop, presentation slides, ...) with new frames only storing the difference to the previous one?
2021-12-22 06:18:36
Yes, but because of screen content modes in other modern video encoders, it would be more efficient and faster for the job to just use them instead.
Deleted User
2021-12-22 06:22:16
Also for true lossless 8 Bit?
veluca
2021-12-22 06:32:28
Not sure if it would be *faster*... But for sure more efficient
2021-12-22 06:32:58
In principle a video-fjxl could be done but I don't really see why you should
BlueSwordM
Also for true lossless 8 Bit?
2021-12-22 06:37:24
Yeah, not at all for lossless then ๐Ÿ˜› Screen content tools in video encoders do utilize lossless transforms, but the resulting video is still in 8-bit YUV.
_wb_
2021-12-22 06:39:55
For screen sharing it wouldn't be the worst idea to use jxl, I suppose. Could do streaming encode and decode, and encode cropped frames with only the part that changes.
2021-12-22 06:40:40
But seems easier to just use a video codec
2021-12-22 06:43:23
If the use case is specifically a slideshow or something, then doing that as jxl (or even apng) is probably possible, but tools and viewers are probably not going to deal well with long animated jxl/apng (e.g. they'll show no playback controls)
Deleted User
veluca In principle a video-fjxl could be done but I don't really see why you should
2021-12-22 10:45:17
Use-case would be something like recording a tutorial. You can store the (small) lossless fjxl for later editing or archival reasons locally while a version converted to VP9 or AV1 can be shared online.
BlueSwordM
Use-case would be something like recording a tutorial. You can store the (small) lossless fjxl for later editing or archival reasons locally while a version converted to VP9 or AV1 can be shared online.
2021-12-22 10:55:29
Well, there are other lossless video codecs much more suited to the task then
Deleted User
2021-12-22 10:58:02
So should it be possible to create fast lossless image version from these codecs as well or borrow ideas? Would be interesting how they compare.
2021-12-22 11:17:28
Just did a quick test with Logarith Lossless Codec (which is the only "good" realtime lossless video compressor I know of). A 21 sec desktop recoding flipping through a few windows and moving some around results in over 600 MB file. Converting that to a lossless animated WebP resulted in less than 19 MB. So FJXL could be around 30-40 MB which would be 20 times better if it could be used realtime.
Cool Doggo
2021-12-22 11:21:26
x264 lossless
BlueSwordM
Just did a quick test with Logarith Lossless Codec (which is the only "good" realtime lossless video compressor I know of). A 21 sec desktop recoding flipping through a few windows and moving some around results in over 600 MB file. Converting that to a lossless animated WebP resulted in less than 19 MB. So FJXL could be around 30-40 MB which would be 20 times better if it could be used realtime.
2021-12-22 11:34:41
Just use ffvhuff or ffv1. Lagarith practically does nothing.
Deleted User
2021-12-22 11:52:26
Conversion to ffvhuff resulted in over 1 GB, ffv1 was still over 500 MB.
spider-mario
Cool Doggo x264 lossless
2021-12-23 10:35:51
strictly speaking, isnโ€™t this lossless only with RGB matrix instead of Yโ€ฒCbCr? is compression still decent then?
2021-12-23 10:36:59
hm, I have a 1h24m 320ร—200 recording (prince of persia 2 playthrough), I guess I could give it a try and compare x264 lossless RGB and x264 lossless Yโ€ฒCbCr
2021-12-23 10:50:16
results are in PCM audio (49716 Hz, 16 bits, stereo): 1002โ€ฏMB zmbv as recorded by DOSBox: 77.7โ€ฏMB x264 ll, Yโ€ฒCbCr: 302โ€ฏMB x264 ll, RGB: 353โ€ฏMB
2021-12-23 10:56:10
(flac compresses the audio to 262โ€ฏMB)
2021-12-23 10:58:59
ffv1 is slower and compresses ~100ร— worse than x264
2021-12-23 10:59:41
stopped it as the file was already 2.1โ€ฏGB after 5:40 of footage
Deleted User
spider-mario ffv1 is slower and compresses ~100ร— worse than x264
2021-12-23 11:45:55
So why even bother with FFV1 if x264 is better?
spider-mario
2021-12-23 11:46:30
caveat: this is just one file, with a specific type of content
2021-12-23 11:46:35
but it does raise the question, yes
_wb_
2021-12-23 12:10:10
I think ffv1 is just too stupid to do duplicate/cropped frames, so it explodes
2021-12-23 12:10:49
For movies where that doesn't help much, I think it is better
Deleted User
2021-12-23 01:28:09
I also tried yuv444 x264 and was surprised how good it worked and sad about neither ffmpeg nor OBS Studio supporting rgb24. <@!604964375924834314> How did you get RGB to work with x264?
spider-mario
2021-12-23 01:28:27
ffmpeg -c:v libx264rgb
2021-12-23 01:29:17
with `-qp 0` to make it lossless
Deleted User
2021-12-23 02:54:00
Compared to fjxl, x264rgb is still very CPU-heavy when moving windows (not realtime on my machine) while ultrafast is twice as large regarding file size. So a video codec based on fjxl would still be a good idea. ;)
Cool Doggo
2021-12-23 07:33:33
i tested with a very naive approach and it was 4x larger than lossless x264 on my test video speed wise it was also much slower (though this shouldnt be taken account for because like i said, it was a very naive approach) its also worth mentioning that the decode speed is also a big part of video, not just encoding speed
gnat
2021-12-25 03:55:58
Merry Christmas to all in JpegXL House, and to all a good night.
Traneptora
Compared to fjxl, x264rgb is still very CPU-heavy when moving windows (not realtime on my machine) while ultrafast is twice as large regarding file size. So a video codec based on fjxl would still be a good idea. ;)
2021-12-28 01:28:19
H.264 is really designed for YUV so 4:4:4 is going to outperform RGB even in lossless mode. That said, ffv1, utvideo, and magicyuv are all solid choices for screenrecording with ffmpeg
John
2022-01-02 04:06:09
Whats the best way to get into jxl development? any loose ends or projects in need programmers?
_wb_
2022-01-02 08:45:20
I suppose you can check the libjxl github issues and make a pull request to resolve one of them?
veluca
John Whats the best way to get into jxl development? any loose ends or projects in need programmers?
2022-01-02 09:18:23
definitely many, although I am not sure what would be a simple way to start...
Cagelight
2022-01-17 09:17:07
regarding this issue: https://github.com/libjxl/libjxl/issues/1038 is there a reason libjxl uses C++11? I was able to change CXX_STANDARD to 17 without issue, and it would allow this issue to easily be solved, as well as make things easier by being able to access C++14 and C++17 features
improver
2022-01-18 12:35:20
id guess compatibility with distros using older compilers
Cagelight
2022-01-18 12:36:49
I'd understand that to a degree, but compilers have had almost full support for C++17 since before even 2017, and I would tend to feel that supporting 5-years outdated software is a bit on the silly side
2022-01-18 12:43:15
I'm probably in the minority, I do all of my work in the latest C++ and I always find it difficult to go back to significantly older versions, C++14, C++17, and C++20 introduced so much amazing QoL
2022-01-18 01:01:04
Wow that's really surprising, I pity the devs stuck using that ๐Ÿ˜„
Traneptora
2022-01-18 12:01:49
It's fairly standard practice in C and C++ to code to older versions of the language. I have yet to see a major C project that codes to a standard later than C99.
spider-mario
2022-01-18 12:37:08
on the other hand, the fact that they chose C in the first place for their project means that they did not choose C++
2022-01-18 12:37:24
which suggests specific reasons for choosing C which might be lost by using a โ€œtoo modernโ€ version
improver
2022-01-18 05:01:48
arguably for old centos and debian versions its irrelevant as libjxl aint going to really land there anyway, no?
Fraetor
2022-01-19 08:31:00
I assume it is mostly cases where they are mandated from up high or have critical software that only runs on old versions, but still want some new features.
Scope
2022-01-20 09:05:53
Also, judging from posts on encode.su and some of my tests, it seems that official and nightly builds from Github are significantly slower (like 2-3 times slower on `-e 9`), I think if it is possible, it is worth changing the compiler to Clang, if MSVC is still used there <https://encode.su/threads/3520-WebP-2-experimental-successor-of-the-WebP-image-format?p=72710&viewfull=1#post72710>
2022-01-21 01:41:58
Nightly `768 x 1024, geomean: 0.03 MP/s [0.03, 0.04], 10 reps, 8 threads` `885 x 435, geomean: 0.10 MP/s [0.08, 0.12], 10 reps, 8 threads` Clang `768 x 1024, geomean: 0.05 MP/s [0.05, 0.05], 10 reps, 8 threads` `885 x 435, geomean: 0.16 MP/s [0.16, 0.17], 10 reps, 8 threads`
_wb_
2022-01-21 06:32:41
Wow that's a big difference between compilers...
Scope
2022-01-21 05:12:24
Also <https://encode.su/threads/3564-JXL-version-0-3-released?p=72763&viewfull=1#post72763>
_wb_
2022-01-21 05:58:22
``` C:\Users\XXXX>powershell -Command "(Measure-Command {C:\Users\XXXX\Documents\zComp\cjxl070p.exe -d 0 -s 9 -g 3 -E 3 -I 1 C:\Users\XXXX\Desktop\sheep\sheep_247_22608_177.png C:\Users\XXXX\Desktop\sheep\sheep_247_22608_177_jamaika.jxl | Out-Default}).ToString()" JPEG XL encoder v0.7.0 0.7.0-33e0c34 [Scalar] color_hints.cc:56: No color_space/icc_pathname given, assuming sRGB Read 800x592 image, 13.8 MP/s Encoding [Modular, lossless, tortoise], 8 threads. Compressed to 537811 bytes (9.085 bpp). 800 x 592, 0.01 MP/s [0.01, 0.01], 1 reps, 8 threads. 00:00:52.7404860 C:\Users\XXXX>powershell -Command "(Measure-Command {C:\Users\XXXX\Documents\zComp\cjxl.exe -d 0 -s 9 -g 3 -E 3 -I 1 C:\Users\XXXX\Desktop\sheep\sheep_247_22608_177.png C:\Users\XXXX\Desktop\sheep\sheep_247_22608_177_scope.jxl | Out-Default}).ToString()" JPEG XL encoder v0.7.0 36ece47 [AVX2,SSE4,SSSE3] Read 800x592 image, 25.5 MP/s Encoding [Modular, lossless, tortoise], 8 threads. Compressed to 537811 bytes (9.085 bpp). 800 x 592, 0.01 MP/s [0.01, 0.01], 1 reps, 8 threads. 00:00:37.9698896 C:\Users\XXXX>powershell -Command "(Measure-Command {C:\Users\XXXX\Desktop\cjxl_official.exe -d 0 -s 9 -g 3 -E 3 -I 1 C:\Users\XXXX\Desktop\sheep\sheep_247_22608_177.png C:\Users\XXXX\Desktop\sheep\sheep_247_22608_177_official.jxl | Out-Default}).ToString()" JPEG XL encoder v0.7.0 36ece47 [AVX2,SSE4,SSSE3,Scalar] Read 800x592 image, 28.0 MP/s Encoding [Modular, lossless, tortoise], 8 threads. Compressed to 537811 bytes (9.085 bpp). 800 x 592, 0.01 MP/s [0.01, 0.01], 1 reps, 8 threads. 00:01:26.0886139 ```
2022-01-21 05:58:48
that first one is compiled for Scalar only, no SIMD at all
2022-01-21 05:59:10
second assumes at least SSSE3 is available
2022-01-21 06:00:05
no clue why the third one is slow though
Scope
2022-01-21 06:01:46
Yes, the first one as I understand it is a Jamaika build and it has an old CPU and a strange manual compilation The last two are mine and the official build
_wb_
2022-01-21 06:04:27
is the speed difference only for modular encoding or also vardct?
2022-01-21 06:05:16
if the issue is SIMD, I would expect an even bigger speed difference for vardct
2022-01-21 06:05:53
if the issue is crappy compiler optimization, I would expect mostly modular to be affected
2022-01-21 06:06:25
could also be that the official build is somehow a debug build instead of a release build or something
Scope
2022-01-21 06:08:23
Mostly for the slowest modular modes, but I have not done a lot of comparisons, but it is most noticeable, I think it is something with the MSVC compiler and maybe not correctly working SIMD (some time ago AVX2+ did not work with MSVC compiler and maybe this difference is most noticeable on AVX2+ CPU)
2022-01-22 07:26:33
<https://encode.su/threads/3564-JXL-version-0-3-released?p=72776&viewfull=1#post72776>
_wb_
2022-01-22 08:34:07
So what's the build difference? Can we change our official build?
Scope
2022-01-22 08:47:51
Hmm, I found two building systems for Windows on the official Github, but not sure which one is used for nightly, I use Msys2 and Clang (and this will probably be better) <https://github.com/libjxl/libjxl/actions/workflows/build_test.yml> <https://github.com/libjxl/libjxl/actions/workflows/release.yaml>
2022-01-22 08:56:07
So it could be the difference between GCC/MSVC and Clang or something wrong with SIMD, I make a build for AVX2 as a low system (Haswell) and if this gives the biggest advantage then maybe would make two builds, one optimized for AVX2 and higher systems (like Clang `-O3 -march=haswell`) and one generic for compatibility
_wb_
2022-01-22 09:06:35
I have no clue but it does look like there's a pitfall that we should avoid, once discovered what it is we probably better update windows building instructions too
Scope
2022-01-22 09:42:38
Yes, after some tests with different compilers, Clang as a compiler has the biggest impact, even without additional options for AVX2 GCC and MSVC binaries are noticeably slower
Kleis Auke
2022-01-23 03:40:24
The Windows MSYS2 job is build with AVX2 disabled (in highway), which could also be the reason for that. See: <https://github.com/libjxl/libjxl/blob/aa16521154328c94bfc2b73a0e28bd5bd22330c1/.github/workflows/build_test.yml#L429>
2022-01-23 03:54:12
FWIW, one might also consider using an LLVM/Clang based cross-compile environment with <https://github.com/mstorsjo/llvm-mingw>. See for example this Dockerfile: <https://gist.github.com/kleisauke/ff56d99094eadb8d315c3715f460c5e9>.
Scope
2022-01-23 05:17:52
Yes, because old GCC versions don't work properly with AVX2, with the new ones it's working fine, but GCC is slower even if AVX2 is enabled (as can be noticed by my compiled versions and test scripts) https://discord.com/channels/794206087879852103/794206170445119489/934705313431580702
BlueSwordM
Kleis Auke FWIW, one might also consider using an LLVM/Clang based cross-compile environment with <https://github.com/mstorsjo/llvm-mingw>. See for example this Dockerfile: <https://gist.github.com/kleisauke/ff56d99094eadb8d315c3715f460c5e9>.
2022-01-23 08:09:24
Yooo thank you so much.
Deleted User
2022-01-26 02:50:51
Say you have a 16 Bit image with a gradient, converting it down to (lossless) 8 Bit with ordered dithering doesn't decrease the file size that much (especially on faster efforts) while 8 Bit without dither is far far smaller. I would be interested to know now if an encoder for JXL (or PNG) could be created that transforms 16 to some kind of dithered 8 Bit while knowing exactly how this dithering was applied to create a denser output.
_wb_
2022-01-26 04:37:29
I would convert it to 12 bit without dithering, and encode that losslessly
2022-01-26 04:37:57
that should be higher quality than 8-bit with dithering, and probably also denser
Deleted User
2022-01-26 05:41:07
Nice compromise for gradients but it probably won't be denser for mixed content.
_wb_
2022-01-26 06:56:20
Possibly some kind of near-lossless 12 bit could be interesting, where an error of +- 8 is allowed (so at 8-bit there is no difference), but in smooth regions with slow gradients, more precision is kept. I.e. predictor residuals around zero are stored as is, residuals that are larger get up to 3 lsb chopped off
2022-01-26 06:56:44
We do something like that for DC encoding to avoid banding
lithium
2022-01-28 04:17:21
Sorry to bother you, A little curious, libjxl 1.0 will be ready end of February, It's mean non-photo content quality and feature improvement will happen on March? I really look forward those improvement.<:BlobYay:806132268186861619> > https://discord.com/channels/794206087879852103/803574970180829194/928281741116981260
_wb_
2022-01-28 04:24:05
Likely I will _try_ to make improvements then, I am not going to promise that I will succeed though ๐Ÿ˜…
lithium
2022-01-28 04:56:08
Thank you very much ๐Ÿ™‚ I believe jxl team can make a great lossy encoder.
monad
2022-01-30 05:50:56
Doesn't sound ideal, whether it's a conversion error or playback error. I've never noticed that effect with cjxl conversions and viewing through Chrome (although I recall cjxl not properly handling some GIFs in other ways).
necros
2022-01-30 09:26:24
Sorry to disturb, was Irfanview`s bug
_wb_
2022-01-30 09:42:15
Still good to know there is/was a bug in Irfanview. Is there anything we can do to make it less likely that others have this bug?
necros
2022-01-30 09:56:57
<@!794205442175402004>Maybe Like bug report https://irfanview-forum.de/forum/program/bugreports/93817-animated-jxl-wrong-playback-speed-irfanview-4-59-x64
lithium
2022-02-01 07:11:45
Sorry to bother you, A little curious, About quality and feature improvement for non-photo content, jxl team will implement which method? 1. Improve PR466 separate option, this method probably can improve quality and avoid DCT worst case?. 2. Improve vardct mode for non-photo content and implement auto palette to avoid DCT worst case. 3. Implement higher epf on vardct mode and implement auto palette to avoid DCT worst case. (I guess higher epf maybe can reduce tiny artifacts?) 4. new method is on pipeline.
_wb_
2022-02-01 07:25:57
Nothing on the pipeline yet, but I am planning to do something like separate but without going fully two-layers, and somehow avoiding border issues
BlueSwordM
_wb_ Nothing on the pipeline yet, but I am planning to do something like separate but without going fully two-layers, and somehow avoiding border issues
2022-02-01 09:37:08
On avoiding border issues, isn't it possible to just apply a gaussian across them?
lithium
2022-02-02 07:47:28
I understand, Thank you for your reply ๐Ÿ™‚
novomesk
2022-02-10 09:29:44
kimageformats are fuzed using oss-fuzz. libjxl 0.6.1 is used. I observed an old issue from the fuzzer: Issue 41159: kimageformats:kimgio_jxl_fuzzer: Integer-overflow in jxl::DecodeTree Crash Type: Integer-overflow Crash Address: Crash State: jxl::DecodeTree jxl::DecodeTree jxl::ModularDecode Do you need the testfile from this case? Or do you think the overflow is probably fixed already in master via some other case?
_wb_
2022-02-10 09:30:53
doesn't hurt to check
novomesk
2022-02-10 09:35:33
Kleis Auke
2022-02-11 04:39:08
libvips' CIFuzz integration is failing with: ``` In file included from /src/libjxl/lib/jxl/enc_color_management.cc:27: In file included from /src/libjxl/third_party/highway/hwy/foreach_target.h:91: /src/libjxl/lib/jxl/enc_color_management.cc:237:66: error: expected ';' after expression mutable_xform_src[x] = 100.f - 100.f * mutable_xform_src[x] ^ ; In file included from /src/libjxl/lib/jxl/enc_color_management.cc:27: In file included from /src/libjxl/third_party/highway/hwy/foreach_target.h:102: /src/libjxl/lib/jxl/enc_color_management.cc:237:66: error: expected ';' after expression mutable_xform_src[x] = 100.f - 100.f * mutable_xform_src[x] ^ ; In file included from /src/libjxl/lib/jxl/enc_color_management.cc:27: In file included from /src/libjxl/third_party/highway/hwy/foreach_target.h:113: /src/libjxl/lib/jxl/enc_color_management.cc:237:66: error: expected ';' after expression mutable_xform_src[x] = 100.f - 100.f * mutable_xform_src[x] ^ ; /src/libjxl/lib/jxl/enc_color_management.cc:237:66: error: expected ';' after expression mutable_xform_src[x] = 100.f - 100.f * mutable_xform_src[x] ^ ; 4 errors generated. ``` https://github.com/libjxl/libjxl/blob/4bba562a52e8f830dc0c62d2403fc135813cc72d/lib/jxl/enc_color_management.cc#L237
Koromaru Korรผko
2022-02-11 05:59:54
https://github.com/libjxl/libjxl/pull/1171 quick fix posted
_wb_
2022-02-11 08:22:41
Huh, looks like we need an lcms build in CI...
Koromaru Korรผko
2022-02-11 08:23:12
lcms?
_wb_
2022-02-11 08:31:00
cjxl/djxl can be built with lcms2 or with skcms to do the arbitrary ICC profile color conversions.
2022-02-11 08:32:12
Looks like the code path for building with lcms2 is not well covered, if a typo that prevents it from compiling gets through CI
chafey
2022-02-18 01:28:51
Hi - I am looking to connect with a dev that is working on lossless performance optimization. I met him a few weeks back at the DICOM WG-04 meeting but forgot his name. Thanks
veluca
2022-02-18 01:35:45
probably me? ๐Ÿ™‚
2022-02-18 01:36:08
but <@!794205442175402004> too
_wb_
2022-02-18 01:36:51
I'm Jon, veluca is Luca
chafey
2022-02-18 07:18:19
yes Luca i think - will dm you
Master Of Zen
2022-03-04 04:17:56
What would be goto resources/books/courses to learn more on image/video and compression in general?
Deleted User
2022-03-07 03:27:26
Are we gonna see 1.0 this month?
_wb_
2022-03-07 04:25:49
https://tenor.com/view/fortune-teller-crystall-ball-psychic-clairvoyant-gif-5100696
Master Of Zen
2022-03-12 10:15:32
Sadly, no response
_wb_
2022-03-12 11:15:44
I think somewhere in April is a safer bet
SleepyJoe
2022-05-07 01:58:42
Hi! I am currently trying to construct a jxl encoder for java over the existing wrapper (on my own fork on github for now at least). I have a question on the already existing infrastructure, who can I talk to?
_wb_
2022-05-07 02:07:36
best is to ask in <#804324493420920833>, many libjxl devs are on this discord and also many application devs who integrated libjxl are here so plenty of people can respond
Jyrki Alakuijala
2022-06-28 08:27:30
there will be an intermediate version before 1.0 -- to package all the improvements in the head and proper progression support into a lib that is available soon
Vincent Torri
2022-08-02 07:17:20
<@532010383041363969> you (the devs) should also clean issues and PR list before
The_Decryptor
2022-08-02 10:01:28
https://github.com/libjxl/libjxl/blob/79293824dcdb91f1f934244b6f48e83bfed97588/tools/cjxl_main.cc#L353 < Spelling mistake in a flag here, does that require a bug report?
veluca
2022-08-02 11:36:37
yes please
The_Decryptor
2022-08-02 11:41:05
Done ๐Ÿ‘
username
2022-08-09 08:45:24
0.7 RC doesn't come with the needed dlls just like the nightly builds
fab
2022-08-09 09:02:24
I have them jendalinda send them tomorrow ill rruplod
username
2022-08-09 09:10:32
I have the dlls myself but I shoulden't have to need them
Kleis Auke
2022-08-09 09:57:09
I think the issue is that Brotli always (except on Emscripten) builds shared and static libraries (suffixed as `-static`) and ignores CMake's `BUILD_SHARED_LIBS` option. PR <https://github.com/google/brotli/pull/655> would fix that (AFAIK, that patch is used by most distros that distribute static libraries and/or want to reduce the build time).
JendaLinda
2022-08-10 04:47:53
This has to be resolved in the release. The Brotli dlls should be either included or not needed.
spider-mario
username 0.7 RC doesn't come with the needed dlls just like the nightly builds
2022-08-11 11:08:28
on a tangential note, is that windows vista :S
2022-08-11 01:42:39
oh, yeah, hadnโ€™t seen that the version number was there, thanks
Traneptora
2022-08-14 05:45:26
Is the new version of libjxl going to be called 0.8? I noticed that the SONAME is libjxl.so.0.8
Fraetor
2022-08-14 06:49:09
Hopefully the version after 0.7 will be 1.0
_wb_
2022-08-14 06:57:40
The new release will be 0.7
2022-08-14 06:59:07
The git main branch is now calling itself 0.8 because it will become whatever the next release will be, which could be 1.0
Traneptora
2022-09-09 01:59:00
Speaking of 0.7, we've been in RC for that for a while. What's the current update for 0.7 release?
novomesk
2022-09-09 02:54:30
I'd really like to have version numbers in headers in released 0.7.0 . If it is not possible, I can live without it (but other downstream developers may keep requesting that). If 0.7.x branch is not ready for the release, maybe RC2 would be fine so it gets even more testing.
2022-09-09 04:01:23
I have a report from oss-fuzz: Issue 51177: kimageformats:kimgio_jxl_fuzzer: Heap-buffer-overflow in jxl::PerformBlending We use 0.7.x branch there.
Moritz Firsching
2022-09-23 07:04:08
yes. However, if you have a special interest in a specific issue feel free to bring it up here and/or on github as well...
novomesk
2022-10-06 05:50:30
I received following report regarding One Definition Rule: https://bugs.gentoo.org/875617 It is something that could be solved easily?
veluca
2022-10-06 06:45:02
uh, yeah, that's an issue
2022-10-06 06:45:10
it should also be easy to fix
2022-10-06 06:45:13
can you file a bug?
novomesk
2022-10-06 06:48:54
I will post the issue tomorrow regarding the ODR.
Mrtt
2022-10-13 09:44:34
<@179701849576833024> : i was looking a bit into your fast_lossless code, and wondered how much effort would be required to go full 16bit depth, i mean i can help a bit as i'm quite fluent in c++, and algorithms, but i didn't spent a lot of time checking where i can adjust, would you mind spotting the area where adjustement may be required ?
_wb_
2022-10-13 09:49:48
the current code already does 10/12 bit; to go full 16-bit will be harder because then the values don't fit in int16_t anymore...
Mrtt
2022-10-13 10:11:35
<@794205442175402004> : the question is "16bit"
_wb_
2022-10-13 10:17:32
I guess the main thing to do is to replace the int16_t stuff with int32_t and to modify the huffman coder to deal with that. It will come at a price in terms of speed.
veluca
2022-10-13 10:40:47
mhhh I suspect you need to basically change everything ๐Ÿคฃ
2022-10-13 10:41:15
both the huffman coding and the memory buffers assume you never need more than 16 bits per symbol -- and you do for 16bd content
Mrtt
2022-10-13 12:00:45
hum ๐Ÿ™‚ thanks for the feedback on this topic ๐Ÿ˜„
2022-10-13 01:34:00
technically speaking i do not mandatoringly really hit the 16 bit ... but 15 bit is often the case, i have large microscopy images, with (true) 16bit sensor dynamic, but my background noise is often a little offested like 100+ and but max signal is often burning the sensor, so basically we technically can think of shifting the signal to an offseted 0 level, (but this is felt as a sensitive topic, i'm selling the losless part ๐Ÿ™‚ )
_wb_
2022-10-13 01:44:44
I suppose a 32-bit version of fast_lossless could be made with just no simd in the huffman coding, and it should still be quite a bit faster than libjxl e1
Mrtt
2022-10-14 07:03:40
sounds interesting, i'll try to have to time to give a try at a non simd 32bit version as a first intention for testing purposes
_wb_
2022-10-31 04:47:44
Well libjxl is kind of already part of OIN via Google
Kleis Auke
2022-11-02 10:22:53
A couple of OOM issues related to libjxl reported on libvips' OSS-Fuzz project seem to be duplicates. I was able to reproduce this with `python infra/helper.py reproduce`, but not locally without sanitizers, which might indicate libc++/libstdc++ compatibility thing. The issues in question are 49809, 49812, 49814, 49816, 49823 and 52867 (as an example, the first one causes a `malloc(2684354560)` call). Any ideas?
2022-11-02 11:40:43
FWIW, you'll need to append 4 bytes to the file to reproduce it within the libjxl fuzzer. For example, with https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49809 (disclosed tomorrow), I see: ```bash # Last 4 bytes in djxl_fuzzer are flags $ truncate -s +4 ~/Downloads/clusterfuzz-testcase-minimized-sharpen_fuzzer-6596094166958080 $ python infra/helper.py build_fuzzers libjxl $ python infra/helper.py reproduce libjxl djxl_fuzzer ~/Downloads/clusterfuzz-testcase-minimized-sharpen_fuzzer-6596094166958080 ... ==8== ERROR: libFuzzer: out-of-memory (malloc(2684354560)) ... ```
DZgas ะ–
2022-11-20 07:57:42
I have little problem with encoding my little picture 32768x32768 png ```JPEG XL encoder v0.8.0 72af6c7 [Unknown] Reading image data failed. ```
_wb_
2022-11-20 07:59:28
Probably out of memory, I would guess
DZgas ะ–
_wb_ Probably out of memory, I would guess
2022-11-20 08:02:53
the error message is issued instantly, besides, I allocated 20 GB of SWAP, but the most important thing is that mozjpeg works without problems
_wb_
2022-11-20 08:07:32
Oh, in that case no idea. Try a debug build to see if it gives more info, or else share the png so we can try it...
DZgas ะ–
_wb_ Oh, in that case no idea. Try a debug build to see if it gives more info, or else share the png so we can try it...
2022-11-20 08:41:51
What kind of debug builds are talking about? where to get them? are there builds for Windows? I had a problem with compressing this 3 GB file, OptiPNG and XnConvert had a memory problem. In the end, I was Create to Uncompressed empty white sheet use Python Pillow, gave an error in the same way in cjxl. But after Pillow compressing I getting 3 megabytes, everything suddenly worked, Which means that somewhere in the code the maximum size of the Input file is written! (which print "Reading image data failed.") and later gave error ```JPEG XL encoder v0.8.0 72af6c7 [Unknown] Read 32768x32768 image, 3181331 bytes, 75.6 MP/s Encoding [VarDCT, d1.000, effort: 1], D:\a\libjxl\libjxl\lib/jxl/image.cc:94: JXL_CHECK: bytes_.get()``` and same ```JPEG XL encoder v0.8.0 72af6c7 [Unknown] Read 32768x32768 image, 3181331 bytes, 105.9 MP/s Encoding [Modular, lossless, effort: 1], D:\a\libjxl\libjxl\lib/jxl/image.cc:94: JXL_CHECK: bytes_.get()```
_wb_
2022-11-21 06:20:25
Encode memory is not very optimized at all yet, and we lack options to skip global optimization and encode groups independently...
DZgas ะ–
_wb_ Encode memory is not very optimized at all yet, and we lack options to skip global optimization and encode groups independently...
2022-11-21 07:12:03
Just now wanted to ask what's the problem with compressing it like 4 (or more) separate (block) images and then combining it into one...... That is, the answer to my task is that at the moment -- the cjxl encoder cannot compress images of this scale. In this case the question is, there is already some kind of software that can use the "limitless possibilities" of the image scale of the JPEG XL standard?
_wb_
2022-11-21 07:23:37
We should probably add a low memory encode option to libjxl that does one 2048x2048 tile at a time
DZgas ะ–
2022-11-21 07:32:23
Yes, this is what need.
_wb_
2022-11-21 07:36:37
For lossless, you can meanwhile use fjxl. It should use less memory than libjxl
DZgas ะ–
_wb_ We should probably add a low memory encode option to libjxl that does one 2048x2048 tile at a time
2022-11-21 07:37:37
But the question is, how much memory will it take to Decode the 32k x 32k? In the case of such files, symmetric tile decoding is needed, with sequential write separately in png, like blocks
afed
2022-11-21 07:40:22
https://github.com/jcupitt/vipsdisp
DZgas ะ–
afed https://github.com/jcupitt/vipsdisp
2022-11-21 07:46:25
no builds no windows<:Thonk:805904896879493180> software whose author does not want others to use it
_wb_
DZgas ะ– But the question is, how much memory will it take to Decode the 32k x 32k? In the case of such files, symmetric tile decoding is needed, with sequential write separately in png, like blocks
2022-11-21 07:52:26
Decoding should be less of an issue. We don't have a cropped decode option yet, but at least it shouldn't use much more memory than the size of the decompressed image itself (and with the pixel callback not even that).
Nova Aurora
DZgas ะ– no builds no windows<:Thonk:805904896879493180> software whose author does not want others to use it
2022-12-01 10:33:15
Well, it is flatpak, and gtk is mostly designed for *nix platforms
Kleis Auke
DZgas ะ– no builds no windows<:Thonk:805904896879493180> software whose author does not want others to use it
2022-12-02 09:17:28
I'll have a look into integrating this in <https://github.com/libvips/build-win64-mxe> in the next release cycle of libvips (probably only for `x86_64` then, unless there is a demand to extend this to other architectures).
Siegfried
2022-12-13 06:09:32
Hi JXL developers, First, thanks for the active development of this new promising compression format and file. I have questions regarding your file format so, sorry by advance for the length of my message... Let me quickly explain how we intend to use your file format. We want to propose a compression scheme for spectral images following up the recently published lossless spectral image storing scheme using OpenEXR (https://jcgt.org/published/0010/03/01/). Your format is the perfect fit for our needs since we want to mix floating point and integers framebuffers of an arbitrary quantisation size. Like the spectral EXR format, we would like to pack all spectral data within the same JXL file. So, we plan to extensively use sub images. However, from our experiments, we came across limitations, which can be due to a misuse of the library on our end. **Regarding compression** It seems if we save a single framebuffer per file, we get better compression ratios than storing everything within the same JXL file using sub images. Also, increasing frame distance does not change a lot the file size while the quality is heavily impacted (as expected). This is related to a previous question I have asked, namely using a specific compression ratio and down sampling for each sub image. - Does the library propagate the compression ratio down to sub images? **Regarding number of sub images** Looking at the code, the format supports at max 256 framebuffers within the same file. In our case, we can exceed such a limit, with stereo images or polarised images for instance. So, we currently split the data across multiple files. - Will JXL supports more than 256 framebuffers per file in the future? (1/2)
2022-12-13 06:14:52
**RGB preview** As for the spectral EXR format, we would like to optionally offer a preview of the main image in RGB at full resolution in the main framebuffer while storing spectral information in sub images. That would allow a non-spectral aware JXL compliant software to display an RGB preview. But, doing so seems to propagate the overhead of storing an RGB image down to the sub images which are gray images in our case. - Are we doing something wrong or does the format expects all sub images be in the same format as the main image? **Frame distance parameter** While browsing the documentation, it is mentioned that a frame distance of 1 with `JxlEncoderSetFrameDistance` provides visually lossless images but when I use this parameter, I get strong artifacts. Am I doing something wrong there? Since we are currently working on the article and planning to submit it soon, we plan to use for now an evaluation of the compression achievable by storing a single framebuffer per JXL file. If JXL will support those features, we would like to mention it in the article. Thanks for your help! (2/2)
_wb_
2022-12-13 06:34:54
Some notes: - DCT can only be used for the first 3 channels. Extra channels have to use modular mode, which can do both lossless and lossy. - we need to add something to the encode api to set the quality of extra channels
Kleis Auke
Kleis Auke I think the issue is that Brotli always (except on Emscripten) builds shared and static libraries (suffixed as `-static`) and ignores CMake's `BUILD_SHARED_LIBS` option. PR <https://github.com/google/brotli/pull/655> would fix that (AFAIK, that patch is used by most distros that distribute static libraries and/or want to reduce the build time).
2022-12-18 05:04:36
FWIW, this was landed as commit <https://github.com/google/brotli/commit/641bec0e30bea648b3da1cd90fc6b44deb429f71>.
Jyrki Alakuijala
2022-12-19 08:09:41
One a bit silly possibility for multispectral is to store one channel per y-component and create a new format that contains a lot of jxl images another possibility is to use layers with special names -- for example the wave-length range -- and then just layer vardct layers of y-channels yet another possibility is to use all the XYB layers and define three different spectral ranges for them in general, VarDCT has been optimized for XYB where the consumer of the image is a human -- this leads quite usual compression characteristics for the Y channel, but somewhat unusual for X and B -- so likely it would be a good idea for science use to use the Y channel only frame distance 1 relates to how many 'lumens' you have, the brighter your image the better the quality if you look at a normalized image in the end contact me at jyrki@google.com and we may be able to solve problems for your article in a VC
_wb_
2022-12-19 10:02:35
VarDCT could be used without XYB and with the three components treated as 'just numbers' without visual assumptions โ€” this is not what libjxl currently does, but it's certainly possible to do that. One way to do it atm is by making an RGB jpeg and recompressing it.
2022-12-19 10:06:13
Multiple grayscale layers would also be an option if you want to use vardct for all the data โ€” otherwise a single layer with as many extra channels as there are bands would be the 'conceptually correct' way to do it, imo.
DZgas ะ–
2022-12-30 06:26:47
Does JXL support "block loading" of a local image? For example, I have an image with a resolution of 800x13044 (manhwa), can I upload a couple of blocks of 800x800? or part of the image from the center... is it possible to create such a reader with JXL? (not the progressive loading of the image, but the ability to make a request for a separate part of it)
_wb_
2022-12-31 04:06:47
JXL can theoretically do that, libjxl cannot atm.
DZgas ะ–
2022-12-31 09:26:02
How many layers of progressive loading can be do in theory?
Traneptora
2022-12-31 02:47:54
Just to double check, are the ICC profiles synthesized by libjxl CC0 and/or public domain? identify -verbose says this but I want explicit confirmation
_wb_
DZgas ะ– How many layers of progressive loading can be do in theory?
2022-12-31 03:33:31
There are at most 11 passes per frame, plus the DC so at most 12 refinement passes per frame.
2022-12-31 03:33:49
The number of frames/layers is unlimited
Demiurge
Traneptora Just to double check, are the ICC profiles synthesized by libjxl CC0 and/or public domain? identify -verbose says this but I want explicit confirmation
2022-12-31 04:12:54
Is a few numbers describing a mathematical transform for color quantization really something that is copyrightable?
_wb_
2022-12-31 04:15:10
Those big cmyk profiles are. Something generated from a jxl enum, no idea if that's copyrightable
Demiurge
2022-12-31 04:18:18
"That would be like if I tried to enforce copyright for this sentence that I'm typing here." - Pashifox 2022 ALL RIGHTS RESERVED DO NOT STEAL THIS SENTENCE
DZgas ะ–
2023-01-08 11:20:37
Why does Jpeg XL use brotli and not zstd (used only for Metadata compress||?||)
_wb_
2023-01-08 11:48:23
Probably mostly because there's overlap between brotli devs and jxl devs. We could define brob boxes with other compression methods, say zstd or gzip, but more methods means metadata software has to support more stuff too... I think brotli should be fine โ€” the main thing is to have a compressed option besides plaintext/uncompressed...
yurume
_wb_ Probably mostly because there's overlap between brotli devs and jxl devs. We could define brob boxes with other compression methods, say zstd or gzip, but more methods means metadata software has to support more stuff too... I think brotli should be fine โ€” the main thing is to have a compressed option besides plaintext/uncompressed...
2023-01-08 02:46:12
one practical consequence from using Brotli however is, that the minimal JPEG XL decoder should be at least ~100 KB large, because of Brotli's built-in dictionary.
Fraetor
2023-01-08 02:49:36
How much is that compared to the compiled size of the rest of the code? What is a j40 binary these days?
yurume
Fraetor How much is that compared to the compiled size of the rest of the code? What is a j40 binary these days?
2023-01-08 02:50:46
122 KB uncompressed, 50 KB compressed with Brotli without a dictionary (cf. https://github.com/google/brotli/blob/master/c/common/dictionary.bin.br)
afed
2023-01-08 03:06:13
browsers already have brotli because it's a web standard, so it's less binary code, brotli also has better compression, zstd is faster, but metadata is usually not some gigantic data when this difference matters, so it would be very strange to choose zstd
veluca
yurume one practical consequence from using Brotli however is, that the minimal JPEG XL decoder should be at least ~100 KB large, because of Brotli's built-in dictionary.
2023-01-08 03:49:51
only if you want exif and similar things, if you just want to decode to pixels, no brotli is required
_wb_
2023-01-08 04:42:43
Brotli is not needed to display images, that was a design constraint (originally we used brotli for icc compression too and we changed that explicitly to avoid needing brotli to display images).
vertexgamer
2023-01-19 06:25:40
jxl 0.8.0 effort 1-9 distance 0.0 brotli_effort 11 using adfc39b windows x64 static e1 4,58 MB e2 4,71 e3 5,52 e4 4,09 e5 5,03 e6 5,04 e7 5,02 e8 5,02 e9 5,01 https://easyupload.io/507reg
Demiurge
2023-01-19 06:27:12
Huh? e1 is second best and e4 is best?
vertexgamer
2023-01-19 06:46:25
compared to the previous jxl 0.7 build e1 5.04 e2 4.71 e3 5.52 e4 4.09 e5 5.03 e6 5.04 e7 5.02 e8 5.02 e9 5.01
Demiurge
2023-01-19 06:46:51
It's true! That's surprising. I knew the lower effort settings are good for photo content but I didn't think the higher effort settings would be worse...
afed
2023-01-19 06:53:00
without black bars ```Encoding kPixels Bytes BPP ------------------------------------------- jxl:d0:1 1533 1518306 7.9202191 jxl:d0:2 1533 1295790 6.7594679 jxl:d0:3 1533 1282971 6.6925978 jxl:d0:4 1533 1138388 5.9383829 jxl:d0:5 1533 1133039 5.9104799 jxl:d0:6 1533 1131081 5.9002660 jxl:d0:7 1533 1110128 5.7909650 jxl:d0:8 1533 1093744 5.7054982 jxl:d0:9 1533 1087268 5.6717162```
username
Demiurge It's true! That's surprising. I knew the lower effort settings are good for photo content but I didn't think the higher effort settings would be worse...
2023-01-19 06:56:09
I think I know why the higher effort settings can make files larger as I have experienced it happening in the past and it's because the lower effort settings can discard more image quality leading to the lower efforts taking up less space but looking way worse
afed
2023-01-19 06:58:10
but not for lossless
Demiurge
username I think I know why the higher effort settings can make files larger as I have experienced it happening in the past and it's because the lower effort settings can discard more image quality leading to the lower efforts taking up less space but looking way worse
2023-01-19 06:59:24
Yeah, in this case we're just looking at lossless mode. Something about the black bars is making libjxl confused.
username
2023-01-19 07:01:35
oh this is happening with in lossless mode?
Demiurge
afed without black bars ```Encoding kPixels Bytes BPP ------------------------------------------- jxl:d0:1 1533 1518306 7.9202191 jxl:d0:2 1533 1295790 6.7594679 jxl:d0:3 1533 1282971 6.6925978 jxl:d0:4 1533 1138388 5.9383829 jxl:d0:5 1533 1133039 5.9104799 jxl:d0:6 1533 1131081 5.9002660 jxl:d0:7 1533 1110128 5.7909650 jxl:d0:8 1533 1093744 5.7054982 jxl:d0:9 1533 1087268 5.6717162```
2023-01-19 07:06:43
can you post the image without black bars you're using to test?
afed
2023-01-19 07:11:38
not accurate cropping, just for the test looks like the black bars are breaking some heuristics
Demiurge
2023-01-19 07:18:10
Why is the cropped version several times smaller than the version with black bars?? Why does it cost several megabytes just to store a zero-entropy field of black?
_wb_
2023-01-19 07:25:17
because the original is 16-bit and the cropped one is 8-bit
2023-01-19 07:27:39
e4 being better than e5+ is surprising, it likely means we have room for improvement in some heuristics or even an encoder bug somewhere
2023-01-19 07:28:23
e1/e2 being better than e3 on this image is also somewhat surprising