|
jonnyawsom3
|
2024-03-27 07:13:51
|
It now multithreads properly proportional to the image size and threads available
|
|
2024-03-27 07:14:14
|
So small images are roughly the same, but the larger the image the bigger the gains
|
|
2024-03-28 03:23:59
|
Currently 3am so I'll make an issue tomorrow, but so I don't forget...
It seems using ISO noise in lossless causes it to have a green tint compared to lossy. Maybe trying to use an XYB color when the image stays RGB for lossless?
|
|
|
Demiurge
|
|
spider-mario
that’s not what https://cloudinary.com/blog/jpeg-xl-and-the-pareto-front#the_pareto_front found
|
|
2024-03-28 03:59:26
|
<@794205442175402004> the "very low quality" JPEG1 image looks much better than the avif or jpegxl images at the same ssim2 score
|
|
2024-03-28 03:59:44
|
It has a lot more fine details.
|
|
2024-03-28 04:00:28
|
And just looks much better. ssim2 seems to prefer a blurry fuzzy downsampled-looking image to a noisy or blocky image?
|
|
2024-03-28 04:01:39
|
Noise does not look bad to the human eye. Maybe ssim2 unfairly penalizes noise too much compared to the human psychovisual system
|
|
2024-03-28 04:02:34
|
Plus the best thing about high frequency noise is that it disappears if you downscale the image. Or even just step further back.
|
|
2024-03-28 04:03:21
|
Noise only looks bad or noticeable if it's low-frequency.
|
|
|
jonnyawsom3
|
2024-03-28 04:10:34
|
Speaking of noise, I was complaining to a friend about artists adding fake ISO noise to 8K images, then they reminded me JXL does actually have a noise 'encoder' along with the ISO noise setting. I had it set to lossless, gave it a shot, and I got a 0.057 out of 11 bpp reduction... Not quite what I was hoping for, although maybe low distance lossy would work much better
|
|
|
Demiurge
|
2024-03-28 04:13:02
|
I didn't think it would be functional in lossless mode.
|
|
2024-03-28 04:14:49
|
I assume it's more useful when you have a noise removal prefilter and the ISO noise added as a postfilter. Preferably it ought to be automatic too.
|
|
|
_wb_
|
|
Demiurge
<@794205442175402004> the "very low quality" JPEG1 image looks much better than the avif or jpegxl images at the same ssim2 score
|
|
2024-03-28 07:45:17
|
Mean Opinion Scores are the Mean Opinion of many people. Some people prefer blockiness over blur, others prefer blur over blockiness. I agree that the 0.4 bpp JPEG has more detail than the 0.1 bpp jxl/avif, and if I had to choose one of them, from an "information preservation" point of view I'd pick the JPEG.
But if I had to choose one to put on a website, I'd take one of the blurry ones. If you cannot compare to the original, it just looks out of focus, and people don't know if that's an artifact or an artistic intention. The JPEG however has quite obvious chromatic blocking and also without access to the original, it is immediately clear that there are compression artifacts on this image.
So if I had to summarize it in a single score, I would say those three "very low quality" images have an equivalent quality, but the artifacts are very different so if you ask different people it is likely they will have different opinions on which is best.
|
|
2024-03-28 07:49:32
|
The subjective data I used to tune ssimu2 was from various other datasets besides CID22 (where we didn't go to such low qualities, we started at libjpeg q30), most of them doing side-by-side comparisons and not fliptests. When you do side-by-side, it's more like a no-reference quality assessment, i.e. blockiness and other "obvious artifacts" will be more problematic than smoothing.
|
|
|
spider-mario
|
|
Speaking of noise, I was complaining to a friend about artists adding fake ISO noise to 8K images, then they reminded me JXL does actually have a noise 'encoder' along with the ISO noise setting. I had it set to lossless, gave it a shot, and I got a 0.057 out of 11 bpp reduction... Not quite what I was hoping for, although maybe low distance lossy would work much better
|
|
2024-03-28 08:56:41
|
from what I recall, it doesn’t try to do anything to remove the noise, it just works under the assumption that lossy compression will have obliterated it anyway
|
|
2024-03-28 08:57:14
|
in that sense, it doesn’t do anything special compared to photon noise (except that the noise curve can have a different shape)
|
|
|
_wb_
|
|
spider-mario
from what I recall, it doesn’t try to do anything to remove the noise, it just works under the assumption that lossy compression will have obliterated it anyway
|
|
2024-03-28 09:09:54
|
That's a reasonable assumption at the lower qualities, but at the more usable qualities, I'd expect lossy compression to preserve at least some of the noise, especially in otherwise smooth regions where the noise is basically the only HF signal to encode (and visual models will likely encourage the encoder to not quantize it away, if it has any bits to spare)...
|
|
|
spider-mario
|
2024-03-28 09:10:32
|
definitely
|
|
2024-03-28 09:10:59
|
we could consider adding an explicit denoising option or something like that, but we’d have to consider whether it’s worth the effort
|
|
|
_wb_
|
2024-03-28 09:13:09
|
I think there would be a potential benefit if we would do something like this:
- estimate noise level in the image, if there's no or not enough noise, skip the next steps
- automatically set photon noise level to the estimated noise level
- apply the EPF at a strength setting (number of iterations / sigma) proportional to the estimated noise level before encoding the image
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-28 09:14:17
|
Hi!
Trying to figure out libjxl and looking into cjxl. And not sure is this a bug or 32bit float is not supported?
both half and full float OpenEXR files encoded into half float jxl file with identical size.
Also are there true losless for uint images or it always "near lossless" ?
Half float looks like a true lossless.
|
|
|
_wb_
|
2024-03-28 09:14:39
|
we can just reuse the decoder EPF as an encoder preprocessing step, it should be pretty good as a general-purpose denoiser
|
|
|
Vlad (Kuzmin) Erium
Hi!
Trying to figure out libjxl and looking into cjxl. And not sure is this a bug or 32bit float is not supported?
both half and full float OpenEXR files encoded into half float jxl file with identical size.
Also are there true losless for uint images or it always "near lossless" ?
Half float looks like a true lossless.
|
|
2024-03-28 09:15:50
|
This could be a cjxl bug in how it reads exr files. Try converting the exr to pfm first and encoding that.
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-28 09:17:51
|
ah, looks like i missed PFM. Thanx. I thought that might be openexr decoder issue.
|
|
|
spider-mario
|
|
_wb_
I think there would be a potential benefit if we would do something like this:
- estimate noise level in the image, if there's no or not enough noise, skip the next steps
- automatically set photon noise level to the estimated noise level
- apply the EPF at a strength setting (number of iterations / sigma) proportional to the estimated noise level before encoding the image
|
|
2024-03-28 09:21:13
|
the thing is, if I had to estimate the noise level, I would probably attempt to denoise and look at how much noise it removed
|
|
2024-03-28 09:21:19
|
are there cheaper ways to do that?
|
|
2024-03-28 09:23:07
|
I have code that takes an original image and a denoised image, and outputs an estimated photon noise level based on that, but in libjxl, I think I might have miscalibrated the photon noise option (-> it generates more noise than it should)
|
|
2024-03-28 09:23:32
|
so the estimated noise level is off for cjxl
|
|
2024-03-28 09:23:46
|
(it should be fine for the libaom implementation)
|
|
2024-03-28 09:24:00
|
I’ve been meaning to recalibrate cjxl for a while but haven’t gotten around to it
|
|
2024-03-28 09:24:55
|
(that is, https://github.com/libjxl/libjxl/blob/f78c90b9992f2c9adcb2da80b1a012e21e55c3c9/lib/jxl/enc_photon_noise.cc#L87 might be too high)
|
|
2024-03-28 09:27:22
|
it’s encoder-only, so even if we change this, an image that was previously encoded with what looked like the desired amount of noise will still be decoded with that same amount
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-28 09:27:52
|
some simple wavelet denoiser similar to libraw maybe?
|
|
|
spider-mario
|
2024-03-28 09:28:05
|
_but_ someone who is used to “`--photon_noise_iso=3200` gives me the amount of noise I want” would have to search for their new preferred level for future encodes
|
|
|
fab
|
2024-03-28 09:37:12
|
|
|
2024-03-28 09:37:26
|
How is that graph
|
|
2024-03-28 09:40:03
|
|
|
2024-03-28 09:40:09
|
Second graph
|
|
2024-03-28 09:41:46
|
Probably a disaster
|
|
2024-03-28 09:43:19
|
|
|
2024-03-28 09:43:25
|
Now is better 0,31bpp
|
|
2024-03-28 09:43:33
|
Still too noisy for my taste
|
|
2024-03-28 09:43:45
|
But i have a bit problemzz
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-28 09:44:16
|
is this a library issue? 😉
|
|
2024-03-28 09:49:22
|
ohh. So it looks like cxjl/djxl are just full of bugs.
The idea to incorporate support for multiple file formats import/export gives a wrong idea about JPEG XL.
looks like only PFM/PNM/PGM <> jxl is works correctly. all other have issues on encoding or decoding.
|
|
|
Demiurge
|
|
_wb_
Mean Opinion Scores are the Mean Opinion of many people. Some people prefer blockiness over blur, others prefer blur over blockiness. I agree that the 0.4 bpp JPEG has more detail than the 0.1 bpp jxl/avif, and if I had to choose one of them, from an "information preservation" point of view I'd pick the JPEG.
But if I had to choose one to put on a website, I'd take one of the blurry ones. If you cannot compare to the original, it just looks out of focus, and people don't know if that's an artifact or an artistic intention. The JPEG however has quite obvious chromatic blocking and also without access to the original, it is immediately clear that there are compression artifacts on this image.
So if I had to summarize it in a single score, I would say those three "very low quality" images have an equivalent quality, but the artifacts are very different so if you ask different people it is likely they will have different opinions on which is best.
|
|
2024-03-28 09:49:26
|
I am worried that these metrics might illustrate a tendency for ssim2 to unfairly punish high frequency noise?
|
|
|
fab
|
|
Demiurge
I am worried that these metrics might illustrate a tendency for ssim2 to unfairly punish high frequency noise?
|
|
2024-03-28 09:54:59
|
|
|
|
Demiurge
|
|
spider-mario
we could consider adding an explicit denoising option or something like that, but we’d have to consider whether it’s worth the effort
|
|
2024-03-28 09:55:18
|
It might be a good idea to have either an optional flag to enable noise detection, or to have automatic noise detection and estimation at the default effort level. Filtering out high frequency noise before encoding, and adding it back after decoding, can save a lot of bandwidth by not wasting bits on encoding noise.
|
|
|
fab
|
2024-03-28 09:55:24
|
Wb is too optimistic
|
|
|
spider-mario
|
|
Vlad (Kuzmin) Erium
ohh. So it looks like cxjl/djxl are just full of bugs.
The idea to incorporate support for multiple file formats import/export gives a wrong idea about JPEG XL.
looks like only PFM/PNM/PGM <> jxl is works correctly. all other have issues on encoding or decoding.
|
|
2024-03-28 09:56:13
|
sorry, which encoding/decoding issues are you referring to?
|
|
|
fab
|
|
Demiurge
It might be a good idea to have either an optional flag to enable noise detection, or to have automatic noise detection and estimation at the default effort level. Filtering out high frequency noise before encoding, and adding it back after decoding, can save a lot of bandwidth by not wasting bits on encoding noise.
|
|
2024-03-28 09:56:28
|
|
|
2024-03-28 09:58:56
|
JPEG XL is superior
|
|
|
Vlad (Kuzmin) Erium
|
|
spider-mario
sorry, which encoding/decoding issues are you referring to?
|
|
2024-03-28 10:09:55
|
OpenEXR 32bit convert to 16bit. Color space tagging.
UINT16 PNG <> jxl <> PNG looks like do something with roundings in lossless.
etc.
|
|
2024-03-28 10:11:16
|
some small issues that only visible when you try to compare pixel by pixel
|
|
|
spider-mario
|
2024-03-28 10:11:43
|
is there an issue open for those?
|
|
2024-03-28 10:12:20
|
the 32-bit exr will probably be somewhat involved to fix since half floats is all that the API we are using exposes, but colorspace tagging should work in both directions
|
|
2024-03-28 10:13:10
|
(https://github.com/libjxl/libjxl/blob/f78c90b9992f2c9adcb2da80b1a012e21e55c3c9/lib/extras/enc/exr.cc#L105-L116, https://github.com/libjxl/libjxl/blob/f78c90b9992f2c9adcb2da80b1a012e21e55c3c9/lib/extras/dec/exr.cc#L176-L188)
|
|
|
Demiurge
|
|
_wb_
This could be a cjxl bug in how it reads exr files. Try converting the exr to pfm first and encoding that.
|
|
2024-03-28 10:13:43
|
I think Vlad is referring to this
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-28 10:13:58
|
when i import original exr and converted from jxl EXR in Photoshop (exr-io) and Afinity i found that colors are tagged incorrectly. I used ProphotoRGB (RIMM/ROMM RGB)
|
|
|
Demiurge
|
2024-03-28 10:14:49
|
Vlad, have you tried using vips? vips seems to be a pretty good interface or frontend to libjxl as well as multiple other image processing and codec tools
|
|
|
spider-mario
|
2024-03-28 10:15:23
|
oh, wait, I wonder if it might have to do with this https://github.com/libjxl/libjxl/commit/197ee929232b0a63138996095b16bb8525f3de84
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-28 10:15:25
|
actually i just need to check all libjxl properties without digging too deep into it code as soon as plan to work on OpenImageIO JpegXL plugin.
|
|
|
spider-mario
|
2024-03-28 10:15:33
|
maybe something similar is going on in `djxl`
|
|
|
Demiurge
|
2024-03-28 10:15:47
|
maybe running something like `vips jxlsave` on the command line can do what you want
|
|
2024-03-28 10:16:14
|
I love vips
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-28 10:16:31
|
i'm from VFX/3D scanning camp 😄
|
|
|
Demiurge
|
2024-03-28 10:16:52
|
Not sure how good it is at converting between metadata formats or transposing between colorspaces
|
|
|
_wb_
|
|
spider-mario
are there cheaper ways to do that?
|
|
2024-03-28 10:22:17
|
I would try something like doing an 8x8 DCT, ignoring the first few or even half of the LF coeffs, taking the sum of the HF coeffs, and taking the minimum (or some kind of soft-min) of those sums over the entire image. In a noise-free image, you would expect to get zero (since there should be at least some blocks that are solid or a perfectly smooth gradient), while if there's noise, there will always be some HF signal.
|
|
|
Demiurge
|
2024-03-28 10:38:34
|
That makes logical sense to me.
|
|
2024-03-28 10:39:49
|
Not very elegant but probably good enough
|
|
|
spider-mario
|
2024-03-28 11:01:55
|
we might expect solid black or solid white even in noisy images, so perhaps some _ad hoc_ rule for that in addition
|
|
|
fab
|
|
spider-mario
we might expect solid black or solid white even in noisy images, so perhaps some _ad hoc_ rule for that in addition
|
|
2024-03-28 11:07:29
|
Fixed
|
|
2024-03-28 11:08:36
|
In my opinion you should add a even lower quality to the graph
|
|
2024-03-28 11:12:20
|
I tune even lower but a loweer quality needs To be put off
|
|
2024-03-28 11:12:45
|
|
|
|
jonnyawsom3
|
|
spider-mario
from what I recall, it doesn’t try to do anything to remove the noise, it just works under the assumption that lossy compression will have obliterated it anyway
|
|
2024-03-28 01:15:02
|
I assumed it would lower the bpp on lossless by making the predictions closer to the input.
But I suppose if it's just the same as ISO noise, then it wouldn't be aware the noise synthesis is enabled at all, still trying to preserve the noise rather than just letting the predictions 'carry on' since they'll be covered up anyway (similar to the proposed splines)
|
|
2024-03-28 01:24:34
|
Naturally it was also pretty slow and memory hungry, but I doubt the noise estimation could be run per block and a mean found at the end
|
|
|
Vlad (Kuzmin) Erium
actually i just need to check all libjxl properties without digging too deep into it code as soon as plan to work on OpenImageIO JpegXL plugin.
|
|
2024-03-28 01:26:53
|
This? https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4055
|
|
|
Vlad (Kuzmin) Erium
|
|
This? https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4055
|
|
2024-03-28 01:28:19
|
Yep. But that draft not my. It pretty basic and just don’t properly handle jpeg xl
|
|
2024-03-28 01:29:42
|
Just was not sure about what libjxl is support. Libheif for example support only 12bit and near zero chance they add higher bit depth.
|
|
2024-03-28 01:31:33
|
Libjxl looks much better on start with supporting much more. And maybe can be an interesting alternative to OpenEXR DWAA/DWAB
|
|
|
Demiurge
|
2024-03-28 11:34:11
|
Would be nice if an update to jpegxl could support raw sensor data
|
|
|
jonnyawsom3
|
2024-03-28 11:45:39
|
It was considered, since there is a planned way to encode RAW bayer patterns, but nothing is set in stone yet and Adobe already decided one way to do it
|
|
|
Demiurge
|
2024-03-28 11:48:40
|
What's adobe's way? Is there a link?
|
|
2024-03-28 11:49:09
|
bayer encoding is a cool topic
|
|
|
jonnyawsom3
|
2024-03-28 11:53:16
|
Well, I'm not entirely sure how they do it, but I know I can extract raw JXL tiles form it that decode normally
https://helpx.adobe.com/content/dam/help/en/photoshop/pdf/DNG_Spec_1_7_1_0.pdf
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:03:15
|
That can be done in a several ways. From pixel shift that make Bayer pattern become a lines. To rearranging RGGB planes into the same channel. Or encoding RGGB as a separate channels
|
|
2024-03-29 01:04:21
|
Btw, are there any GPU implementation for jpeg xl are exist?
|
|
|
Demiurge
|
|
Vlad (Kuzmin) Erium
Btw, are there any GPU implementation for jpeg xl are exist?
|
|
2024-03-29 01:27:45
|
GPU image decoding is a false promise that fools many
|
|
2024-03-29 01:28:30
|
For a programmer, it's not practical to use
|
|
2024-03-29 01:28:35
|
Even on phones
|
|
|
HCrikki
|
2024-03-29 01:29:09
|
jxl is fast in cpu decoding and scales well. its avif that literally requires maximum hw accelerations just to not generate and decode way too slow
|
|
|
Quackdoc
|
2024-03-29 01:29:15
|
I think by gpu they mean asic?
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:30:18
|
Oh. Do you want discuss about managing multiply highres high speed Machine vision cameras for 4D capture without using GPU encoder?
|
|
2024-03-29 01:31:23
|
well technically i can hold up to 2 minutes of capture in ram (servers have 2TB ram) but nvjpeg make it possible transcode in realtime (8x cams per server on two A4000)
|
|
2024-03-29 01:31:50
|
i wish nvjpeg2000 would be such fast, but it 20x times slower
|
|
|
Demiurge
|
2024-03-29 01:31:55
|
Specifically, what I mean is, hardware decoders usually can only decode one frame at a time, serially.
|
|
2024-03-29 01:32:33
|
If you are browsing a webpage or gallery, you need to be able to decode multiple different images in parallel
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:33:11
|
if measure everything in web browsings we are doomed 😉
|
|
|
Demiurge
|
2024-03-29 01:33:38
|
Most image gallery apps store thumbnails that are decoded on the CPU in parallel
|
|
|
Quackdoc
|
2024-03-29 01:34:22
|
ehh... it doesn't really matter since queues exist, asics are fast enough.
|
|
2024-03-29 01:34:33
|
the issue is when you have really unoptimized pipelines
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:35:08
|
it still plenty of use cases where GPU encoder/decoders are preferred.
|
|
|
Demiurge
|
|
Vlad (Kuzmin) Erium
it still plenty of use cases where GPU encoder/decoders are preferred.
|
|
2024-03-29 01:35:42
|
Agreed
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:35:43
|
for example CinemaDNG Encoder from fastmedia
|
|
2024-03-29 01:35:59
|
when you have thousands camera raws you need to process
|
|
2024-03-29 01:36:19
|
30-60fps for Sony A7RIV raws
|
|
|
Quackdoc
|
2024-03-29 01:37:19
|
at least jxl has pretty fast decoding :D especially with the faster decoding flag
|
|
2024-03-29 01:37:38
|
i pretty much enable it for all of my encodes
|
|
|
Demiurge
|
2024-03-29 01:37:40
|
It depends on the use case. There are some use cases where it makes sense practically, and some use cases where it doesn't but people think it does.
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:38:30
|
Yes, i love how fast jpegxl on decoding. jpeg2000 extremely slow
|
|
|
Demiurge
|
2024-03-29 01:38:54
|
JPEGXL was designed to be efficient on the CPU. Hardware encoders are in the works I hear
|
|
|
Vlad (Kuzmin) Erium
Yes, i love how fast jpegxl on decoding. jpeg2000 extremely slow
|
|
2024-03-29 01:39:53
|
There is a new version of jpeg2000 that is much faster since it uses a different entropy coder I think. Called HTJ2K
|
|
2024-03-29 01:39:59
|
High throughput
|
|
2024-03-29 01:40:44
|
But jpegxl should still give good performance and better compression density
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:40:47
|
adobtion of jpeg2000 even for part1 and 2 is so low 😦
|
|
|
Demiurge
|
2024-03-29 01:41:40
|
Honestly it's amazing that a modern format like jpegxl is faster than baseline jpeg2k
|
|
2024-03-29 01:41:56
|
Especially when the trend of all other formats is to get slower and slower like avif
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:42:35
|
what the slowest part of jp2 huffman encoding or wavelets?
|
|
|
_wb_
|
2024-03-29 06:30:50
|
Normal jp2 does some kind of bitplane per bitplane binary arithmetic coding with branchy conditionals, iirc. This is quite slow. High-throughput j2k (HTJ2K) changes the entropy coding to be faster.
|
|
|
Demiurge
|
2024-03-29 07:25:31
|
Yeah, so, it's not the wavelets.
|
|
2024-03-29 07:26:21
|
Is HTJ2K any worse density than normal J2K?
|
|
2024-03-29 07:26:37
|
And since only the entropy coder is different, doesn't that mean they can be losslessly transcoded?
|
|
|
fab
|
2024-03-29 07:29:44
|
I achieved Transparency with JPEG XL at 0,143bpp
|
|
|
_wb_
|
2024-03-29 09:28:49
|
Yes, HTJ2K is a bit worse density than normal J2K, and yes, in principle it can be losslessly converted between the two (though I don't know if there's tooling available for that)
|
|
|
fab
|
2024-03-29 09:30:41
|
|
|
2024-03-29 09:33:33
|
Jxl is destroying av01
|
|
|
Demiurge
|
2024-03-29 01:17:56
|
I think it's pretty cool that JXL is able to losslessly compress both integer and float image data
|
|
2024-03-29 01:25:02
|
Underrated feaure. Underrated format.
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-29 01:30:24
|
Need to add to OpenEXR for better adoption in VFX industry
|
|
2024-03-29 01:31:01
|
They use awful DWAA/DWAB instead
|
|
|
Quackdoc
|
2024-03-29 02:01:47
|
I normally use PXR for photographs and just use RLE or PIZ for everything else
|
|
|
jonnyawsom3
|
|
Vlad (Kuzmin) Erium
Need to add to OpenEXR for better adoption in VFX industry
|
|
2024-03-29 02:37:14
|
Last night I was thinking the EXR code in Blender could be used for layered JXL, but just making it a compression type like in DNG could work
|
|
|
damian101
|
|
Vlad (Kuzmin) Erium
They use awful DWAA/DWAB instead
|
|
2024-03-30 08:27:44
|
Looks like it's a better lossy format than JPEG, pretty similar though, but probably with encoders that are much less well tuned.
|
|
2024-03-30 08:27:53
|
High bit depth is of course very cool.
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-30 09:16:41
|
Looks not so good for extreme post processing. Like fine tuned masks based on color channels or some ranges. Even for quite good compression 0~4
|
|
|
damian101
|
2024-03-30 10:09:32
|
certainly
|
|
2024-03-30 10:13:29
|
JPEG is not a very good format for near-lossless, highest possible quality is often not perceptually lossless
|
|
|
Demiurge
|
2024-03-30 05:03:09
|
I think effort=5 would make a better default for libjxl. It seems to be the best trade between density and speed.
|
|
2024-03-30 05:04:18
|
effort=5 in v0.10 seems to be very close to the maximum density.
|
|
2024-03-30 05:04:40
|
Before mpx/s jumps off a cliff
|
|
2024-03-30 05:05:40
|
I heard there was already plans to make 5 the default?
|
|
2024-03-30 05:07:33
|
Although I can see how e7 is a good choice too.
|
|
|
|
afed
|
2024-03-30 05:10:53
|
e6, not e5, because for lossy e6 is almost the same as e7, and for lossless it's not much worse, but the speed gain is noticeable, so perhaps it's more balanced
|
|
|
damian101
|
2024-03-30 05:19:34
|
encoding speed is generally not much of an issue for image encoding
|
|
|
Vlad (Kuzmin) Erium
|
2024-03-30 05:26:29
|
for who is not issue?
|
|
|
yoochan
|
2024-03-30 07:10:16
|
For me 😁 but I understand that other people may have other needs
|
|
|
jonnyawsom3
|
2024-03-30 07:50:37
|
I keep wondering, with all the benchmarks and comparisons we've run, surely we know the best speed/compression ratio across a wide range of images?
|
|
|
fab
|
2024-03-30 08:17:41
|
E 8 q 76.1
|
|
2024-03-30 08:18:06
|
E 5 q 43,4
|
|
2024-03-30 08:18:21
|
But I don't have the ffmpeg build or stand alone
|
|
2024-03-30 08:19:01
|
|
|
2024-03-30 08:19:02
|
That's svt av1 psy
|
|
|
Demiurge
|
|
encoding speed is generally not much of an issue for image encoding
|
|
2024-03-31 02:32:02
|
No but people trying it for the first time are going to be impressed with how fast it is, as long as the speed doesn't effect density that much
|
|
|
fab
|
2024-03-31 07:07:18
|
<@794205442175402004> I'll stop training JXL, I don't know the differenze on specs to AV01
|
|
2024-03-31 07:13:58
|
|
|
|
Demiurge
No but people trying it for the first time are going to be impressed with how fast it is, as long as the speed doesn't effect density that much
|
|
2024-03-31 07:27:39
|
|
|
2024-03-31 07:27:39
|
E4 q10
|
|
2024-03-31 07:27:47
|
E4 q10
|
|
2024-03-31 07:38:56
|
|
|
2024-03-31 07:39:24
|
E9 q14
|
|
2024-03-31 07:39:45
|
E6 q10
|
|
2024-03-31 07:39:47
|
|
|
|
damian101
|
|
Demiurge
No but people trying it for the first time are going to be impressed with how fast it is, as long as the speed doesn't effect density that much
|
|
2024-03-31 07:56:24
|
Microsoft encouraged its developers to hide plenty of easter eggs like mini games in their Office software, to bloat its filesize, as people associate larger files with better software.
|
|
|
fab
|
2024-03-31 08:34:13
|
|
|
2024-03-31 08:34:26
|
<@1028567873007927297>
|
|
2024-03-31 08:34:50
|
How is compared to libjxl 0.7.0
|
|
2024-03-31 09:04:38
|
Q46 E9
|
|
|
Demiurge
|
2024-03-31 09:42:09
|
fax, I don't understand what you're asking... Why are you highlighting me? :P
|
|
|
fab
|
2024-03-31 10:59:34
|
|
|
2024-03-31 10:59:47
|
E9 Q10
|
|
2024-03-31 11:05:35
|
20c in Catania no more encoding i care about climate change
|
|
2024-03-31 11:18:06
|
Jxl e5 q14
|
|
2024-03-31 01:21:52
|
I'm objective best jxl settings is e3 q14
|
|
2024-03-31 01:22:15
|
|
|
2024-03-31 01:22:20
|
First jxl q20 second avif q56
|
|
2024-03-31 01:22:45
|
AV2F is way superior
|
|
2024-03-31 03:17:53
|
Jxl
|
|
2024-03-31 03:18:01
|
|
|
2024-03-31 05:06:10
|
|
|
2024-03-31 05:06:10
|
I need some help
|
|
2024-03-31 05:11:11
|
I bring up saturation
|
|
2024-03-31 05:11:23
|
|
|
|
Demiurge
|
2024-03-31 05:30:15
|
I think fab is an AI...
|
|
2024-03-31 05:43:19
|
Everything he seems to do and say is completely random and has barely any correlation to anything.
|
|
|
fab
|
2024-03-31 05:46:38
|
|
|
|
Demiurge
Everything he seems to do and say is completely random and has barely any correlation to anything.
|
|
2024-03-31 05:47:12
|
IQ 66-68 I'm less smarter than 99% of the poiplation
|
|
2024-03-31 05:47:56
|
I did 91 one month ago now I'm tired so I'm not ABle
|
|
2024-03-31 05:49:50
|
|
|
2024-03-31 05:50:01
|
Another set image, I do not think I'm talented
|
|
2024-03-31 05:50:08
|
This is avif
|
|
2024-03-31 05:53:21
|
|
|
2024-03-31 05:56:40
|
|
|
2024-03-31 05:56:44
|
Cheese parmesan has some problem at q16
|
|
2024-03-31 05:56:58
|
Those images seems like re encoding
|
|
|
Demiurge
|
2024-03-31 06:29:12
|
There is a saying fab
|
|
2024-03-31 06:29:47
|
Better to be silent and have people think you're a fool, than to open your mouth and thus remove any doubt
|
|
2024-03-31 06:30:16
|
I think I'm butchering the quote
|
|
2024-03-31 06:31:17
|
But basically what I'm saying is maybe you should make less noise.
|
|
2024-03-31 06:32:50
|
And try to attract less attention
|
|
2024-04-01 12:31:35
|
Btw congrats <@794205442175402004> on the excellent article and thank you to everyone who contributed to making libjxl, large and small. It's amazing news that libjxl is now the pareto front of nearly all types of compression.
|
|
2024-04-01 12:34:05
|
I am really excited to see the future of third party implementations with cleaner codebases than libjxl
|
|
|
yoochan
|
2024-04-01 08:42:09
|
What kind of sneaky attack is this 😅
|
|
2024-04-01 08:46:11
|
I know only one alternative encoder attempt. I bet it will take some time before a more efficient alternative appears
|
|
|
fab
|
2024-04-01 08:47:23
|
Is already efficient at e5 q14
|
|
|
Demiurge
|
2024-04-01 08:52:11
|
Encoder or decoder
|
|
2024-04-01 08:52:41
|
The rust decoder is probably going to get adopted into browsers some day.
|
|
|
yoochan
|
2024-04-01 08:53:30
|
Encoder
|
|
2024-04-01 08:53:55
|
An attempt was made by tranoptera if I remember
|
|
|
Demiurge
|
2024-04-01 08:54:43
|
libjxl has some impressive accomplishments but it also has a lot of fat to cut. And it still calls abort(). Which completely excludes it from possibility being used in many projects from the start
|
|
|
yoochan
|
2024-04-01 08:55:27
|
This last point is marked as to be corrected for 1.0
|
|
|
Demiurge
|
2024-04-01 08:58:07
|
Very simple things like that are holding back its potential... If I didn't have so many people breathing down my neck I would be more involved in OSS and make some pull requests... Maybe I should get involved anyways.
|
|
2024-04-01 08:58:42
|
I think it would be a trivial patch to begin with
|
|
2024-04-01 08:58:59
|
It's low hanging fruit with a big impact
|
|
2024-04-01 09:02:51
|
It's just adding an #ifdef
|
|
2024-04-01 09:02:57
|
To like 2 functions
|
|
|
yoochan
|
2024-04-01 09:03:34
|
If it was so easy it would have been made already. I fear it requires a big overhaul of error handling
|
|
|
Demiurge
|
2024-04-01 09:04:26
|
I looked at the relevant file a month or so ago and maybe I am blind but it looked trivial
|
|
2024-04-01 09:05:16
|
I'll try to pull it up now. Honestly no idea why it's like that if it's seemingly so trivial
|
|
|
yoochan
|
2024-04-01 09:05:31
|
I'm not skilled enough to tell 😅
|
|
|
Demiurge
|
2024-04-01 09:06:00
|
Even something as simple as a macro that redefines the routine to a noop would be better than what it currently is
|
|
2024-04-01 09:08:17
|
Because aborting the caller completely denies the opportunity for developers that use the library to gracefully handle errors or malfunctions or unexpected behavior. It's basically hostile and malicious sabotage of the calling application and people attempting to use libjxl
|
|
2024-04-01 09:09:46
|
Not checking return status for malloc is also a similar issue but more subtle and less blatantly hostile
|
|
2024-04-01 09:14:19
|
I don't know how many different ways there are in C++ to dynamically allocate memory or how the incomprehensibly comprehensive C++ API expects the developer to check for memory allocation failure, but in C it's relatively straightforward.
|
|
2024-04-01 09:18:10
|
Sadly there's hardly any discussion on the issue tracker about this from libjxl API users like ffmpeg/vips/magick developers
|
|
|
lonjil
|
|
yoochan
An attempt was made by tranoptera if I remember
|
|
2024-04-01 09:23:16
|
https://github.com/Traneptora/hydrium/
|
|
|
Demiurge
|
2024-04-01 09:27:18
|
It's funny how some people are gifted math geniuses really good at doing the hard work that no one else is able to do or comprehend... but the really basic simple stuff like checking for failure conditions and returning JXL_DEC_ERROR if anything goes wrong, is difficult and elusive instead lol
|
|
|
fab
|
2024-04-01 09:31:05
|
|
|
2024-04-01 09:31:24
|
I don't copy hydrium i do e7 with my math
|
|
2024-04-01 09:31:43
|
Don't judge me by my IQ today is the easter
|
|
2024-04-01 09:32:35
|
I think in 6pm someone would give some updated workings
|
|
|
spider-mario
|
|
Demiurge
I don't know how many different ways there are in C++ to dynamically allocate memory or how the incomprehensibly comprehensive C++ API expects the developer to check for memory allocation failure, but in C it's relatively straightforward.
|
|
2024-04-01 09:32:43
|
the default way (`new`) throws `std::bad_alloc`
|
|
2024-04-01 09:33:02
|
https://en.cppreference.com/w/cpp/memory/new/bad_alloc
|
|
|
lonjil
|
2024-04-01 09:33:32
|
C programmers never check for malloc errors, they just assume allocation always succeeds 😄
|
|
|
spider-mario
|
2024-04-01 09:33:46
|
which, on systems with overcommit, will be true
|
|
|
Demiurge
|
|
lonjil
C programmers never check for malloc errors, they just assume allocation always succeeds 😄
|
|
2024-04-01 09:35:48
|
Bad ones.
|
|
|
spider-mario
|
2024-04-01 09:35:49
|
(there’s also `new(std::nothrow)` which returns null instead of throwing https://en.cppreference.com/w/cpp/memory/new/nothrow)
|
|
|
Demiurge
|
|
lonjil
C programmers never check for malloc errors, they just assume allocation always succeeds 😄
|
|
2024-04-01 09:36:26
|
Maybe that's standard policy for developers that work for Red Hat
|
|
|
lonjil
|
|
Demiurge
|
2024-04-01 09:37:13
|
But that is considered misuse of the C standard library API
|
|
2024-04-01 09:37:25
|
To not check for failed malloc
|
|
2024-04-01 09:37:42
|
The API clearly says it can fail
|
|
2024-04-01 09:38:01
|
And gives the developer the opportunity to handle it
|
|
|
lonjil
|
|
spider-mario
which, on systems with overcommit, will be true
|
|
2024-04-01 09:38:19
|
not entirely true. There are situations where malloc can fail on systems with overcommit, hell even when there's plenty of memory left!
|
|
|
Demiurge
|
2024-04-01 09:40:14
|
If you have the opportunity to handle something gracefully and prevent data loss then why write fragile and broken code?
|
|
2024-04-01 09:40:51
|
Even if you don't care, other developers that link to your code might care
|
|
|
fab
|
2024-04-01 09:41:13
|
E9 q12 looks how is good
|
|
2024-04-01 09:41:18
|
|
|
|
lonjil
|
2024-04-01 09:41:23
|
I don't think I've ever seen software that tries to gracefully handle out of memory situations, except maybe SQLite
|
|
2024-04-01 09:41:51
|
Libraries would usually return some kind of "ALLOC_FAIL" error, but then what do you do? Probably call abort.
|
|
|
spider-mario
|
2024-04-01 09:51:48
|
maybe display an error message like “Sorry, exporting failed due to insufficient available memory. Consider closing a few applications and trying again.”
|
|
|
w
|
2024-04-01 09:57:02
|
sound like a job for the thing that's running the program
|
|
|
Demiurge
|
2024-04-01 10:07:15
|
Most libraries return an error status and return control back to the caller
|
|
2024-04-01 10:10:36
|
And in the case of host applications they have an opportunity to ask the user if they want to try again, or try to free some memory, or just try to avoid data loss caused by a sudden crash
|
|
2024-04-01 10:12:44
|
It's theoretically possible for computers not to suck if you don't want them to
|
|
|
fab
|
2024-04-01 11:01:00
|
|
|
2024-04-01 11:01:09
|
I'm a champion but Jon refuses to load the image for me
|
|
2024-04-01 11:01:27
|
https://jon-cld.s3.amazonaws.com/test/ahall_of_fshame_SSIMULACRA_2_modelD.html
|
|
2024-04-01 11:01:31
|
Let's try
|
|
2024-04-01 11:01:37
|
He needs dozens of persons
|
|
2024-04-01 11:05:51
|
If you have talent please do some partecipation
|
|
2024-04-01 11:16:34
|
Let's talk every 30 minutes not every 10 minutes
|
|
|
yoochan
|
|
fab
https://jon-cld.s3.amazonaws.com/test/ahall_of_fshame_SSIMULACRA_2_modelD.html
|
|
2024-04-01 11:19:26
|
Interesting link, is wb the author? It is the first time I see this kind of comparison
|
|
|
fab
|
2024-04-01 11:20:11
|
This is the latest i have
|
|
2024-04-01 11:20:30
|
|
|
2024-04-01 11:20:31
|
The doors now looks more sharp
|
|
2024-04-01 11:20:56
|
But you have to use e9 so it needs an improvement in that sense
|
|
|
yoochan
Interesting link, is wb the author? It is the first time I see this kind of comparison
|
|
2024-04-01 11:24:18
|
My browser doesn't load the images, cpu problem if you have a serious computer please do the comparison
|
|
|
Demiurge
|
2024-04-01 11:36:47
|
Yeah, it's a cool link, and I believe wb is the author of both ssim2 and the hall of shame
|
|
|
fab
|
2024-04-01 11:37:09
|
Good job
|
|
2024-04-01 11:37:17
|
YooChar
|
|
|
Demiurge
|
2024-04-01 12:03:29
|
It's not meant to compare codecs. It's meant to compare "image similarity" algorithms.
|
|
|
fab
|
2024-04-01 02:44:38
|
Jxl experimental manga encoderr
|
|
2024-04-01 02:47:26
|
Experimental one
|
|
2024-04-01 02:47:27
|
|
|
2024-04-01 02:47:32
|
Here's https://jon-cld.s3.amazonaws.com/test/ahall_of_fshame_SSIMULACRA_2_modelD.html
|
|
|
yoochan
|
2024-04-01 02:47:37
|
What is aurora? Never heard of such a codec. Unless it is a jpeg encoder?
|
|
|
fab
|
|
yoochan
What is aurora? Never heard of such a codec. Unless it is a jpeg encoder?
|
|
2024-04-01 02:48:03
|
Dday.it fast av1 encoder you can also train on dday.it dataset
|
|
2024-04-01 02:48:15
|
Is by zoe liu and visiolarum
|
|
|
yoochan
|
2024-04-01 02:52:26
|
Like this one? https://visionular.ai/auroraimage/
|
|
|
fab
|
2024-04-01 02:55:30
|
I'm struggling to have idea
|
|
2024-04-01 02:56:02
|
In 2:00 pm they were 9 people working, now is only me on that page
|
|
2024-04-01 02:56:26
|
|
|
2024-04-01 03:03:04
|
|
|
|
Demiurge
|
2024-04-02 10:10:11
|
I'm getting ludicrously slow performance with libjxl transcoding an animated gif into jpegxl. It says it's using multiple threads but only one thread is actually being utilized. Even at effort=1 it's extremely bad performance, 0.019 MP/s, unless the tool does not count the pixels in additional frames when counting MP/s
|
|
2024-04-02 10:10:31
|
But cjxl core usage is bad
|
|
2024-04-02 10:10:45
|
It's single threaded even though it says it's using multiple threads
|
|
2024-04-02 10:12:04
|
At all effort levels.
|
|
2024-04-02 10:12:18
|
And density is much worse than gifski
|
|
2024-04-02 10:14:34
|
By comparison gifski uses multiple threads and outperforms cjxl by a massive margin in both speed and density
|
|
2024-04-02 10:16:05
|
Also I am unable to encode APNG produced by ffmpeg.
|
|
2024-04-02 10:16:45
|
Oh, I think I know why, though...
|
|
2024-04-02 10:17:10
|
That's probably because Arch sucks and stopped including the apng patch to libpng, so never mind that.
|
|
2024-04-02 10:28:21
|
...Nah, it still says "getting pixel data failed" even after rebuilding it with patched libpng...
|
|
2024-04-02 10:45:50
|
So essentially, it's impossible for me to create an animated jpegxl from an apng, unless I convert to gif first, and then it will use one core and be worse in every way compared to gifski
|
|
2024-04-02 10:48:51
|
I wonder how all those animated jpegxl test images were created
|
|
2024-04-02 10:51:47
|
Also, I don't think any libjxl developers have ever reached out to any of the users of the libjxl API, to offer suggestions about how the libjxl library is being used in applications and image libraries that link to libjxl
|
|
2024-04-02 11:18:22
|
Therefore, ffmpeg does not have animation support and I don't think anyone knowledgeable about the API is around to take a look at
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxlenc.c
for example, in order to offer suggestions to the ffmpeg devs or to the author of this file, on the best way to add animation support.
|
|
2024-04-02 11:18:43
|
Even though such a thing would increase the usefulness and ease of adoption of libjxl :)
|
|
2024-04-02 11:19:43
|
Or really, offering advice or feedback to the developers of any library or application that links to libjxl.
|
|
2024-04-02 11:21:25
|
Particularly in the areas of partial/cropped/thumbnail decoding, animation, streaming i/o, and setting memory limits to prevent DoS attacks.
|
|
|
spider-mario
|
|
Demiurge
Therefore, ffmpeg does not have animation support and I don't think anyone knowledgeable about the API is around to take a look at
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxlenc.c
for example, in order to offer suggestions to the ffmpeg devs or to the author of this file, on the best way to add animation support.
|
|
2024-04-02 11:46:46
|
the author of that code is <@853026420792360980>
|
|
|
Eugene Vert
|
|
Demiurge
Also I am unable to encode APNG produced by ffmpeg.
|
|
2024-04-02 12:03:57
|
https://github.com/libjxl/libjxl/issues/3430
|
|
|
Traneptora
|
|
Demiurge
So essentially, it's impossible for me to create an animated jpegxl from an apng, unless I convert to gif first, and then it will use one core and be worse in every way compared to gifski
|
|
2024-04-02 12:28:41
|
if there's a bug in cjxl's reading of apngs, that'll get fixed
|
|
2024-04-02 12:29:17
|
regarding libjxl_anim encoder, there's an existing patch for that that someone here authored. it needs to be tweaked a bit because of changes I have made to the encoder, but the work has mostly been done
|
|
2024-04-02 12:29:44
|
it hasn't been merged already mostly because of my time, not because I don't know how to use the libjxl API
|
|
2024-04-02 12:30:13
|
regarding feedback and API, I regularly ask and provide those sorts of things
|
|
2024-04-02 12:30:16
|
so that's not the issue
|
|
|
fab
|
2024-04-02 01:02:22
|
So i'm saying libjxl whitepaper 2.0 can't produce animation?
|
|
|
jonnyawsom3
|
2024-04-02 01:04:33
|
No one said anything about a whitepaper
|
|
|
fab
|
2024-04-02 01:06:58
|
Probably some things got reserved that users asked in 0.7.0
|
|
2024-04-02 01:07:19
|
So idk how it could be the new encoder
|
|
2024-04-02 01:10:33
|
I meant the spec was made by 100+ people
|
|
|
Demiurge
|
2024-04-02 04:07:26
|
I didn't realize you were the same person. That's cool. There was a developer from another important image processing library, I think it was maybe vips, who said they would welcome someone from here to look at their code and offer feedback about their use of the libjxl API. vips is a great library used by a lot of software for loading images. It has a great speed-optimized thumbnail generation feature for codecs like JPEG that support being decoded at a reduced resolution and increased speed.
|
|
2024-04-02 04:11:00
|
It has great support for decoding lots of different image types by linking to many different codec libraries, so it would be a great general image transcoder, and a great model for how the libjxl API is expected to be consumed by applications in the wild
|
|
2024-04-02 04:11:30
|
Same with other general image libraries that support lots of codecs and link to libjxl
|
|
2024-04-02 04:14:52
|
As far as I know, they asked for suggestions and are awaiting feedback and I assumed it's like that way for most projects that use libjxl
|
|
|
fab
|
2024-04-02 04:16:30
|
Vips has another encoder which I haven't compiled
|
|
2024-04-02 04:16:54
|
JPEG XL now reached decent ssim
|
|
2024-04-02 04:31:24
|
This is the result of interframe jxl
|
|
2024-04-02 04:31:38
|
It improved for me but your eyes can just flagged say no
|
|
|
Demiurge
|
2024-04-02 04:35:08
|
fab, that's just from the metrics comparison page. It has nothing to do with animation and it's comparing metrics, not codecs
|
|
|
fab
|
2024-04-02 05:14:26
|
I did another improvements of all codecs now but I have to wait for getting the better encoderz
|
|
|
Traneptora
|
|
Demiurge
I didn't realize you were the same person. That's cool. There was a developer from another important image processing library, I think it was maybe vips, who said they would welcome someone from here to look at their code and offer feedback about their use of the libjxl API. vips is a great library used by a lot of software for loading images. It has a great speed-optimized thumbnail generation feature for codecs like JPEG that support being decoded at a reduced resolution and increased speed.
|
|
2024-04-02 09:59:29
|
ye. one issue that needs to be reconciled is that libjxl doesn't support negative linesizes for buffers
|
|
2024-04-02 09:59:59
|
currently the way ffmpeg handles that is if the frame to encode has a negative linesize, it takes the absolute value and sets the orientation flag in the image header to "flipped vertically"
|
|
2024-04-02 10:00:17
|
that way buffers with negative linesizes, such as those from decoded PFM images, will be handled properly
|
|
2024-04-02 10:00:43
|
issue with this is that linesize is a property of an AVFrame, and not of an encoded stream, but orientation is in the JXL imageheader, not the frame header
|
|
2024-04-02 10:01:05
|
so if the linesizes aren't *all* negative or *all* positive, then this trick can't work, and I won't know if this is the case until i receive a frame down the line
|
|
2024-04-02 10:01:24
|
I'm considering just assuming this is a very unlikely scenario and failing intentionally if it isn't
|
|
|
Demiurge
|
2024-04-02 10:57:53
|
Are you referring to images that scan up from the bottom like bmp?
|
|
2024-04-02 10:58:19
|
I never heard the term linesize before
|
|
2024-04-02 10:59:32
|
Sounds unlikely for an apng to have differences like that between frames.
|
|
|
monad
|
|
Demiurge
Maybe something changed recently. I remember webp lossless dominating the middle and jxl at the extreme ends. But it looks like jxl got significant speedups in the last update
|
|
2024-04-04 09:28:13
|
Depends on whether you consider adding more threads a speedup. Outside photo-like and sufficient threading, webp is competitive or superior.
|
|
2024-04-04 09:32:07
|
Notice in the blog post how jxl just beats webp on "non-photographic" when it's given 8x as many threads.
|
|
2024-04-04 09:37:55
|
And this advantage diminishes as images become smaller.
|
|
|
Demiurge
|
2024-04-04 09:48:05
|
That's too bad. Hopefully Jyrki's webp algorithm gets ported over...
|
|
|
Vlad (Kuzmin) Erium
|
2024-04-07 05:02:33
|
Anyone have idea on how write_scanline() logic works for file formats that do not natively support scanlines?
For example, JPEG just can't support scanlines because it encoded by blocks 8x8. But at the same time, even in libjpeg, they have write_scanline().
|
|
|
w
|
2024-04-07 05:14:41
|
i think it's just because a lot of things are done by row
|
|
2024-04-07 05:14:54
|
makes it easy
|
|
|
Vlad (Kuzmin) Erium
|
2024-04-07 05:38:57
|
Well if the scanline is not a single line of pixels but a data block with 8x lines of pixels than they have sense.
But not sure if that implemented like this.
|
|
|
w
|
2024-04-07 05:41:33
|
the function is for the human
|
|
2024-04-07 05:41:38
|
it can do whatever it wants under the hood
|
|
|
fab
|
2024-04-07 06:08:17
|
|
|
2024-04-07 06:08:45
|
Solved this image after 12 days Sorry jon Sneyers
|
|
|
Vlad (Kuzmin) Erium
|
|
w
the function is for the human
|
|
2024-04-07 06:11:51
|
Still unclear. If scanlines are accumulating before passing to encoder. That probably should be mentioned in API. Otherwise someone would decide that write in columns also great idea 🙂
|
|
|
w
|
2024-04-07 06:12:18
|
columns are just rows
|
|
|
Vlad (Kuzmin) Erium
|
2024-04-07 06:36:54
|
Performance wise they are the not the same 😉
|
|
|
Demonik
|
2024-04-08 02:42:09
|
does anyone know what's calling convention on jxl.dll functions and callbacks?
|
|
|
yurume
|
2024-04-08 02:53:15
|
cdecl.
|
|
|
Demonik
|
2024-04-08 02:53:33
|
even on windows 64 bit? ty
|
|
|
yurume
|
2024-04-08 02:53:41
|
(more generally, any library that wasn't particularly developed for Windows in the first place will use cdecl by default)
|
|
|
Demonik
|
2024-04-08 02:54:28
|
I've been burned in the past assuming cdecl so I wanted to be sure
|
|
|
yurume
|
2024-04-08 02:54:33
|
unless `__stdcall` somehow became a default, cdecl will continue to be a default
|
|
2024-04-08 02:54:45
|
(you can also search for `declspec` to confirm that 🙂
|
|
|
Demonik
|
2024-04-08 02:54:46
|
pretty sure it's __fastcall on 64 bit
|
|
|
yurume
|
2024-04-08 02:55:25
|
btw are you using something other than C++?
|
|
|
Demonik
|
|
yurume
|
2024-04-08 02:55:35
|
cause your question sounds like that, yeah sure
|
|
|
Demonik
|
2024-04-08 02:56:00
|
writing C# bindings to jxl for multiple platforms
|
|
2024-04-08 02:56:04
|
which I'm going to use
|
|
2024-04-08 03:28:44
|
I hate when documentation doesn't list actual values on enums, especially when it doesn't say which header this enum is defined in exactly
|
|
2024-04-08 04:02:12
|
uh oh, is using int a good idea for public function?
|
|
2024-04-08 04:47:51
|
what's the `sizeof(JxlBasicInfo)` because I don't want to make it unsafe because of padding at the end?
|
|
2024-04-08 04:48:06
|
is it 196 (24 fields 4 bytes + 100 padding)?
|
|
|
yurume
|
2024-04-09 01:26:40
|
I think you want to (partly) generate such information via a small C program to be robust
|
|
|
Demonik
|
2024-04-09 02:01:14
|
oh and another question, is there a way to know which library I need to reference for each function because I can't find it in documentation either
|
|
2024-04-09 02:06:01
|
I also ended up with different set of libraries after building it compared to what was in prebuilt download for windows - first image is from building it myself, 2nd is prebuilt (sizes are also all different)
|
|
2024-04-09 02:20:58
|
oh, I figured it's `*_EXPORT` defines, they are different for each library
|
|
|
yurume
|
|
Demonik
is it 196 (24 fields 4 bytes + 100 padding)?
|
|
2024-04-09 03:03:32
|
it seems 204 bytes in x86-64 btw, confirmed with the actual header and godbolt.org. I think your count was invalid, it should have been 26 fields (so that 26 x 4 + 100 = 204).
|
|
|
Demonik
|
2024-04-09 03:42:03
|
ah, thanks, I'll probably just go over this again and run some C once I finish
|
|
2024-04-09 03:42:17
|
nearly done writing thin low level wrapper
|
|
2024-04-09 04:04:15
|
I'm assuming `double white_point_xy[2];` these have x first?
|
|
2024-04-09 04:04:30
|
and other CIE xy space fields
|
|
2024-04-09 05:05:11
|
what exactly is jxl_opaque in parallel runners?
|
|
2024-04-09 05:06:05
|
is that decoder/encoder opaque?
|
|
|
_wb_
|
|
Demonik
I'm assuming `double white_point_xy[2];` these have x first?
|
|
2024-04-09 07:32:57
|
yes
|
|
|
Demonik
|
|
yurume
it seems 204 bytes in x86-64 btw, confirmed with the actual header and godbolt.org. I think your count was invalid, it should have been 26 fields (so that 26 x 4 + 100 = 204).
|
|
2024-04-09 07:41:03
|
yeah, I missed couple fields in my bindings, good thing I manually counted, these were missings somehow
|
|
2024-04-09 12:30:44
|
ook, seems to work, will need to figure out how to build this for other platforms eventually <:SadCat:805389277247701002>
|
|
2024-04-09 02:22:11
|
is there any way to make decoder turn image upside down? for now I just set this
```csharp
JxlPixelFormat format =
new()
{
NumChannels = 4,
DataType = JxlDataType.UInt8,
Endianness = JxlEndianness.NativeEndian,
Align = 0,
};
```
and try to load that as ARGB32 texture but I end up with wrong colors and upside down image
|
|
2024-04-09 02:25:57
|
ok, color issue solved by using RGBA32 format but there is still orientation issue
|
|
2024-04-09 02:50:39
|
is there a way to flip output upside down?
|
|
2024-04-09 04:24:14
|
for now I'm just manually flipping output buffer but it'd be great if there was a way to tell decoder to do that
|
|
|
Demiurge
|
2024-04-10 04:04:24
|
I really like the dithering added to the decoder!
|
|
|
Demonik
|
2024-04-10 07:24:56
|
why is extra channel index using both `size_t` and `uint32_t`?
|
|
|
yurume
|
2024-04-10 07:43:25
|
either should work, the actual range is much smaller and fits to uint16_t.
|
|
2024-04-10 07:44:21
|
(as for why, I think `uint32_t` is generally used for structures while `size_t` is preferred for function arguments? that's the very fundamental decision that has to be made when you program in C/C++, and that convention is not too surprising to me.)
|
|
|
yurume
(as for why, I think `uint32_t` is generally used for structures while `size_t` is preferred for function arguments? that's the very fundamental decision that has to be made when you program in C/C++, and that convention is not too surprising to me.)
|
|
2024-04-10 07:47:51
|
((the main exception here is, of course, structure fields which can reasonably exceed 2^32 without OOM))
|
|
|
w
|
2024-04-10 08:20:11
|
size_t needs to be deleted
|
|
|
lonjil
|
2024-04-10 08:37:43
|
Then what type would you use
|
|
|
Demonik
|
2024-04-10 08:43:58
|
`size_t` has purpose
|
|
2024-04-10 08:44:12
|
but I think using them interchangeably is just asking for trouble at some point in the future
|
|
2024-04-10 08:44:27
|
also these doc lines confuse me
```
* The returned pointer is an opaque struct tied to the encoder and it will be
* deallocated by the encoder when @ref JxlEncoderDestroy() is called. For
* functions taking both a @ref JxlEncoder and a @ref JxlEncoderFrameSettings,
* only @ref JxlEncoderFrameSettings created with this function for the same
* encoder instance can be used.
```
|
|
2024-04-10 08:44:59
|
it mentions functions that take both JxlEncoder and JxlEncoderFrameSettings but I couldn't find any in either my bindings or headers that I ported to C#
|
|
2024-04-10 08:45:17
|
is it outdated or for future stuff?
|
|
|
w
|
2024-04-10 08:59:30
|
i always specify the size of the int
|
|
|
Demonik
|
2024-04-10 09:07:15
|
I think native one makes sense to use when you don't care about size or representation and just use the one most fitting for the platform, less so in library headers but especially when it uses specific size in certain place and then size_t or even worse something like int/short in others
|
|
|
jonnyawsom3
|
2024-04-10 11:39:24
|
Has anyone actually managed to encode apngs recently? I can't find a single image that decodes due to this https://github.com/libjxl/libjxl/issues/3430
|
|
|
TheBigBadBoy - 𝙸𝚛
|
|
Has anyone actually managed to encode apngs recently? I can't find a single image that decodes due to this https://github.com/libjxl/libjxl/issues/3430
|
|
2024-04-10 02:22:01
|
well, older `cjxl` managed to, yes
see this one
|
|
2024-04-10 02:22:03
|
|
|
2024-04-10 02:22:25
|
used 0.8 release
aka `JPEG XL encoder v0.8.0 adfc39bc [AVX2,SSE4,SSSE3,Unknown]`
|
|
|
jonnyawsom3
|
2024-04-10 02:23:04
|
Hence `recently`, I have an old 0.6 verson laying around but the memory use is too much without 0.10
|
|
|
TheBigBadBoy - 𝙸𝚛
|
2024-04-10 02:23:36
|
I didn't understand the "recently" as a version number <:KekDog:805390049033191445>
|
|
|
jonnyawsom3
|
2024-04-10 02:26:37
|
Well, within this year would've been nice xD
|
|
|
TheBigBadBoy - 𝙸𝚛
|
|
Hence `recently`, I have an old 0.6 verson laying around but the memory use is too much without 0.10
|
|
2024-04-10 02:26:54
|
because in your GitHub comment you say
> Do we actually know of any apng encoders that are compatible with cjxl currently?
> apngasm is also affected
so yeah there's one, cjxl 0.8.0 <:kekw:808717074305122316>
|
|
2024-04-10 02:27:50
|
and my file viewer supports animated JXL <:Stonks:806137886726553651>
|
|
|
jonnyawsom3
|
2024-04-10 02:29:13
|
```
C:\Users\jonat\Downloads>djxl Test.jxl Test.apng
JPEG XL decoder v0.10.2 e148959 [AVX2,SSE2]
Decoded to pixels.
384 x 256, 0.315 MP/s [0.31, 0.31], , 1 reps, 16 threads.
C:\Users\jonat\Downloads>cjxl Test.apng Test.jxl
JPEG XL encoder v0.10.2 e148959 [AVX2,SSE2]
Getting pixel data failed.
```
|
|
2024-04-10 02:29:22
|
Hmm
|
|
|
|
afed
|
2024-04-10 02:32:26
|
perhaps also libpng vs lodepng?
i got more issues with libpng when compiling with libjxl
|
|
|
Demiurge
|
2024-04-11 12:13:16
|
it can't read apng. Almost all apng has fcTL before IDAT because that's what the actual spec recommends
|
|
|
w
|
2024-04-11 09:30:35
|
is it known djpegli not working with cmyk?
|
|
|
Demonik
|
2024-04-11 10:26:37
|
if I use JxlDecoderReset do I have to set runner again? I assume so but I want to confirm that's the case
|
|
2024-04-12 04:52:48
|
daaamn, decoder is fast
|
|
|
w
|
2024-04-12 04:37:44
|
would really like jpegli to be able to be build as a separate library so it can actually be used
|
|
2024-04-12 04:38:25
|
separate also as in different from libjpeg
|
|
|
Demiurge
|
2024-04-12 08:29:23
|
It can be... but I'm too lazy rn to do it... are you using arch?
|
|
|
HCrikki
|
2024-04-12 08:33:37
|
would prebuilt stable and nightly dlls distributed alongside jxl's not be adequate enough ?
|
|
|
w
|
2024-04-13 03:24:23
|
also needs headers to be included in any project
|
|
2024-04-13 03:24:42
|
rn there are none
|
|
2024-04-13 03:24:49
|
so it's literally unusable
|
|
|
Demiurge
|
2024-04-13 09:11:50
|
Not entirely... it's supposed to be compatible with libjpeg headers
|
|
2024-04-13 09:12:19
|
And doesn't it also have its own API that allows higher than 8-bit input and output?
|
|
2024-04-13 09:12:46
|
So maybe it does have headers...
|
|
|
w
|
2024-04-13 09:18:06
|
they're not installed
|
|
2024-04-13 09:18:40
|
so it's only a replacement
|
|
2024-04-13 09:18:51
|
except it's not a complete replacement
|
|
2024-04-13 09:18:55
|
so it cant be used as a replacement
|
|
2024-04-13 09:19:47
|
wait, it's not even a replacement
|
|
2024-04-13 09:19:51
|
since you need libjpeg to use it
|
|
2024-04-13 09:20:01
|
it's a hack
|
|
|
Demiurge
|
2024-04-13 10:01:37
|
It definitely has a long way to go in order to make it into a proper replacement
|
|
|
w
|
2024-04-13 10:16:01
|
I also want to be able to use it alongside libjpeg
|
|
|
Demiurge
|
2024-04-13 12:09:50
|
How? It IS libjpeg... but it also has its own jpegli_ prefixed API
|
|
2024-04-13 12:10:09
|
Maybe that's what you mean by using it alongside
|
|
2024-04-13 12:11:04
|
If you use the jpegli api then you can use it alongside a different libjpeg
|
|
|
jonnyawsom3
|
2024-04-13 08:44:06
|
They raise a good point, what happens to jpegli's '10-bit' when transcoded to JXL?
https://github.com/libjxl/libjxl/issues/3464#issuecomment-2047846092
|
|
|
lonjil
|
2024-04-13 09:02:27
|
I think libjxl decodes to high precision in the same way that libjpegli does
|
|
2024-04-13 09:16:39
|
a peak absolute error of 0.000304968 is pretty low, right?
|
|
2024-04-13 09:17:19
|
i encoded a 16 bit png to jpeg with cjpegli, then transcoded to jxl, and finally decoded both to PFM, them compared with imagemagick
|
|
2024-04-13 09:18:20
|
jxlinfo calls it an "8-bit RGB" image, but that's just metadata
|
|
|
spider-mario
|
2024-04-13 09:19:26
|
there is a legitimate concern in that djxl and other software might default to decoding to 8-bit if not instructed otherwise
|
|
|
lonjil
|
|
Demiurge
|
|
They raise a good point, what happens to jpegli's '10-bit' when transcoded to JXL?
https://github.com/libjxl/libjxl/issues/3464#issuecomment-2047846092
|
|
2024-04-13 10:25:59
|
Uh, nothing? jpegli internally uses higher precision, so does libjxl, the DCG coefficients are losslessly preserved when you do lossless transcoding, so why would anything change?
|
|
|
jonnyawsom3
|
2024-04-13 10:27:05
|
Guess my brain thought about how jpegli isn't used in djxl, ect. Although the transcoded jpegs having better decoding *was* already a feature
|
|
|
Demiurge
|
|
lonjil
jxlinfo calls it an "8-bit RGB" image, but that's just metadata
|
|
2024-04-13 10:28:04
|
When jxlinfo says 8-bit RGB here for DCT images, it's technically lying and not even applicable at all.
|
|
2024-04-13 10:28:27
|
It can be decoded at any precision.
|
|
2024-04-13 10:30:30
|
Apparently the JFIF format has around 10 bits of "effective" precision if you do the calculations at a higher precision.
|
|
|
lonjil
|
|
Demiurge
When jxlinfo says 8-bit RGB here for DCT images, it's technically lying and not even applicable at all.
|
|
2024-04-13 10:33:12
|
technically, it's supposed to be the bit depth of the source data
|
|
|
Demiurge
Apparently the JFIF format has around 10 bits of "effective" precision if you do the calculations at a higher precision.
|
|
2024-04-13 10:34:37
|
it depends. 8-bit JPEG can actually have an effective bit depth of 7 in some situations! What Jyrki found was that in *smooth gradients*, the effective bit depth can be as high as 10.5, and since smooth gradients is exactly where you want more bits to reduce banding, that's perfect.
|
|
2024-04-13 10:35:13
|
(also, JFIF is just a container format for JPEG)
|
|
|
Demiurge
|
|
lonjil
technically, it's supposed to be the bit depth of the source data
|
|
2024-04-13 10:36:31
|
Yeah, that's what jxlinfo is actually listing, not the current representation of that data
|
|
|
lonjil
it depends. 8-bit JPEG can actually have an effective bit depth of 7 in some situations! What Jyrki found was that in *smooth gradients*, the effective bit depth can be as high as 10.5, and since smooth gradients is exactly where you want more bits to reduce banding, that's perfect.
|
|
2024-04-13 10:37:23
|
That explains a lot and is very awesome
|
|
2024-04-13 10:37:31
|
And makes a lot of sense
|
|
2024-04-13 10:39:00
|
So basically jpeg doesn't need to have such horrible banding
|
|
2024-04-13 10:39:50
|
It's partially a deficiency of the coder/decoder and not the data format itself
|
|
|
spider-mario
|
2024-04-13 10:41:16
|
I guess one could argue that it’s a sort of meta-failure of the data format that it gives implementers the wrong idea about what is possible
|
|
|
Demiurge
|
2024-04-13 10:41:58
|
And the reason why is that smooth gradients don't actually contain a lot of frequency data
|
|
|
spider-mario
I guess one could argue that it’s a sort of meta-failure of the data format that it gives implementers the wrong idea about what is possible
|
|
2024-04-13 10:43:13
|
Well I don't think anyone was necessarily forced to use 8 bit precision for everything.
|
|
2024-04-13 11:37:57
|
Back then, 32kb RAM should be good enough for anybody
|
|
2024-04-13 11:41:53
|
8 bit color was considered impressive, shockingly amazing probably
|
|
2024-04-13 11:42:21
|
Anything higher than 16 unique colors was state of the art
|
|
2024-04-13 11:43:12
|
:)
|
|
|
_wb_
|
2024-04-14 07:57:27
|
In jxl, the internal DCT coefficients do not have a specific bit depth (dequant factors are arbitrary real numbers), so the bit depth in the image metadata is only a suggestion of how to quantize the decoded RGB pixels if you need to use a limited precision integer buffer format.
In jpeg, the internal DCT coefficients are 12-bit, and those 4 extra bits are added to help make a round trip of iDCT(DCT(original)) not lose too much precision due to rounding. It's not enough to do fully reversible 8-bit in general (i.e. including "difficult" blocks like pure noise), but for a smooth block, one that effectively can be represented using just the first few low frequency coefficients, the effective precision that is available is closer to 12 bit. Assuming of course that the decoder doesn't immediately quantize the result after iDCT to 8-bit, which is what is often done (to save memory and because it is assumed that this is enough).
|
|
|
lonjil
|
2024-04-14 09:41:49
|
Perhaps jpegli should add a metadata note indicating that the source was (potentially) higher bit depth, and then libjxl could set different metadata than it usually does for jpeg?
|
|
|
Demiurge
|
2024-04-14 04:20:48
|
Does jpegli still use higher precision calculations internally and then dither during decoding if both the input and output buffers are 8 bit?
|
|
|
lonjil
|
2024-04-14 04:34:42
|
jpegli during decoding doesn't know whether the original input was high precision
|
|
|
Demiurge
Does jpegli still use higher precision calculations internally and then dither during decoding if both the input and output buffers are 8 bit?
|
|
2024-04-14 06:06:20
|
also, using higher precision internally produces higher quality regardless (though only slighty, of course)
|
|
|
Demiurge
|
2024-04-14 06:07:45
|
Well yeah. The smart thing to do is use high precision calculations internally all the time regardless of what the input or output precision is, and dither back down to lower precision at the final step when decoding to a lower precision output
|
|
2024-04-14 06:08:40
|
Just for the sake of less error and amplification of errors during the encoding and decoding steps
|
|
|
Demonik
|
2024-04-15 06:40:58
|
I have a question about custom memory manager
|
|
2024-04-15 06:41:13
|
documentation doesn't mention it - do I have to handle double free
|
|
2024-04-15 06:41:26
|
or does it guarantee that free is never called twice
|
|
|
Demiurge
|
2024-04-16 12:33:41
|
Is it true that libjxl had problems with adobeRGB somehow, before 0.10, like the commenters on phoronix are suggesting?
|
|
2024-04-16 12:35:50
|
Also <@154245620557807617> could you go into more specifics?
|
|
|
Quackdoc
|
2024-04-16 12:38:18
|
iirc it had some issues with reproducing the proper ICC data but it was proper colorimetery?
|
|
|
Demonik
|
|
Demiurge
Also <@154245620557807617> could you go into more specifics?
|
|
2024-04-16 12:54:14
|
what I meant is if I use custom allocator is it possible for `free` function to be called twice on same memory, from my logging it doesn't seem to be the case, so far I only see one memory allocation and one free
|
|
|
190n
|
2024-04-16 12:55:08
|
since it defaults to standard `malloc`/`free` and double free with those is illegal i would assume that double free by libjxl is also considered a bug
|
|
|
Demonik
|
2024-04-16 12:55:24
|
alright, ty
|
|
|
190n
|
2024-04-16 12:55:40
|
let us know if you find any <:KekDog:805390049033191445>
|
|
|
Demiurge
|
2024-04-16 01:23:01
|
If you use a custom malloc it should not change anything at all with how to use libjxl
|
|
2024-04-16 01:23:18
|
Some malloc implementations can detect double free
|
|
2024-04-16 01:23:49
|
mimalloc is supposed to be basically the best general purpose malloc afaik
|
|
|
190n
|
2024-04-16 01:24:02
|
i've heard praise for mimalloc and jemalloc
|
|
|
Demiurge
|
2024-04-16 01:24:59
|
I think it's kinda cool that unreal engine uses it
|
|
|
190n
|
2024-04-16 01:25:15
|
for something like libjxl (as used in many applications), it might even be beneficial to use an arena -- so you can allocate quickly and then destroy all jxl-related memory in one go when you're done with your encode or decode
|
|
|
Demiurge
|
2024-04-16 01:26:27
|
The problem with jxl is that I cannot even decode a large enough image
|
|
2024-04-16 01:26:41
|
Without running out of RAM
|
|
2024-04-16 01:26:58
|
It doesn't use a fixed amount of memory
|
|
2024-04-16 01:28:58
|
Also I think I found the source of people saying libjxl does not support adobe RGB color profiles properly
|
|
2024-04-16 01:29:01
|
https://github.com/libjxl/libjxl/issues/2550#issuecomment-1649736670
|
|
2024-04-16 08:16:36
|
So apparently djxl mangles/chops the colors, and recreates the color profile incorrectly as a linear profile?
|
|
|
spider-mario
|
2024-04-16 08:19:55
|
(writing in the present tense but I'm not sure if we've changed it)
djxl defaults to outputting to linear sRGB because it can't convert back to an ICC profile (as opposed to an enum colour profile), but there's no inherent chopping there (the linear data is unbounded), and the ICC profile is stored in the .jxl file
|
|
2024-04-16 08:20:12
|
the chopping happens when the linear data is written to PNG
|
|
2024-04-16 08:21:35
|
cjxl is now able to make an enum colour profile out of Adobe RGB, which works around the issue because the decoder can convert to that without needing a CMS
|
|
2024-04-16 08:22:38
|
but even without that, the previous .jxl files are fine, they're just less convenient to decode to Adobe RGB
|
|
|
Demiurge
|
2024-04-16 08:48:42
|
Well if the output is png or jfif, then it's gunna get chopped because I don't think those output formats support unbounded values or floats... and I think the root problem is that it's coverting it into a linear colorspace in the first place
|
|
2024-04-16 08:50:14
|
Also it would be nice if the decoder produced some kind of warning when clipping occurs.
|
|
|
|
afed
|
|
w
I also want to be able to use it alongside libjpeg
|
|
2024-04-16 02:11:49
|
yeah, that's one of the first things I asked for
also some extended api that would use all the jpegli features without libjpeg compatibility
and it would be nice to have that even before the official announcement, because it creates difficulties for those who want to try jpegli
and it's already happening
https://github.com/libjxl/libjxl/issues/3489
|
|
2024-04-16 02:17:07
|
especially for windows, and it would be nice to add jpegli for vcpkg <https://github.com/microsoft/vcpkg>
|
|
|
w
|
2024-04-16 02:24:49
|
I think it's nice to see a conversation where the languages are mixed
|
|
|
Meow
|
2024-04-16 03:22:52
|
He asked a question titled "ask a question!"
|
|