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

tools

_wb_
2023-02-03 09:28:37
I prefer something like that, where the encoding and size matching is already done
2023-02-03 09:29:39
(also what I like about it is that you can press SHIFT to toggle between the two images, which to me is a lot more comfortable than dragging the slider back and forth)
2023-02-03 09:32:40
the above comparison page was made by people from chrome/avif/webp2, it's not exactly a fair comparison since they use the slowest possible avif encode setting vs default jxl
2023-02-03 09:35:14
(so this is comparing jxl taking 0.4 seconds to encode an image to avif taking 1.5 minutes to encode an image)
Demiurge
_wb_ 3 out of 4 of those test images are non-photographic. For non-photo, indeed avif performs better. That's also what we saw in subjective experiments: https://sneyers.info/CID22/
2023-02-03 09:55:01
The color of the yellow glasses is severely degraded compared to AVIF, and that's photographic content. DCT is definitely not a good fit for non-photo content, not sure if Squeeze would be any better.
2023-02-03 09:55:38
But somehow AVIF does a passable job...
2023-02-03 09:56:02
even given that it's a non ideal algorithm
_wb_
2023-02-03 10:33:40
What version of libjxl is in squoosh ? 0.6.1? I wonder if things are better in 0.8. There have been a few quality tweaks since that version...
Traneptora
Demiurge https://squoosh.app/ Just wanna say, playing around with the test images in this app, AVIF seems to be overall substantially ahead of JXL in terms of subjective quality. In particular, in the screenshot of the phone, note how AVIF quality 40 preserves the color of the yellow glasses better than JXL quality 75. Also note how, in the hand "squoosh" image, JXL does not do any better than AVIF at preserving the faint grey lines, has a lot stronger ringing artifacts, and annoying artifacts show up at a higher bitrate than AVIF.
2023-02-03 01:09:10
guessing it's related to using an older version
2023-02-03 01:09:49
libjxl had a number of bug fixes relating to distorting color recently
Demiurge
2023-02-03 01:54:14
0.8.0
2023-02-03 02:07:36
Hmm, well the glasses don't actually seem so bad anymore now that I'm comparing them again.
2023-02-03 02:08:12
I find that AVIF quality settings lower than 40 on squoosh.app have pretty significant degradation
2023-02-03 02:08:41
For JXL that would be about -q 78
2023-02-03 02:08:49
to reach the same bitrate I mean
2023-02-03 02:09:14
Not the same quality. JXL has clearly better quality at that bitrate
2023-02-03 02:09:57
But there are so many different factors that effect the psychovisual performance of lossy avif
daniilmaks
_wb_ The question is if dct-based lossy compression for non-photo images is even a good idea to begin with. I think it's better to either use SVG if possible, or lossless/near-lossless techniques rather than DCT for such images.
2023-02-03 04:27:45
99% of digital art uses raster workflows
_wb_
2023-02-03 04:28:35
I wouldn't know the percentage but sure, vector is certainly not always an option
2023-02-03 04:29:51
But people drawing flat illustrations in Adobe Illustrator or whatever shouldn't be rasterizing them and use jpeg or avif to compress that, they should use an svg optimizer
daniilmaks
2023-02-03 04:30:38
it might be the case that many sharing platforms simply do not support vector uploads
_wb_
2023-02-03 04:32:05
Even then, I'd rather use a high-res palette png than something with ringing (like jpeg) or smearing (like avif)
daniilmaks
2023-02-03 04:33:15
Anything paletted breaks appart when put against extensive gradients
2023-02-03 04:35:12
At the end of the day, this is a shift of burden. Good lossy compression of synthetic productions is already here. I kinda just wish it was also in jxl.
_wb_
2023-02-03 04:39:07
Jxl can do delta palettes, which fixes the gradient problem
daniilmaks
2023-02-03 04:41:16
was that already implemented in the test you shared?
2023-02-03 04:42:24
oh, you talking about lossless jxl?
2023-02-03 04:45:34
a palette preprocessor specific to jxl that leverages delta palettes would be intetesting
_wb_
2023-02-03 04:45:34
no, delta palette is meant to be used for near-lossless, but it's kind of experimental still
daniilmaks
2023-02-03 04:46:00
sounds good
2023-02-03 04:58:38
please be aware that a lot of artwork isn't exactly "anime style" but rather falls somewhere in the middle between synthetic and photographic content. This is one of the key areas where avif apears to excel, because it's not organic enough to have the noise and paterns of real media, yet it's easily too complex to efficiently compress using lossless algorithms and preprocessors.
2023-02-03 04:59:25
However, IIRC, I've heard something about 65K color palettes. That could shift the tide.
_wb_
2023-02-03 05:32:57
yeah, for complex art lossy methods work better; avif does well at the lower bitrates because its artifacts are mostly blurring and smearing (and maybe some banding, but generally not nearly as bad as jpeg at low bitrate), which is not as annoying as ringing / dct noise
2023-02-03 05:35:00
there can be some annoying "surprises" though, when the smoothing is just ruining a texture or when the smearing causes lines to get a bit weird (due to basically being 'rounded to the nearest available angle')
daniilmaks
2023-02-03 08:48:57
banding is effectively solved since nobody in their right mind uses less than 10 bpc in avif. and just like jxl, film grain can be used as error diffusion.
2023-02-03 08:53:44
surprises are everywhere, jxl likes parkinsonian chroma blocking in edges, avif likes to schmear paticular kinds of textures
JendaLinda
2023-02-03 08:57:11
Artists often don't understand internal workings of image formats. There are some who are happily using JPEG at q100 with 2x2 chroma subsampling.
daniilmaks
2023-02-03 08:57:59
which is why having good defaults is paramount
JendaLinda
2023-02-03 09:00:24
It is the job of software developers to make the codecs easy to use and produce predictable results.
_wb_
banding is effectively solved since nobody in their right mind uses less than 10 bpc in avif. and just like jxl, film grain can be used as error diffusion.
2023-02-03 09:15:36
Does 10bit help much for banding when doing low quality encode? Also I am not sure if lots of people do actually use 10bit avif. It makes sense of course, even if the input is 8bit rgb (because yuv eats one bit and tv range another half bit), but there's also a cost in speed (both encode and decode), so I am not sure if it's actually very widely used. E.g. the avif team at chrome just used 8bit...
daniilmaks
2023-02-03 09:16:13
yes, it helps even in 8 bit source
2023-02-03 09:16:58
specially at low bpp
JendaLinda
2023-02-03 09:17:04
10bit and low quality seems kinda contradictory.
daniilmaks
2023-02-03 09:17:20
it actually isn't
2023-02-03 09:17:54
10bit will have the same quality at worst
2023-02-03 09:19:03
8bit should never be used under any circumstances outside extreme, platform-specific performance considerations
JendaLinda
2023-02-03 09:20:26
By common sense, spending less on bit depth would leave more room for details.
daniilmaks
2023-02-03 09:21:17
in practice it doesn't appear to do so
2023-02-03 09:23:10
actually it's only on really high bpp noisy material (well into jxl territory) where 8 bit might not matter
JendaLinda
2023-02-03 09:25:43
Most of the source data is 8bit, so it would have to be upconverted. Most display devices are 8bit and likely will be for time being.
daniilmaks
2023-02-03 09:30:30
in any instance where you perform a mayor reduction in bitrate, 10bpp will help even in 8bit sources due the noise in the source being effectivelly organic error diffusion, which can be leveraged to extract the otherwise unavailable values into the resulting 10 bit low bpp picture.
2023-02-03 09:31:33
then on top of that you can optionally apply grain synthesis or film grain to dither the image for 8 bit displays
JendaLinda Most of the source data is 8bit, so it would have to be upconverted. Most display devices are 8bit and likely will be for time being.
2023-02-03 09:35:21
displays are 8bit RGB, which has about 75% more shades of color than 8bit YUV in most lossy codecs
2023-02-03 09:36:49
IIRC
JendaLinda
2023-02-03 09:38:45
As a compensation for the smaller size of YUV space, that would make sense.
_wb_
2023-02-03 09:42:06
Banding is caused by dc quantization. I would assume that in 10-bit, to get the same bitrate, you apply 4x as much quantization to everything so the quantized coeffs have the same range as in 8bit, just all transforms and filters are more precise so you lose less in cumulative rounding errors.
daniilmaks
2023-02-03 09:43:01
pretty much
JendaLinda
2023-02-03 09:46:58
I didn't realize, that in AVIF, the bit depth applies to the internal color space. Where in JXL, the bit depth applies to RGB color space.
afed
Demiurge For JXL that would be about -q 78
2023-02-04 12:52:22
more simply, jxl below d2 is not even worth comparing, most video based formats will be better, or rather look better because they have more ways to filter and can highly compress the most visually notable parts, like edges, flat colors but at high quality it's the opposite, I mostly use jxl with d1 and for avif it's very difficult to achieve transparent quality, even at high bitrates it still loses details and smoothes the image avif is good for previews or when it's not important to match the source image and needs higher compression, but what I see in real use is very rare and most avif images even for previews have pretty high bitrate, on which jxl is also good and even better and even d1 is still very good compression and it's not some bloated images, especially for typical image resolution on web pages (images with very high resolution or source photos usually have individual links and require very high quality, having 50 megapixel photos with q40 avif compression would be very strange) i don't even think jxl is even worth the effort to optimize for low quality, that spot is taken by video based codecs and they have far more tools for that, it would be better if jxl improved at medium to high quality where there are still issues with color bleeding/shifting or ringing artifacts
2023-02-04 12:53:16
very useful feature <:Poggers:805392625934663710> https://github.com/libjxl/libjxl/pull/2146
2023-02-04 12:58:27
and it would be nice to have a similar one for other formats
Demiurge
afed more simply, jxl below d2 is not even worth comparing, most video based formats will be better, or rather look better because they have more ways to filter and can highly compress the most visually notable parts, like edges, flat colors but at high quality it's the opposite, I mostly use jxl with d1 and for avif it's very difficult to achieve transparent quality, even at high bitrates it still loses details and smoothes the image avif is good for previews or when it's not important to match the source image and needs higher compression, but what I see in real use is very rare and most avif images even for previews have pretty high bitrate, on which jxl is also good and even better and even d1 is still very good compression and it's not some bloated images, especially for typical image resolution on web pages (images with very high resolution or source photos usually have individual links and require very high quality, having 50 megapixel photos with q40 avif compression would be very strange) i don't even think jxl is even worth the effort to optimize for low quality, that spot is taken by video based codecs and they have far more tools for that, it would be better if jxl improved at medium to high quality where there are still issues with color bleeding/shifting or ringing artifacts
2023-02-04 01:27:28
Well I wouldn't complain about any improvements, regardless of where they are made :)
_wb_
2023-02-04 07:33:07
Improving libjxl at low quality is always nice, as long as it doesn't cause high quality to get worse as a side-effect.
afed
2023-02-04 07:45:42
yeah, I meant making improvements on low quality as a priority when it requires significant effort, any improvement is always nice, especially some improvements can affect on all qualities
BlueSwordM
afed yeah, I meant making improvements on low quality as a priority when it requires significant effort, any improvement is always nice, especially some improvements can affect on all qualities
2023-02-04 08:42:13
An interesting way to improve libjxl output at lower qualities would be to integrate a form of very fast encoder psy-RDO that allows the encoder to better perform at low bitrates that targets better structure retention at low bpp and targets better frequency retention at high bpp.
2023-02-04 08:42:58
I guess ssimulacra2 could work in the meantime in place of butteraugli as a shortcut in that regard.
2023-02-04 08:44:21
All theoretical vomit until it's implemented in a proper framework, or just better expressed from my part.
_wb_
2023-02-04 09:12:04
Libjxl currently basically just tries to reach a fidelity target, without trying to do rdo. That works fine for d0.1-d3, but at lower quality you really should consider the trade-off between signaling cost and distortion. Perhaps we could start by implementing some trellis optimization like mozjpeg has.
2023-02-04 09:13:34
Though I don't really see that much of a use case for d >> 3, besides making impressive examples of how nice things can still look at very low bitrates.
Fraetor
2023-02-04 09:00:40
Just looking at the cjxl help page, I'm wondering if the `--brotli_effort` and possibly the `--resampling` options should be hidden behind the verbose flag, as they don't seem like things that would common usage. (I'm also a little surprised that brotli effort isn't implicitly derived from effort.)
Demiurge
_wb_ Improving libjxl at low quality is always nice, as long as it doesn't cause high quality to get worse as a side-effect.
2023-02-05 03:40:08
It makes sense to have completely separate encoders for different bitrates and purposes, like fjxl
2023-02-05 03:40:52
Although it's not good to overcomplicate things when they can be generalized
2023-02-05 05:51:31
I am on Arch Linux and exiv2 seems to be build with BMFF enabled: https://github.com/archlinux/svntogit-packages/blob/packages/exiv2/trunk/PKGBUILD
2023-02-05 05:51:43
And yet I don't see any metadata on my JXL files...?
Traneptora
Demiurge And yet I don't see any metadata on my JXL files...?
2023-02-05 06:01:47
are the boxes brob compressed?
2023-02-05 06:02:12
if so exiv2 can't read them iirc
Demiurge
2023-02-05 06:45:37
Hmm probably if that's the default
2023-02-05 06:45:46
Well that would explain it I guess
2023-02-05 06:46:12
Wonder why everyone uses exiv2 if it's so useless with any format made after 1990
_wb_
2023-02-05 07:14:51
Because a format made 30 years ago is still by far the most popular one ๐Ÿ™‚
Demiurge
2023-02-05 07:48:59
Yeah...
pshufb
2023-02-07 03:27:29
libjxl doesn't do trellis quantization? is there a reason why not, besides lack of engineering resources? (i.e a theoretical reason against it)
_wb_
2023-02-07 04:14:39
<@532010383041363969> probably has more insight on this than me. I don't know of any reason why not, but maybe some of the current vardct heuristics end up doing something similar enough for it to not help much anymore, or something like that.
BlueSwordM
_wb_ Libjxl currently basically just tries to reach a fidelity target, without trying to do rdo. That works fine for d0.1-d3, but at lower quality you really should consider the trade-off between signaling cost and distortion. Perhaps we could start by implementing some trellis optimization like mozjpeg has.
2023-02-07 08:34:46
Yeah, but with RDO, you can get some amazing coding gains at lower sizes, which is rather important.
2023-02-07 08:35:24
Considering libjxl current doesn't have RDO, the encoder is actually very impressive in this regard.
Fraetor
2023-02-07 09:38:53
What is RDO?
_wb_
2023-02-07 09:42:31
rate-distortion optimization
Fraetor
2023-02-07 09:44:41
Ah. Thanks.
Jyrki Alakuijala
pshufb libjxl doesn't do trellis quantization? is there a reason why not, besides lack of engineering resources? (i.e a theoretical reason against it)
2023-02-08 09:26:46
there is no trellis quantization in libjxl
2023-02-08 09:28:00
I believe that trellis quantization is more interesting when there are a lot of zeros in the dct (low quality) and at higher quality it tends to slow things down, leading to somewhat unpredictable encoding performance
_wb_
2023-02-08 09:35:19
it's probably something we should start doing only at d > 2 or so, if possible in a gradual way so we don't introduce a discontinuity
Traneptora
2023-02-08 01:32:14
doesn't `num_zeroes` allow us to efficiently encode zeroes though?
2023-02-08 01:32:34
I'm not entirely sure what trellis quantization is, tbh
_wb_
2023-02-08 02:11:11
num_zeroes makes storing trailing zeroes efficient, but that's not super different from regular jpeg which also has an "end of block" symbol that makes trailing zeroes cheap
2023-02-08 02:17:30
in trellis quantization, iiuc, what you basically do is turn some of the coeffs that are nonzero into zeroes, if the cost of signaling the nonzero is "not worth it" compared to the quality improvement that coeff gives. In particular, zeroing the last nonzero coeff could result in getting more than one additional zero becoming part of the trailing zeroes so if that happens then it has a large signaling cost compared to a nonzero somewhere in the beginning.
Traneptora
2023-02-08 03:48:18
I see, so it's essentially a reduction in quality for a larger reduction in cost
_wb_
2023-02-08 03:49:29
yes, or if you start from a higher quality to begin with, you get better quality for the same bitrate
2023-02-08 03:54:35
what you need to be able to do for this though, is estimate the signaling cost of things. This is easy for regular jpeg which has very simple signaling (just huffman coding), so it's not very hard to estimate the cost of symbols. In jxl things are a bit trickier because we can do coefficient reordering, context modeling and clustering, etc โ€” meaning the cost of signaling depends much more on what actually ends up being signaled, so it seems a bit harder to estimate signaling costs.
veluca
2023-02-08 04:01:12
that said, AV1 manages to do it so in principle it can be done... or approximated
pshufb
Jyrki Alakuijala there is no trellis quantization in libjxl
2023-02-08 05:35:53
thanks
BlueSwordM
_wb_ what you need to be able to do for this though, is estimate the signaling cost of things. This is easy for regular jpeg which has very simple signaling (just huffman coding), so it's not very hard to estimate the cost of symbols. In jxl things are a bit trickier because we can do coefficient reordering, context modeling and clustering, etc โ€” meaning the cost of signaling depends much more on what actually ends up being signaled, so it seems a bit harder to estimate signaling costs.
2023-02-08 06:47:10
An interesting thing to do with treillis quantization is to make it frequency weighted.
Jyrki Alakuijala
2023-02-09 10:05:40
we have other anti-psnr approaches to quantization that are O(1) and don't slow down with higher quality
2023-02-09 10:07:01
we could add more complexity in quantization decisions where we stay in O(1) and don't slow down with higher quality
2023-02-09 10:07:25
I have ideas that can give ~2 % more density
_wb_
2023-02-10 05:06:46
does anyone know how to get debian to change the composition of the libjxl-devtools package? is Mathieu Malaterre on this discord?
2023-02-10 05:07:13
it currently has these tools: /usr/bin/benchmark_xl /usr/bin/butteraugli_main /usr/bin/decode_and_encode /usr/bin/display_to_hlg /usr/bin/fuzzer_corpus /usr/bin/generate_lut_template /usr/bin/jxl_from_tree /usr/bin/pq_to_hlg /usr/bin/render_hlg /usr/bin/ssimulacra_main /usr/bin/texture_to_cube /usr/bin/tone_map /usr/bin/xyb_range
2023-02-10 05:08:54
that's quite a mixed bag of stuff, and probably some of these are too niche to be useful to anyone, while some things are missing
2023-02-10 05:09:23
also the names of these tools are not always very nice
2023-02-10 05:10:04
(in particular names ending in _main look silly to me)
2023-02-10 05:10:54
maybe we should change the names in the libjxl repo, and bring some more structure in the tools folder
2023-02-10 05:11:41
I think it would make sense to have one cluster of tools related to benchmarking and metrics: benchmark_xl, butteraugli, ssimulacra, ssimulacra2 (*)
2023-02-10 05:14:25
then another cluster related to HDR conversions: display_to_hlg, exr_to_pq (*), generate_lut_template, pq_to_hlg, render_hlg, texture_to_cube, tone_map
2023-02-10 05:16:29
xyb_range is not something worth distributing. also fuzzer_corpus is not something useful to the general public imo.
2023-02-10 05:19:45
decode_and_encode should be renamed and is probably useful as a general colorspace conversion tool, but it really needs some better help/man page
2023-02-10 05:21:31
jxl_from_tree is just for fun and might be worth keeping but maybe as a package on its own and with a man page that can be copied from https://jxl-art.surma.technology/wtf.html
2023-02-10 05:22:14
(*) are tools currently missing from libjxl-devtools and probably useful enough to be included
2023-02-10 05:25:50
we should probably also turn the input format reading code that is shared between many of these tools into a library to reduce the binary sizes a bit... and allow the tools to take jxl input, which they currently don't ๐Ÿ™‚
JendaLinda
2023-02-14 11:20:10
How do you locate updated libjxl builds on Github? I'm unable to find them. They're either very well hidden or I'm just blind.
Traneptora
JendaLinda How do you locate updated libjxl builds on Github? I'm unable to find them. They're either very well hidden or I'm just blind.
2023-02-14 11:21:32
2023-02-14 11:22:13
if you meant git master builds, I don't believe there are artifacts for those automatically generated
JendaLinda
2023-02-14 11:33:45
I'm interested in up-to-date master builds. I'm getting lost in the Actions sections. I'm finding only job logs and no files.
username
2023-02-14 11:34:50
<@688076786525143117> go here https://artifacts.lucaversari.it/libjxl/libjxl/latest/
JendaLinda
2023-02-14 11:44:35
Thank you. I usually download updated builds from this server. The repository was not updated for a few days, so I was wondering if there was a newer build on Github. I know there are builds on Github. Devs sometimes post a direct link to the artifacts, but I was never able to find them on my own.
Traneptora
2023-02-14 09:11:35
the GIMP plugin fails to save lossless JXL files
2023-02-14 09:11:42
``` file-jxl-save Info: No ICC profile. Exporting image anyway. file-jxl-save Warning: Using internal profile. file-jxl-save Warning: JxlEncoderSetColorEncoding failed file-jxl-save Error: JxlEncoderAddImageFrame failed ```
2023-02-14 09:11:45
prints this to console when it fails
2023-02-14 09:12:02
GIMP version 2.10.32
2023-02-14 09:12:10
where do I report this? is this libjxl or somewhere downstream?
2023-02-14 09:53:18
never mind, sent a PR to fix this :)
2023-02-14 09:53:18
https://github.com/libjxl/libjxl/pull/2188
novomesk
Traneptora where do I report this? is this libjxl or somewhere downstream?
2023-02-15 02:38:42
https://github.com/libjxl/libjxl/issues/1931
JendaLinda
username <@688076786525143117> go here https://artifacts.lucaversari.it/libjxl/libjxl/latest/
2023-02-17 11:50:02
Are there really no builds after 10tf Feb?
username
2023-02-17 11:54:44
huh I didn't realize it stopped updating, I wonder what happened? since I assume it's automated. maybe the build system for it broke or failed at some point because of a commit?
2023-02-17 11:54:57
I don't know since i'm not behind the site
JendaLinda
2023-02-17 12:12:22
Thank you. So next time I need to go to Actions and Release build/Deploy. There are the builds. I was looking at the wrong place all the time.
veluca
JendaLinda Are there really no builds after 10tf Feb?
2023-02-18 07:33:11
uhhh that's odd, I'm currently horrendously busy with a programming contest but I'll hopefully fix this on Monday... maybe nag me until I do?
Traneptora
2023-02-20 06:19:48
I don't see where the artifacts are listed
veluca uhhh that's odd, I'm currently horrendously busy with a programming contest but I'll hopefully fix this on Monday... maybe nag me until I do?
2023-02-20 06:42:53
nag
veluca
2023-02-20 06:50:55
No clue what happened, systemd decided it didn't like my timer
yoochan
veluca uhhh that's odd, I'm currently horrendously busy with a programming contest but I'll hopefully fix this on Monday... maybe nag me until I do?
2023-02-20 06:51:52
What kind of competition?
veluca
2023-02-20 06:53:31
SWERC (swerc.eu)
yoochan
2023-02-20 06:55:04
Did you enjoyed it?
improver
veluca No clue what happened, systemd decided it didn't like my timer
2023-02-20 07:14:54
was it enabled?
veluca
improver was it enabled?
2023-02-20 10:13:42
ok I figured it out, the unit that was started by the timer got stuck
yoochan Did you enjoyed it?
2023-02-20 10:14:01
yup, it also went very well on the technical side for once xD
Traneptora
2023-02-21 03:01:13
ah, it's on the summery page, not on the individual thing page
sklwmp
2023-02-28 01:39:22
What exactly is cjpeg_hdr and how does it relate to jpegli? Does it use the same underlying code?
_wb_
2023-02-28 02:18:58
It's an earlier experiment by <@179701849576833024> to do accurate jpeg encoding to see if it's good enough for HDR, iirc
veluca
2023-02-28 02:46:04
Jpegli was started from there IIRC
spider-mario
2023-02-28 03:36:03
yes, and then there was a refactor to make cjpeg_hdr use the same code as jpegli
2023-03-02 12:40:37
if you mean โ€œbetter than q100โ€ then yes, at least when the image is also decoded with jpegli; if you mean โ€œbetter quality for the same sizeโ€ then also yes AFAIK
2023-03-02 12:41:18
re: the first point, from what I recall, when we tried HDR JPEG with PQ/HLG using libjpeg-turbo, q100 was not enough to prevent banding
2023-03-02 12:41:24
but the approach used in jpegli was
2023-03-02 12:41:53
so jpegli should unlock decent HDR in legacy JPEG
2023-03-02 12:42:30
(with HLG perhaps a better fit than PQ)
_wb_
2023-03-02 12:56:38
libjpeg-turbo starts by converting 8-bit RGB to 8-bit YCbCr โ€” that alone is already losing ~1 bit of precision. Then it does a DCT implemented in int16 on that, which is also not super precise. Then on decode it does the inverse things again with limited precision.
veluca
2023-03-02 01:00:41
it's a number that lowers quality as it goes higher
2023-03-02 01:00:52
I don't think I would be confident to say any more than that ๐Ÿ˜›
spider-mario
2023-03-02 01:57:50
and 0 = quant table of only ones
_wb_
2023-03-02 02:10:02
which is as lossless as it gets for a valid de facto jpeg file, but not quite lossless
Traneptora
2023-03-03 04:06:44
does true lossless jpeg exist?
2023-03-03 04:08:40
or is it a poorly supported standard extension?
2023-03-03 04:09:27
or something like that
username
2023-03-03 04:32:25
I think you are thinking of something that libjpeg added that is not apart of the jpeg standard
veluca
2023-03-03 07:25:15
I think not ๐Ÿ˜†
spider-mario
Traneptora does true lossless jpeg exist?
2023-03-03 09:43:14
yes, it is part of the specification but practically no one implements it
2023-03-03 09:43:30
the term may also refer to JPEG-LS which is a different, later format
2023-03-03 09:44:09
see: https://en.wikipedia.org/wiki/Lossless_JPEG
_wb_
2023-03-03 11:52:26
also it's quite bad, it's basically encoding the whole image as if it's DC, iirc. So that's using the pixel on the left as a predictor and huffman coding the residuals, without lz77. A bit worse than PNG on photographic images, a lot worse on nonphoto.
Traneptora
2023-03-03 12:57:27
ah, and it's not decoder conpatible, so I can see why it's not really great
yoochan
2023-03-06 07:38:55
I would have expected `cjxl --container=0 -e 9 0006.jpg 0006.jxl` to discard the container and jpeg reconstruction data (which was not the case)
2023-03-06 07:39:09
```$ jxlinfo 0006.jxl JPEG XL file format container (ISO/IEC 18181-2) JPEG XL image, 1280x1834, (possibly) lossless, 8-bit RGB Color space: RGB, D65, sRGB primaries, sRGB transfer function, rendering intent: Relative JPEG bitstream reconstruction data available frame: full image size ```
2023-03-06 07:39:44
but adding `--jpeg_store_metadata=0` worked on version `cjxl v0.9.0 423375e0`
2023-03-07 05:49:31
Thanks! I understand. The - - help is a bit misleading then, I'll complete the faq
eric.portis
2023-03-08 10:29:31
What's the easiest way to see what --downsampling=x values are available for a given .jxl file, and their byte offsets? I assumed I could see this in `jxlinfo`, but no luck. RELATED: has anyone written anything in Javascript (or compiled anything to wasm) that can read/extract `FileHeader` info, from a .jxl bitstream?
2023-03-08 10:36:44
(so far the most efficient thing I have found is to run djxl a bunch of times with `--print_read_bytes` and different values of x, and manually note when the `Decoded bytes:` output changes between runs.)
DZgas ะ–
2023-03-13 11:57:58
there are no chats where it can be drop it, so I drop it here. my cjxl build for windows pre pull/2252 fix -- 7e5b5065c5b6f5f1d5b76fea56ec51ade81da06b -- with an appended code for 8 layers of progressive decoding
Jyrki Alakuijala
2023-03-17 04:44:37
'no quantization in quality 100 jpegs' means 12-bit quantization of the dct results -- if every rounding in a 64-value block is into the wrong direction, it means an error 0.5 * 64, i.e., 32 steps -- 12 bits gave you 4096 steps, so once you divide by 32 you have 128 steps left -- it might be that quality 100 jpeg, when every step is done perfectly, gives you 7 bits of guaranteed values
_wb_
2023-03-17 05:58:18
If the block is smooth enough (solid color or some gradient), only the low freq coeffs are nonzero so the precision loss due to coeff quantization isn't that severe. The worst case would be for something that uses all frequencies, like noise or fine text.
Jyrki Alakuijala
2023-03-23 01:27:58
correct, for smooth gradients one gets nearly full 12 bit precision
yoochan
2023-03-26 05:13:18
I successfully compiled the wasm32 artifacts ! youpi ! I'm not sure how to use them though.... does anybody have a clue on how to use them ? I had no issue using niutech project but I'm missing something here... it seems to be meant to be used with nodejs whereas I would like to use it in a browser
zamfofex
2023-03-26 05:44:32
<@1051137277813870592>: What have you compiled to Wasm? And how did you compile it? If you compiled it for WASI using Clang directly (with the Wasm SDK), generally you can use an WASI implementation for the browser. I remember once using Wasmerโ€™s implementation. If you compiled it with Emscripten, you can generally just load the JavaScript file it outputted directly in a browser.
yoochan
2023-03-26 05:47:25
I followed this ! https://github.com/libjxl/libjxl/blob/main/doc/building_wasm.md just to try...
2023-03-26 05:48:55
I think that what I miss is: what's exactly inside those artifacts... I got a decode_oneshot.wasm, decode_progressive.wasm (the one I want most to play with) and some others
zamfofex
2023-03-26 05:55:14
It should have generated one or more JavaScript alongside those, no? You should be able to just use them directly from an HTML page.
yoochan
2023-03-26 05:56:07
indeed, I'll start with this
2023-03-26 05:57:55
what surprised me is that the companion .js file starts with with a shell bang to nodejs... I was wondering if the syntax could differ for a use in nodejs or in a browser...
2023-03-26 07:48:55
looking for the high level symbols available in those wasm, I tried wasm-decompile and got a core dump ๐Ÿ˜…
2023-03-26 08:05:55
oh ! I may have found something !
afed
2023-03-29 03:04:15
what does color quantization bring for decoding? https://github.com/libjxl/libjxl/pull/2342
zamfofex
2023-03-30 01:24:27
<@853026420792360980>: Iโ€™m not sure if this is the right channel to talk about nonโ€libjxl tools like jxlatte, but I decided to take a look into its source code a bit more extensively to try to acquaint myself with it, and I came up with a patch for some small issues I found. Namely: - I replaced `sneakyThrow` with a `RuntimeException` subclass that is skipped when searching for the underlying cause of a throwable in `JXLatte.java`. It feels like a cleaner solution than throwing a checked exception by an unchecked cast. - I fixed some warnings that I got with `-Xlint:all`. - I replaced a comment with a more accurate explanation of type parameter erasure in Java, and of why an unchecked cast was necessary. I will say, for some more cosmetic changes, now that JXLatte requires Java 11, maybe itโ€™d make sense to use local type inference more actively. I feel like it can help improve readability sometimes! Also, something else: I have been trying to get jxlatte to compile to Wasm with tools such as Bytecoder. (Though I donโ€™t think the changes are appropriate for being merged upstream.) If I succeed, maybe I ought to consider replacing libjxl with it for my extension! ๐Ÿ™‚
Traneptora
<@853026420792360980>: Iโ€™m not sure if this is the right channel to talk about nonโ€libjxl tools like jxlatte, but I decided to take a look into its source code a bit more extensively to try to acquaint myself with it, and I came up with a patch for some small issues I found. Namely: - I replaced `sneakyThrow` with a `RuntimeException` subclass that is skipped when searching for the underlying cause of a throwable in `JXLatte.java`. It feels like a cleaner solution than throwing a checked exception by an unchecked cast. - I fixed some warnings that I got with `-Xlint:all`. - I replaced a comment with a more accurate explanation of type parameter erasure in Java, and of why an unchecked cast was necessary. I will say, for some more cosmetic changes, now that JXLatte requires Java 11, maybe itโ€™d make sense to use local type inference more actively. I feel like it can help improve readability sometimes! Also, something else: I have been trying to get jxlatte to compile to Wasm with tools such as Bytecoder. (Though I donโ€™t think the changes are appropriate for being merged upstream.) If I succeed, maybe I ought to consider replacing libjxl with it for my extension! ๐Ÿ™‚
2023-03-30 01:26:20
you need sneakyThrow to throw exceptions from inside stream reductions and other thinks like that
2023-03-30 01:26:38
it lets you maintain the checked exception nature
zamfofex
2023-03-30 01:27:09
Is there any reason to want to โ€œmaintain the checked exception natureโ€?
Traneptora
2023-03-30 01:27:20
if you don't it defeats the entire reason checked exceptions exist
2023-03-30 01:28:53
also you can always send pull requests to the github repo it's hosted on
zamfofex
Traneptora if you don't it defeats the entire reason checked exceptions exist
2023-03-30 01:29:46
But wasnโ€™t its purpose to circumvent the checks? Otherwise you could just `throw` the exceptions normally.
Traneptora also you can always send pull requests to the github repo it's hosted on
2023-03-30 01:31:14
Yes, but then everyone can see it! ๐Ÿ˜ณ
Traneptora
But wasnโ€™t its purpose to circumvent the checks? Otherwise you could just `throw` the exceptions normally.
2023-03-30 05:10:13
only for functional interfaces. so if I have a function which creates a stream and iterates on it, then I still want the function to have a meaningful Throws clause
zamfofex
2023-03-30 05:15:02
Ah, I see. I feel like a sensible solution might be to use type parameters for functions. It feels strange to just throw checked exceptions in an unchecked way, even for functions and futures, because the function can end up being called somewhere else altogether, and itโ€™s up to you to make sure that they are called in the correct place.
Jyrki Alakuijala
afed what does color quantization bring for decoding? https://github.com/libjxl/libjxl/pull/2342
2023-04-03 01:46:19
api compatibility -- someone added it in libjpeg and now if you want to build a compatible library you need to support such things
2023-04-03 01:47:27
discretizing to 8 bit color might have reduced memory needs at some stage (1995 or so)
2023-04-03 01:47:45
it may still be used by some jpeg-to-gif conversion tool
monad
2023-04-04 07:51:57
cjxl cannot handle a 42458x38011 pixel PNG? `JPEG XL encoder v0.9.0 6d38e955 [AVX2,SSE4,SSSE3,SSE2] lib/extras/dec/apng.cc:467: JXL_CHECK: frame->rows[row_num] < frame->pixels.data() + frame->pixels.size() Illegal instruction (core dumped)`
_wb_
2023-04-04 07:56:21
Weird. Is it using libpng? Maybe it is hitting some libpng limit and not checking for an error from libpng in the right way?
monad
2023-04-04 08:03:01
Yes, libpng
2023-04-04 08:20:13
turns out 32 GB is not enough RAM anyway
Traneptora
monad cjxl cannot handle a 42458x38011 pixel PNG? `JPEG XL encoder v0.9.0 6d38e955 [AVX2,SSE4,SSSE3,SSE2] lib/extras/dec/apng.cc:467: JXL_CHECK: frame->rows[row_num] < frame->pixels.data() + frame->pixels.size() Illegal instruction (core dumped)`
2023-04-04 08:27:16
out of curiosity, does it work with hydrium?
2023-04-04 08:27:34
I'm wondering if lodepng can fit that PNG buffer inside your RAM
monad
2023-04-04 08:35:53
Well, I ran out of RAM after reverting to 8bb9d6ec. Seemed decode was going fine except for libjxls huge buffers.
Traneptora out of curiosity, does it work with hydrium?
2023-04-04 08:36:20
`libhydrium version 0.2.2 ./hydrium: error reading PNG file Total libhydrium heap memory: 0 bytes Max libhydrium heap memory: 0 bytes`
2023-04-04 08:38:13
Used less than 40% RAM before bailing.
Traneptora
2023-04-04 08:50:03
that means lodepng failed
2023-04-04 08:50:05
unfortunate
2023-04-04 09:26:22
I should roll my own PNG decoder that can do one Nx256 thing at once
zamfofex
2023-04-04 09:32:45
Maybe it could be worthwhile to try `stb-image`.
Traneptora
2023-04-04 09:33:40
what's stb-image?
zamfofex
2023-04-04 09:35:43
See: <https://github.com/nothings/stb>
Traneptora
2023-04-04 09:48:34
8k LOC?
2023-04-04 09:49:07
seems like I could do my own zlib-based decoder for less
zamfofex
2023-04-04 09:51:58
I see! Well, go for it, then! Though I will note that it includes its own gzip decoder, as well as support for image formats other than PNG.
Traneptora
2023-04-04 09:52:52
I have no need for that tho
zamfofex
2023-04-04 10:11:19
Thatโ€™s fair. I was just justifying the number of lines, is all. Besides, I was just wondering whether it would be enough to overcome the image size issues. (I think it will intentionally limit the image dimensions by default, but I think you can customise it with macros.)
Traneptora
2023-04-04 10:40:09
It might be worth it to use lodepng for zlib and just brew a png decoder that decodes Nx256 at a time
2023-04-04 10:41:14
One potential issue is one of colorspaces
2023-04-04 10:41:30
id rather not have a whole cms library all over again
2023-04-04 10:42:31
and how much of this code should be in the library and how much should be in the frontend
Demez
2023-04-05 05:03:11
I'm not a fan of stb image personally
2023-04-05 05:03:30
I would suggest spng, but it can't do animated pngs
Traneptora
2023-04-05 07:25:20
oh, that's a good suggestion, this is a nice API
monad `libhydrium version 0.2.2 ./hydrium: error reading PNG file Total libhydrium heap memory: 0 bytes Max libhydrium heap memory: 0 bytes`
2023-04-05 09:56:40
try now. I switched to using spng, which loads PNGs progressively
monad
2023-04-05 03:23:18
worked
2023-04-05 03:24:49
only problem is nothing can decode the jxl, and there's probably not enough time in the lifespan of the universe anyway
2023-04-05 03:26:38
(decode with my memory constraint)
Traneptora
monad (decode with my memory constraint)
2023-04-05 03:32:27
what's your memory constraint?
monad
2023-04-05 03:33:31
32 GB overall
Traneptora
2023-04-05 03:34:03
I feel like libjxl *should* be able to do that
2023-04-05 03:34:12
what about jxlatte?
monad
2023-04-05 03:34:22
nope
Traneptora
2023-04-05 03:34:45
jxlatte isn't very ram-friendly so that's not really a surprise
jonnyawsom3
2023-04-05 03:43:34
In my experience the JXL decode wasn't any bigger than the original PNG, but maybe that changes at such large sizes
monad
2023-04-05 04:39:10
libjxl is quite memory-hungry. But decoding a hydrium encoding takes like 2x as much memory as a default cjxl encoding.
Traneptora
2023-04-05 06:55:06
hm, that's intetesting
_wb_
2023-04-05 06:57:22
Probably the frame blending being implemented in a naive way
Traneptora
2023-04-05 08:05:21
I wonder how libjxl tiny handles it
monad
2023-04-06 07:01:13
why did you make a tree that big if you were just going to complain ```JPEG XL encoder v0.9.0 6d38e955 [AVX2,SSE4,SSSE3,SSE2] Read 21888x14592 image, 394324866 bytes, 184.2 MP/s Encoding [Modular, lossless, effort: 7], lib/jxl/modular/encoding/enc_ma.cc:987: JXL_ASSERT: tree.size() <= kMaxTreeSize Command terminated by signal 4 1068.98user 1808.18system 47:02.95elapsed 101%CPU (0avgtext+0avgdata 30146864maxresident)k 772592inputs+0outputs (17major+2340192864minor)pagefaults 0swaps```
gameplayer55055
2023-04-06 07:30:10
101%CPU?
monad
2023-04-06 07:35:55
was trying out one of those multi-core processors
2023-04-06 07:36:48
apparently useless
DZgas ะ–
2023-04-06 09:07:34
320 megapixel ๐Ÿ™‚
gameplayer55055
DZgas ะ– 320 megapixel ๐Ÿ™‚
2023-04-06 09:08:12
market's dream
DZgas ะ–
gameplayer55055 market's dream
2023-04-06 09:09:14
320 megapixel ๐Ÿ™‚ effort: 7
gameplayer55055
DZgas ะ– 320 megapixel ๐Ÿ™‚ effort: 7
2023-04-06 09:10:19
idea: announce JXL has built in AI that doubles megapixels and makes iPhone shoot better photos then see how AVIF dies
DZgas ะ–
monad why did you make a tree that big if you were just going to complain ```JPEG XL encoder v0.9.0 6d38e955 [AVX2,SSE4,SSSE3,SSE2] Read 21888x14592 image, 394324866 bytes, 184.2 MP/s Encoding [Modular, lossless, effort: 7], lib/jxl/modular/encoding/enc_ma.cc:987: JXL_ASSERT: tree.size() <= kMaxTreeSize Command terminated by signal 4 1068.98user 1808.18system 47:02.95elapsed 101%CPU (0avgtext+0avgdata 30146864maxresident)k 772592inputs+0outputs (17major+2340192864minor)pagefaults 0swaps```
2023-04-06 09:10:23
try other lower effort options, start with e 1 and see if it works
_wb_
monad why did you make a tree that big if you were just going to complain ```JPEG XL encoder v0.9.0 6d38e955 [AVX2,SSE4,SSSE3,SSE2] Read 21888x14592 image, 394324866 bytes, 184.2 MP/s Encoding [Modular, lossless, effort: 7], lib/jxl/modular/encoding/enc_ma.cc:987: JXL_ASSERT: tree.size() <= kMaxTreeSize Command terminated by signal 4 1068.98user 1808.18system 47:02.95elapsed 101%CPU (0avgtext+0avgdata 30146864maxresident)k 772592inputs+0outputs (17major+2340192864minor)pagefaults 0swaps```
2023-04-06 11:03:29
Could you open an issue for that? Indeed silly that it creates a tree that is too large.
monad
DZgas ะ– try other lower effort options, start with e 1 and see if it works
2023-04-07 06:42:57
Surely this error is only possible at e4+ where there is MA tree learning. Anyway, e5 worked, just didn't compress better than the PNG.
Traneptora
2023-04-09 04:15:07
djxl writes cICP and iCCP for srgb output pngs, instead of sRGB
2023-04-09 04:15:17
is there a reason for this?
_wb_
2023-04-09 05:02:54
Probably it just does that for all enum spaces that can be represented with cICP? Writing sRGB is probably better for interop though...
spider-mario
2023-04-09 08:28:02
instead of? Iโ€™d have thought weโ€™d write both
ayumi
2023-04-09 09:05:41
W3Cโ€™s version of the PNG specification (which I think introduced the `cICP` chunk), recommends against including both `cICP` and `sRGB` chunks in the same file. Also, it states that if a decoder encounters a file with both `cICP` and `sRGB`/`iCCP`/`gAMA`/`cHRM` chunks, it only supposed to take the `cICP` chunk into account.
veluca
2023-04-09 09:10:24
I don't see any such recommendation to not include sRGB if cICP is present in the cICP section ๐Ÿ™‚
2023-04-09 09:11:09
(then again, that specification also allows you to do horrible things such as limited range RGB images, which I do not want to see ever)
2023-04-09 09:11:58
in general having cICP and also other stuff is a good idea, b/c as far as I can tell only Chrome supports cICP in PNG for real
ayumi
veluca I don't see any such recommendation to not include sRGB if cICP is present in the cICP section ๐Ÿ™‚
2023-04-09 09:21:31
True, I guess they forgot to write it there. After all both the `sRGB` section (https://w3c.github.io/PNG-spec/#srgb-standard-colour-space) and the chunk ordering constraints (https://w3c.github.io/PNG-spec/#table53) do include notes about this.
veluca
2023-04-09 09:26:50
it only talks about iCCP and sRGB ๐Ÿ™‚
2023-04-09 09:27:41
although arguably if you have cICP it's not too different from if you have iCCP
ayumi
2023-04-09 09:29:08
Ohhh... I misread it as `cICP`. Sorry.
Traneptora
2023-04-09 11:07:18
I guess an srgb ICC Profile inside iCCP is just as good as sRGB?
improver
2023-04-09 11:24:40
as good for what? likely not size
_wb_
2023-04-10 06:34:35
I suppose there exists software that: - ignores any colorspace info - only understands gAMA/cHRM - applied gAMA but not cHRM - only understands sRGB/gAMA/cHRM - applies iCCP but not gAMA/cHRM - understands anything except cICP - understands everything
Traneptora
2023-04-10 08:59:03
I'm just wondering what software respects the iCCP tag but not the sRGB tag
2023-04-10 08:59:15
other than imagemagick, before that bug was fixed
DZgas ะ–
DZgas ะ– there are no chats where it can be drop it, so I drop it here. my cjxl build for windows pre pull/2252 fix -- 7e5b5065c5b6f5f1d5b76fea56ec51ade81da06b -- with an appended code for 8 layers of progressive decoding
2023-04-11 03:55:02
The same source code but in 1 executable file and works 10% faster
2023-04-12 11:44:13
Minor fixes of the build above ๐Ÿ‘† The build was without a jpeg decoder, now it is available for transcoding. Fixed the shortcomings of which version it is, due to the fact that it was decided to take all the sources from scratch and make One file change, everything else untouched. Uses latest versions of libpng 1.6.39 zlib 1.2.13
username
2023-04-12 11:46:41
speed could be slightly better maybe if zlib-ng was used instead of normal zlib, zlib-ng has a compatibility mode to work with programs that just use the normal zlib api
2023-04-12 11:47:45
not sure how much work to switch it out even with zlib-ng having a compatibility mode
yoochan
2023-06-10 12:24:52
I tried to jpegli a scan I did ... and it fails
2023-06-10 12:24:59
```Read 2435x2768 image, 13813083 bytes. Encoding [YUV d1.000 AQ p2 OPT] jpegli encoding failed ```
2023-06-10 12:26:08
I would like to know if I can ask jpeli to tell me more on its failure ...
2023-06-10 12:27:20
here is a link https://drive.google.com/file/d/1Wa41uJsW-EATWUoJGrmerYLqcDCjyDG7/view?usp=sharing if someone has an idea
Tirr
2023-06-10 12:32:29
iirc cjpegli fails if input png has alpha channel
yoochan
2023-06-10 12:32:54
oh really ! I check that
2023-06-10 12:34:36
well well, I'll have to batch strip the alpha channel then
Anroh
2023-06-10 12:51:47
hi i want to reproduce results of the FastGaussian from jxl/gauss_blur.h in ssimulacra2 the closest i currently get is: ```python from scipy.ndimage.filters import gaussian_filter blurred = gaussian_filter(image, sigma=1.5, mode="constant",cval=0)``` but there are cases in which the results are not the same. How can that be?
_wb_
2023-06-10 01:17:16
No idea but it probably doesn't matter that much as long as it's a reasonable approximation of gaussian blurring. Maybe you treat the edges differently?
Anroh
2023-06-10 01:22:17
I treat the edges as 0 padding. Somewhere in the code i saw a comment which says padding is "reflect" but this is certainly not the case
2023-06-10 01:23:29
for my testing image the different gauรŸ blurs change the core from 18 (original) to 49(my perfect gauรŸ blur)
_wb_
2023-06-10 01:38:01
Maybe try an image with just a single white pixel on a black background as input. Could be the sigma is not scaled the same way or something...
Anroh
2023-06-12 08:29:56
mhm it has to be something different....
2023-06-12 08:31:19
I used blurred a image like this (but bigger) ``` 0 0 0 0 1 0 0 0 0 ``` and used the output as kernel for 2d convolution and the results still differ<:PepeHands:808829977608323112>
joppuyo
2023-06-12 10:26:31
I got inspired by Apple's jxl announcement and updated my JPEG XL PHP library with the latest binaries and added a new option to use the jxl system binary from the system PATH instead of the bundled static binaries ๐Ÿ™‚ https://github.com/joppuyo/jpeg-xl-encode
2023-06-12 10:27:24
my aim is to provide a JPEG XL library that works out of the box in any PHP project and provides a simplified API for the most common use cases
yoochan
Anroh I used blurred a image like this (but bigger) ``` 0 0 0 0 1 0 0 0 0 ``` and used the output as kernel for 2d convolution and the results still differ<:PepeHands:808829977608323112>
2023-06-12 02:25:09
can you show the difference ?
Anroh
2023-06-12 02:29:52
mu1 is unblurred. sigma1_sq is blurred with the fast gaussian. diff ist the reshaped 1st plane of the difference between that scipy blur and sigma1_sq. In the first to file the format is [XXXX.... YYYY.... BBBB...]
yoochan
2023-06-12 02:30:28
I though of something more... visual, like a picture
Anroh
2023-06-12 02:30:45
Oh then no
_wb_
2023-06-12 02:41:32
looks to me like fast gaussian is doing mirroring at the edges while you're padding with zeroes?
Anroh
Anroh I treat the edges as 0 padding. Somewhere in the code i saw a comment which says padding is "reflect" but this is certainly not the case
2023-06-12 02:43:22
no the fast gaussian is 100% padding with zeros. But now i think my error is somewhere else in my processing pipeline.
2023-06-12 02:46:24
because the first plane is acually correct. but the second and third is not<:monkaMega:809252622900789269>
2023-06-12 03:29:32
okay looks like my gauรŸblur is fine. Sorry
_wb_
2023-06-12 03:42:32
if it's padding with zeroes how can the top left corner of the blurred image not be closer to zero?
Anroh
2023-06-12 03:48:21
The files i sent are wrong. I made a mistake in exporting them
2023-06-12 03:48:31
padding is with zeros
monad
2023-06-21 07:33:48
Someone please help me understand how it's user friendly to turn djxl help into an RPG. I have to level up three times to access all my abilities, and between level two and three I gain a whopping three perks.
2023-06-21 07:35:20
I truly can't imagine a situation where I'd want to see more than the basic options, but not all options, and this just makes me type more.
yoochan
2023-06-21 09:40:50
indeed, it could be essential (level 1) and all (level 2)
_wb_
2023-06-21 10:28:41
I guess 4 levels is indeed unnecessary. I think 3 is useful though: basic, advanced, and "only useful for stuff like conformance testing and benchmarking"
jonnyawsom3
2023-06-21 12:48:10
Yeah, 3 and maybe eventual reordering based on what's used most
monad
2023-06-21 05:32:03
Currently, it's a mystery what's behind those extra levels, so if your goal is understanding what the tool offers, you simply must pay the typing tax. While it's very common to have a short help and long help, the way the libjxl tools make you work for the documentation is exceedingly rare (no comparable tool comes to mind). The mental model required to associate a certain verbosity level with some granular level of utility is not straightforward (Do I need two or three `-v`s to see everything? I'll just add a bunch.) If you step through each level one by one, the latest options are mixed in with the prior options, so you have to parse through everything again anyway. There aren't enough options that presenting everything at once should be overwhelming, especially for djxl.
2023-06-21 05:36:48
If the distinction between the kind of utility behind each level can be efficiently and effectively communicated, it may mitigate some frustration. IMO, such distinction between options would be made much more accessible as separate sections with headers in one long help, assuming there's flexibility to do that.
derberg๐Ÿ›˜
monad Someone please help me understand how it's user friendly to turn djxl help into an RPG. I have to level up three times to access all my abilities, and between level two and three I gain a whopping three perks.
2023-06-21 06:21:52
**The Quest for djxl mastery: An RPG adventure** You find yourself in the mystical land of JXL, where powerful mages and warriors roam. Rumors spread about a legendary artifact known as the djxl Decoder, said to possess unimaginable abilities. Determined to unlock its secrets, you embark on a perilous journey as a novice adventurer. Your goal is to become a master of djxl, harnessing its power to bring balance to the realm. **Chapter 1: The call to adventure** As the sun rises, you awaken in a humble cottage on the outskirts of the peaceful village of Pixelfield. A mysterious letter arrives, summoning you to the Grand Academy of JXL. Eager to discover your destiny, you set out on a path that will lead you to unimaginable challenges and triumphs. _What is your character's name?_
_wb_
2023-06-21 07:11:56
Let's make the interface so you first have to slay a few goblins before it will write the output to file
jonnyawsom3
2023-06-21 07:13:14
For every kill you gain 1 bit depth
spider-mario
monad Currently, it's a mystery what's behind those extra levels, so if your goal is understanding what the tool offers, you simply must pay the typing tax. While it's very common to have a short help and long help, the way the libjxl tools make you work for the documentation is exceedingly rare (no comparable tool comes to mind). The mental model required to associate a certain verbosity level with some granular level of utility is not straightforward (Do I need two or three `-v`s to see everything? I'll just add a bunch.) If you step through each level one by one, the latest options are mixed in with the prior options, so you have to parse through everything again anyway. There aren't enough options that presenting everything at once should be overwhelming, especially for djxl.
2023-06-21 07:23:07
one comparable tool does come to mindย โ€“ย ffmpeg: ``` usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Getting help: -h -- print basic options -h long -- print more options -h full -- print all options (including all format and codec specific options, very long) ```
monad
2023-06-21 07:36:44
Maybe it would be comparable if ffmpeg required about 1000 -h flags to see everything.
derberg๐Ÿ›˜
_wb_ Let's make the interface so you first have to slay a few goblins before it will write the output to file
2023-06-21 07:43:53
April release <:PepeOK:805388754545934396>
_wb_
monad If the distinction between the kind of utility behind each level can be efficiently and effectively communicated, it may mitigate some frustration. IMO, such distinction between options would be made much more accessible as separate sections with headers in one long help, assuming there's flexibility to do that.
2023-06-22 08:08:40
tried to do something like that: https://github.com/libjxl/libjxl/pull/2593
monad
2023-06-22 09:46:32
I see where this is going, so I made my own solution.
Quackdoc
2023-06-22 09:53:50
-v / -vv would be much nicer
Tirr
2023-06-22 09:54:34
iirc -vv doesn't work for cjxl and djxl
Quackdoc
2023-06-22 09:56:16
it would be nice if it did since it's fairly standard to support both
_wb_
monad I see where this is going, so I made my own solution.
2023-06-22 10:16:38
`$ cjxlh | head -n 20`
jonnyawsom3
2023-06-22 10:22:34
Have a separate executable per option that opens a window to display the text
derberg๐Ÿ›˜
_wb_ tried to do something like that: https://github.com/libjxl/libjxl/pull/2593
2023-06-22 04:47:39
"Expert options:" "--allow_expert_options" Hmmmmm
monad
2023-06-22 11:59:09
1.0 version milestone
VcSaJen
2023-06-23 10:23:32
yoochan
2023-06-23 12:58:00
and half derivative https://www.youtube.com/watch?v=2dwQUUDt5Is
Kampidh
2023-06-30 11:40:54
suddenly made myself a glorified batch command~ https://github.com/kampidh/jxl-batch-converter
fab
Kampidh suddenly made myself a glorified batch command~ https://github.com/kampidh/jxl-batch-converter
2023-06-30 12:31:36
Add you to Wikipedia En
190n
2023-06-30 07:20:18
https://media.discordapp.net/attachments/808741974596517928/1124417739340128277/Screenshot_from_2023-06-30_12-14-19.png
2023-06-30 07:20:22
progress
jonnyawsom3
2023-06-30 07:22:55
Then it turns out it was just a coincidental hash clash
spider-mario
2023-06-30 09:48:36
three months later: > In this article, we present a method to efficiently generate SHA-1 collisions with the JPEG files that should be reconstructed from JPEG XL codestreams.
jonnyawsom3
2023-06-30 10:49:25
> To improve adoption of JpegXL, we now use the .jpg extension and embed a decoder inside the header data of a normal jpeg file
Torvid
> To improve adoption of JpegXL, we now use the .jpg extension and embed a decoder inside the header data of a normal jpeg file
2023-07-08 08:46:56
if only OG jpeg was turning complete
yoochan
Torvid if only OG jpeg was turning complete
2023-07-08 09:21:15
Like a U turn?
Torvid
2023-07-08 09:55:10
XD yeah typo
pandakekok9
joppuyo I got inspired by Apple's jxl announcement and updated my JPEG XL PHP library with the latest binaries and added a new option to use the jxl system binary from the system PATH instead of the bundled static binaries ๐Ÿ™‚ https://github.com/joppuyo/jpeg-xl-encode
2023-07-12 12:55:24
Ooooh, I was going to ask if there's a PHP solution for compressing JPEG/PNG/GIF and decompressing on-the-fly JPEG XL images, and looks like there's one for the compress stage, very nice!
2023-07-12 01:02:10
I wonder if there's one for decoding to JPEG/PNG though. My usecase is a reddit-like link aggregator, and we want to store all our user-submitted images as JPEG-XL, and still serve them as JPEG or PNG, whichever is better
2023-07-12 01:02:51
This is the project if you're curious: https://gitlab.com/postmill/Postmill
2023-07-12 01:03:19
(Ignore the archived repo warning btw, not important)
joppuyo
pandakekok9 I wonder if there's one for decoding to JPEG/PNG though. My usecase is a reddit-like link aggregator, and we want to store all our user-submitted images as JPEG-XL, and still serve them as JPEG or PNG, whichever is better
2023-07-12 01:04:20
Thereโ€™s no reason why the code could not be adapted to do that
w
2023-07-12 01:04:49
libjxl only decodes to jpeg (if supported) and pixels
2023-07-12 01:04:54
you would want to encode it separately
joppuyo
2023-07-12 01:06:43
The library doesnโ€™t use libjxl directly, it wraps cjxl binary (a static one or one from the system PATH), imagemagick and vips into one interface
w
2023-07-12 01:08:03
if you want to serve images you can always use a cdn
2023-07-12 01:08:05
like cloudinary
2023-07-12 01:10:23
on the fly server side decoding and encoding is just so computationally expensive
pandakekok9
2023-07-12 01:11:07
I see, thanks for the responses! I might take a look at the code later (tho I don't really work on PHP, I'm just here because I'm looking for options the developer of the link aggregator I participate in could make use of). I will also see if Cloudinary's CDN could be an option for the Raddle admin, though I suspect they will be going with AWS S3, IIRC
w
2023-07-12 01:12:24
there's also my jxl proxy <https://embed.moe/> which decodes and encodes to supported requested format
pandakekok9
2023-07-12 01:13:32
Yeah, but I don't want to freeload off of it :P
w
2023-07-12 01:14:01
oh I mean just as an example to see how it's done
pandakekok9
2023-07-12 01:32:53
ah ok lol
jonnyawsom3
2023-07-14 01:55:36
Found this at the bottom of a reddit thread, supports JXL oddly enough https://github.com/ermig1979/AntiDupl CLI Version https://github.com/ermig1979/AntiDuplX
Traneptora
2023-07-14 11:05:49
huh I wonder if there's a CLI equivalent
diskorduser
2023-07-15 12:28:33
At the end of Readme: Command line tool AntiDuplX There is a command line tool AntiDuplX to search simular and damaged images. This is standalon project which uses similar algorithm of image comparison. It works for Linux and Windows.
Traneptora
2023-07-15 01:55:14
huh
jonnyawsom3
2023-07-15 01:58:24
Added the CLI link to my message if anyone wants it
Traneptora
2023-07-15 08:43:50
if anyone wants to use or take a look at the PNG thingy I threw together, it's here
2023-07-15 08:43:55
https://github.com/Traneptora/umbrielpng/
jimmac
2023-08-03 07:11:15
Hi. cjxl claims to support EXR, but so far I've gotten "Getting pixel data failed." and couldn't fish out any specifics
2023-08-03 07:14:53
cjxl v0.8.2 from fedora rawhide/39
2023-08-03 07:15:23
it claims to support EXR when listing with --help
2023-08-03 07:21:06
oh. bummer
2023-08-03 07:21:16
thank you, nevertheless
Sayfer Kopak
2023-08-13 07:32:41
Hi. Can anyone modify this conversion script so that it exits after the loop ends? The first version of this script was written by Traneptora, then I used ChatGPT to improve and add two new features. But I ran into a problem that I could not solve, and AI only offers some nonsense that does not work. `@echo off & for /R %i in (*.jpg) do (C:\My\Programs\libjxl\cjxl.exe "%i" --lossless_jpeg=1 --brotli_effort=11 --quiet -d 0 -e 9 "%~dpi%~ni.jxl" & if exist "%~dpi%~ni.jxl" (echo SUCCESS "%~dpi%~ni.jxl" & del /f /q "%i") else (echo FAIL "%~dpi%~ni.jxl"))`
Oleksii Matiash
Sayfer Kopak Hi. Can anyone modify this conversion script so that it exits after the loop ends? The first version of this script was written by Traneptora, then I used ChatGPT to improve and add two new features. But I ran into a problem that I could not solve, and AI only offers some nonsense that does not work. `@echo off & for /R %i in (*.jpg) do (C:\My\Programs\libjxl\cjxl.exe "%i" --lossless_jpeg=1 --brotli_effort=11 --quiet -d 0 -e 9 "%~dpi%~ni.jxl" & if exist "%~dpi%~ni.jxl" (echo SUCCESS "%~dpi%~ni.jxl" & del /f /q "%i") else (echo FAIL "%~dpi%~ni.jxl"))`
2023-08-13 08:03:33
Is python not an option for you? I mean - only bat file, or python is ok too?
Sayfer Kopak
Oleksii Matiash Is python not an option for you? I mean - only bat file, or python is ok too?
2023-08-13 08:16:46
Perhaps this option is also suitable. However, I do not know this programming language. I need the simplest and most convenient way so that I don't have to modify the script file every time. At the moment, I open a command prompt in the desired folder and copy this script there, after which I just press Enter.
Oleksii Matiash
Sayfer Kopak Perhaps this option is also suitable. However, I do not know this programming language. I need the simplest and most convenient way so that I don't have to modify the script file every time. At the moment, I open a command prompt in the desired folder and copy this script there, after which I just press Enter.
2023-08-13 08:27:27
I mean I can write it if you tell me what it should do
Sayfer Kopak
Oleksii Matiash I mean I can write it if you tell me what it should do
2023-08-13 08:41:01
Oh thanks. 1. Search for all files with the JPG extension, starting from the current folder from which the script is launched and in all subfolders. 2. When a file is found, check if a file with the same name and extension JXL already exists. If it exists, then it should be skipped. 3. Otherwise, need to try to convert. 4. One more check if there is a file with this name and JXL extension. This is necessary to check if the conversion was successful. If yes, show the inscription "SUCCESS", as well as the path to the file and the name. The original file must be deleted (preferably in the Recycle Bin), even despite the "read-only" attribute. (By the way, the AI was unable to advise how to remove to Recycle Bin). 5. If not, show the inscription "FAIL", as well as the path to the file and the name. 6. When the cycle is completed, need to give a sound signal and show a list of files that could not be converted.
Traneptora
Sayfer Kopak Hi. Can anyone modify this conversion script so that it exits after the loop ends? The first version of this script was written by Traneptora, then I used ChatGPT to improve and add two new features. But I ran into a problem that I could not solve, and AI only offers some nonsense that does not work. `@echo off & for /R %i in (*.jpg) do (C:\My\Programs\libjxl\cjxl.exe "%i" --lossless_jpeg=1 --brotli_effort=11 --quiet -d 0 -e 9 "%~dpi%~ni.jxl" & if exist "%~dpi%~ni.jxl" (echo SUCCESS "%~dpi%~ni.jxl" & del /f /q "%i") else (echo FAIL "%~dpi%~ni.jxl"))`
2023-08-14 12:53:00
I don't write batch files
2023-08-14 12:59:18
so I don't recall writing anything like that
Sayfer Kopak Oh thanks. 1. Search for all files with the JPG extension, starting from the current folder from which the script is launched and in all subfolders. 2. When a file is found, check if a file with the same name and extension JXL already exists. If it exists, then it should be skipped. 3. Otherwise, need to try to convert. 4. One more check if there is a file with this name and JXL extension. This is necessary to check if the conversion was successful. If yes, show the inscription "SUCCESS", as well as the path to the file and the name. The original file must be deleted (preferably in the Recycle Bin), even despite the "read-only" attribute. (By the way, the AI was unable to advise how to remove to Recycle Bin). 5. If not, show the inscription "FAIL", as well as the path to the file and the name. 6. When the cycle is completed, need to give a sound signal and show a list of files that could not be converted.
2023-08-14 01:05:01
```bash while read -r -d '' line; do jxl="${line%.jpg}.jxl" if [ -e "$jxl" ] ; then continue; fi cjxl --lossless_jpeg=1 --brotli_effort=11 --quiet -d 0 -e 9 "$line" "$jxl" if ! [ "$?" = "0" ] ; then printf 'Failure: %s\n' "$line" else cp -a --attributes-only -- "$line" "$jxl" rm -vf -- "$line" fi done <(find . -name '*.jpg' -print0) ```
2023-08-14 01:05:08
this is in *bash*
Sayfer Kopak
Traneptora ```bash while read -r -d '' line; do jxl="${line%.jpg}.jxl" if [ -e "$jxl" ] ; then continue; fi cjxl --lossless_jpeg=1 --brotli_effort=11 --quiet -d 0 -e 9 "$line" "$jxl" if ! [ "$?" = "0" ] ; then printf 'Failure: %s\n' "$line" else cp -a --attributes-only -- "$line" "$jxl" rm -vf -- "$line" fi done <(find . -name '*.jpg' -print0) ```
2023-08-14 05:39:53
Oops, indeed, I confused you with jonnyawsom3, thanks anyway. Hmm, it looks like this script is for Linux, I'll try to get ChatGPT to convert it to Windows.
Traneptora
2023-08-14 05:43:05
Don't do that
Sayfer Kopak
2023-08-14 05:46:53
Why? Do you suggest installing Linux specifically for this task? But this contradicts the idea of maximally simplifying the entire process.
Traneptora
2023-08-14 05:47:13
No, I suggest you don't run code that's generated by a transformer
Sayfer Kopak
2023-08-14 05:49:08
Ah, this. Of course, I understand and always test on a separate folder first, and also carefully read the description of the commands. I would not have been able to achieve the previous result if I had not been attentive.
Traneptora
2023-08-14 05:52:15
If you know what things do just write teh code yourself
2023-08-14 05:52:19
if you don't know what things do don't run them
Quackdoc
2023-08-14 06:08:20
using gpt scripts is sketchy, sometimes ill use it to generate boilerplate, but thats about it
2023-08-14 06:16:18
or when you ask a chatgpt how to clean .trash and it gives you `rm -rf /home/$USER`
Sayfer Kopak
Traneptora ```bash while read -r -d '' line; do jxl="${line%.jpg}.jxl" if [ -e "$jxl" ] ; then continue; fi cjxl --lossless_jpeg=1 --brotli_effort=11 --quiet -d 0 -e 9 "$line" "$jxl" if ! [ "$?" = "0" ] ; then printf 'Failure: %s\n' "$line" else cp -a --attributes-only -- "$line" "$jxl" rm -vf -- "$line" fi done <(find . -name '*.jpg' -print0) ```
2023-08-14 06:29:43
Tell me, why do you think that the encoder is capable of issuing any return codes? When I and the AI previously tried to check the success of the conversion, it did not issue any codes at all. `if ! [ "$?" = "0" ] ; then printf 'Failure: %s\n' "$line"`
Traneptora
Sayfer Kopak Tell me, why do you think that the encoder is capable of issuing any return codes? When I and the AI previously tried to check the success of the conversion, it did not issue any codes at all. `if ! [ "$?" = "0" ] ; then printf 'Failure: %s\n' "$line"`
2023-08-14 06:32:11
because every process that exits always has a return code
2023-08-14 06:33:32
whether or not it exits gracefully
2023-08-14 06:33:57
I don't actually care what ChatGPT thinks, since ChatGPT is not a programmer, doesn't think, or understand code.
2023-08-14 06:34:42
If you're asking me why I'm disagreeing with ChatGPT a better question is why ChatGPT is disagreeing with a programmer.
Sayfer Kopak
2023-08-14 06:39:11
Here is the script that uses the return codes, but even if I specifically gave the wrong files (with the JPG extension), it always showed the success of the conversion. `for /R %i in (*.jpg) do (C:\My\Programs\libjxl\cjxl.exe "%i" -d 0 -e 9 "%~dpi%~ni.jxl" & if %errorlevel% == 0 echo Conversion successful! & if not %errorlevel% == 0 echo Conversion failed!)`
Traneptora
2023-08-14 06:40:48
I have no idea how this works in Batch
2023-08-14 06:41:00
well, I can gander a guess
2023-08-14 06:41:14
You're not using *else* you're just issuing another if command
2023-08-14 06:41:34
so if I had to guess, `if %errorlevel == 0` is its own command
2023-08-14 06:41:50
and the comparison succeeded, even if `%errorlevel%` was nonzero.
2023-08-14 06:42:08
since the test condition was false, but the == check itself succeeded.
2023-08-14 06:42:19
So when you check it again immediately, it'll be 0, even if it was nonzero from cjxl.
2023-08-14 06:42:51
this is just a guess, as again I'm unfamiliar with Batch
spider-mario
2023-08-14 08:38:34
you can use bash on windows, if you install either git or msys2
Oleksii Matiash
Sayfer Kopak Oh thanks. 1. Search for all files with the JPG extension, starting from the current folder from which the script is launched and in all subfolders. 2. When a file is found, check if a file with the same name and extension JXL already exists. If it exists, then it should be skipped. 3. Otherwise, need to try to convert. 4. One more check if there is a file with this name and JXL extension. This is necessary to check if the conversion was successful. If yes, show the inscription "SUCCESS", as well as the path to the file and the name. The original file must be deleted (preferably in the Recycle Bin), even despite the "read-only" attribute. (By the way, the AI was unable to advise how to remove to Recycle Bin). 5. If not, show the inscription "FAIL", as well as the path to the file and the name. 6. When the cycle is completed, need to give a sound signal and show a list of files that could not be converted.
2023-08-14 05:31:03
To delete to RecycleBin you need to *pip install send2trash*, otherwise it will delete jpgs permanently. Please test thoroughly before launching on real files
Sayfer Kopak
2023-08-14 06:58:29
Many thanks to everyone for the help.
yoochan
2023-08-21 03:08:08
I stumbled upon https://docs.google.com/spreadsheets/d/1ju4q1WkaXT7WoxZINmQpf4ElgMD2VMlqeDN2DuZ6yJ8 again which encodes with -I 1 and -E 3 but looking at the --help -v -v -v (etc.) I couldn't find the meaning of these short options
_wb_
2023-08-21 04:07:41
-I 1 is now -I 100 and means 100% of the pixels is used for MA tree training (default is 50%, using more means using more memory and time but should give better results)
2023-08-21 04:08:47
-E 3 means using up to 3 previous channels in the MA tree properties, so e.g. for RGBA, the A channels can use R,G,B as context
yoochan
2023-08-21 05:28:37
Thanks!
monad
yoochan I stumbled upon https://docs.google.com/spreadsheets/d/1ju4q1WkaXT7WoxZINmQpf4ElgMD2VMlqeDN2DuZ6yJ8 again which encodes with -I 1 and -E 3 but looking at the --help -v -v -v (etc.) I couldn't find the meaning of these short options
2023-08-21 07:14:03
You have to use four `-v`s to see the useful options.
yoochan
2023-08-21 07:53:28
indeed ! I only used 3, my bad
Deleted User
2023-08-24 04:55:42
the one-liner i use to convert files. with parallel, all your cores are used `parallel ffmpeg -i {1} {1.}.{2} ::: *.png *.jpg *.jpeg ::: jxl`
2023-08-24 04:56:16
the filetypes are arbitrary, this turns the png and jpg files in a directory into jxl
Traneptora
2023-08-24 06:23:25
This won't losslessly transcode jpg to jxl
2023-08-24 06:24:02
it's going to decode them to pixels and re-encode the pixels to lossy jxl
2023-08-24 06:24:52
it's better to use cjxl for this as it automatically will work the way you want it to here
Deleted User
2023-08-24 08:25:03
thanks
2023-08-24 08:25:23
im not sure how ffmpeg sets the parameters by default
Traneptora
im not sure how ffmpeg sets the parameters by default
2023-08-24 08:36:29
you can view the defaults by doing `ffmpeg -h encoder=libjxl`
2023-08-24 08:36:46
although FFmpeg cannot losslessly transcode jpeg->jxl due to the nature of the pipeline
2023-08-24 08:37:02
you'd need a bitstream filter for that, and that hasn't been added (and likely will never be added)
Nova Aurora
Traneptora although FFmpeg cannot losslessly transcode jpeg->jxl due to the nature of the pipeline
2023-08-25 06:05:08
To be more clear, in order to losslessly recompress, cjxl has to have the actual JPEG file it's working with FFmpeg whan handling images decodes the file to pixels and passes that to the encoder (cjxl). cjxl is missing vital bitstream information to add in the reconstruction information
Traneptora
Nova Aurora To be more clear, in order to losslessly recompress, cjxl has to have the actual JPEG file it's working with FFmpeg whan handling images decodes the file to pixels and passes that to the encoder (cjxl). cjxl is missing vital bitstream information to add in the reconstruction information
2023-08-25 12:12:04
Yes I know this
Nova Aurora
2023-08-25 01:35:48
Accidentally pinged, was clarifying for []
uis
yoochan I stumbled upon https://docs.google.com/spreadsheets/d/1ju4q1WkaXT7WoxZINmQpf4ElgMD2VMlqeDN2DuZ6yJ8 again which encodes with -I 1 and -E 3 but looking at the --help -v -v -v (etc.) I couldn't find the meaning of these short options
2023-09-05 04:40:22
FLIF is better for NPR then JXL effort 7? I wonder how it would work on images from derpibooru.
_wb_
2023-09-05 04:57:00
NPR?
lonjil
2023-09-05 04:58:37
non-photo realistic, I assume
uis
2023-09-05 05:10:48
Art and FanArt categories
yoochan
uis FLIF is better for NPR then JXL effort 7? I wonder how it would work on images from derpibooru.
2023-09-06 09:02:43
yes, but JXL -e 9 -E 3 -I 100 still perform better than FLIF most of the time, if you want "encode once, serve many" type of archive, jpegxl rocks (and it is supported by safari :D)
_wb_
2023-09-06 10:26:42
I wonder how much these results change after the encoder tweaks that have been done since then.
uis
_wb_ I wonder how much these results change after the encoder tweaks that have been done since then.
2023-09-06 01:51:42
I hope it only gets better everywhere
Traneptora
uis Art and FanArt categories
2023-09-06 02:36:38
do note that synthetic images that are designed to look realistic, like art that's got good lighting, are closer to photorealistic than nonphotorealistic
jonnyawsom3
2023-09-06 03:02:03
Yeah, synthetic images are more based on content than purely being artificial
Jyrki Alakuijala
2023-09-07 07:11:12
FLIF is slower to encode, slower to decode and not parallel -- shouldn't be compared with jpeg xl effort 7
uis
Jyrki Alakuijala FLIF is slower to encode, slower to decode and not parallel -- shouldn't be compared with jpeg xl effort 7
2023-09-08 09:05:43
FLIF compared to effort 9. Or 8.
Jyrki Alakuijala
2023-09-11 11:49:44
still it should be slower to decode, and not parallel -- if made to tiles, it will compress less
_wb_
2023-09-11 01:06:47
there are also some differences like how it detects/orders palettes or how it learns MA trees where the FLIF methods are different from the libjxl methods โ€” and for some types of images maybe some of those encoder decisions are still better in FLIF
2023-09-11 01:07:21
we should probably port the palette ordering methods from lossless webp to jxl, I suspect they are the best
2023-09-11 01:07:43
for MA tree learning there are still a lot of things to try
bonnibel
2023-09-22 04:39:41
could the in-place butteraugli be used for butteraugli_main? i don't think it needs the original images in memory for anything after getting the score
Hello71
Traneptora you'd need a bitstream filter for that, and that hasn't been added (and likely will never be added)
2023-09-30 06:20:48
although that would be useful for losslessly converting motion jpeg to motion jpeg xl
Traneptora
Hello71 although that would be useful for losslessly converting motion jpeg to motion jpeg xl
2023-10-01 12:37:58
Not really, motion jxl has basically no use
_wb_
2023-10-01 12:18:35
Medical archives maybe...
jonnyawsom3
2023-10-01 03:14:42
I thought they meant animated JXL already fills that gap, although not being able to seek is an issue
_wb_
2023-10-01 06:51:15
There is a seek option if you use the optional frame index box. But it's still an intra only codec of course...
lonjil
2023-10-01 06:56:53
People use infra only codecs like FFV1, so I don't see why MJXL wouldn't have any use.
Quackdoc
2023-10-01 07:04:28
im curious as to whether or not there is a place for jxl in hardware recording things, it could be interesting I suppose, better then raw yuv422 capture anyway
2023-10-01 07:04:40
as for a mezzanine I think jxl has a lot of potential there
lonjil
2023-10-01 07:17:18
I believe Jon has mentioned that a company is developing a JXL HW encoder
_wb_
2023-10-01 07:29:00
Yeah, it will not be for anytime soon though, but yes this is one of the topics in the JPEG XL adhoc group within JPEG.
JendaLinda
2023-10-05 10:36:03
Writing Netpbm formats by djxl was recently improved but it's still somehow quirky. Specifically, the particular file extensions must be used for certain pixel formats. PPM accepts only RGB images, grayscale images are rejected and PGM must be used instead. PNM extension is not supported by djxl although that would cover both RGB and grayscale images. PAM accepts only images with alpha, images without alpha are rejected. That might be a bug because PAM can support both RGB and grayscale, with alpha or without alpha.
Cacodemon345
2023-10-05 10:39:01
Netpbm formats are frankly trash outside of legacy use cases.
JendaLinda
2023-10-05 10:47:28
They are the closest to raw pixels. As such they have their use. Once implemented in djxl, Netpbm formats should work reliably, not requiring trying all possible file extensions.
Jyrki Alakuijala
lonjil I believe Jon has mentioned that a company is developing a JXL HW encoder
2023-10-05 04:00:19
Zoltan created libjxltiny for this purpose -- to make it easier for hardware encoders. I'd recommend HW encoders to follow the approach implemented in libjxltiny.
uis FLIF compared to effort 9. Or 8.
2023-10-05 04:01:19
FLIF is still slower to decode than JPEG XL at -e 9 (or any), more dynamic probabilities/context modeling
bonnibel could the in-place butteraugli be used for butteraugli_main? i don't think it needs the original images in memory for anything after getting the score
2023-10-05 04:02:07
file an issue to libjxl ?
_wb_
JendaLinda They are the closest to raw pixels. As such they have their use. Once implemented in djxl, Netpbm formats should work reliably, not requiring trying all possible file extensions.
2023-10-05 05:04:08
Can you use `.pnm` ?
JendaLinda
_wb_ Can you use `.pnm` ?
2023-10-05 05:15:15
djxl does not accept .pnm >> can't decode to the file extension '.pnm' Attempting to decode RGB image to .pam gives a different error >> Decoded to pixels. >> Encode failed
_wb_
2023-10-05 05:18:27
Maybe open an issue for this, I think it would make sense to have .pnm as an output option for both color and grayscale. And also .pam should always work, not just when there is alpha...
JendaLinda
2023-10-05 05:19:06
Alright
2023-10-05 05:21:50
.pfm works for both color and grayscale, so .pnm should work as well.
_wb_
2023-10-05 07:42:06
Exactly.
2023-10-05 07:43:22
Tbh we should add Luca's fast PNG encoder and use that for djxl PNG output โ€” then there is no real reason anymore to use pnm imo...
2023-10-05 07:43:55
PNM having no colorspace info makes it not that practical imo
veluca
2023-10-05 08:02:19
I won't object ๐Ÿ˜›
dkam
2023-10-13 07:03:38
Hello - I'm interested in updating the ruby FastImage (https://github.com/sdsykes/fastimage) gem to support JXL. I can match the first few bytes ( "\xFF\x0A" )to detect the image type, but I was thinking I'd ask how you'd go about plucking out the width and height from a binary stream? Easy or hard?
2023-10-13 07:09:43
Also, can someone point me to a JXL file in the ISOBMFF format? I see that FastImage can identify AVIF and HEIC files with that format.
Tirr
2023-10-13 07:27:16
image dimension info comes just after the signature (`ff 0a`), and it's in relatively simple format
2023-10-13 07:28:34
(if not, in the simplest format within jxl spec)
2023-10-13 07:31:13
this function in libjxl reads `SizeHeader`, which is image dimesion stored in compact format https://github.com/libjxl/libjxl/blob/891c193febca5b5c2aa19b4a9d5dabb5766dc350/lib/jxl/headers.cc#L120
_wb_
dkam Also, can someone point me to a JXL file in the ISOBMFF format? I see that FastImage can identify AVIF and HEIC files with that format.
2023-10-13 07:41:51
Here's an example that uses the isobmff container format: https://github.com/libjxl/conformance/blob/master/testcases/cafe/input.jxl
dkam
2023-10-13 07:42:12
Thanks!
Tirr this function in libjxl reads `SizeHeader`, which is image dimesion stored in compact format https://github.com/libjxl/libjxl/blob/891c193febca5b5c2aa19b4a9d5dabb5766dc350/lib/jxl/headers.cc#L120
2023-10-13 07:42:38
I'll have a shot at it, but It's been 20 years since I wrote C!
_wb_
2023-10-13 07:43:07
you basically have to find the `jxlc` box or the first `jxlp` box to find the actual codestream (say if you want to get the image dimensions)
Fraetor
dkam Hello - I'm interested in updating the ruby FastImage (https://github.com/sdsykes/fastimage) gem to support JXL. I can match the first few bytes ( "\xFF\x0A" )to detect the image type, but I was thinking I'd ask how you'd go about plucking out the width and height from a binary stream? Easy or hard?
2023-10-13 05:52:14
I've got a simple parser that gets the width and height. https://github.com/Fraetor/jxl_decode/blob/main/src/jxl_decode/jxl.py You also need to check for the following bytes, for the case of an image in a container. `0000 000C 4A58 4C20 0D0A 870A`
Cacodemon345
2023-10-13 06:14:13
Can you retrieve the animated frames count this way too?
_wb_
2023-10-13 06:31:25
For frame count you have to decode all frame headers, there is no count in the image header (to make it possible to create bitstreams where the number of frames is not known in advance)
Cacodemon345
2023-10-13 06:43:49
At least can you detect easily if the image is animated in advance?
Fraetor
2023-10-13 07:14:19
I don't think it is possible to distinguish between images with multiple zero duration frames (such as those used by patches), and animations without reading the frame headers.
_wb_
2023-10-13 07:15:43
No you can distinguish that: animations will have timing info in the image header
2023-10-13 07:16:43
While composite-still images with multiple layers will have have_animation false in the image header, so no timing info gets signaled
Fraetor
2023-10-13 07:19:05
I stand corrected.
Cacodemon345
2023-10-13 07:22:24
At least being able to check `have_animation` in advance is a good thing, because it would be bad to start counting images just to check for animated ones.
Fraetor
2023-10-13 07:28:50
Looking at the spec I think you should be able to tell within at worse 23 bytes of codestream.
Olav
2023-10-17 11:36:06
Found a JPEG XL HDR sample image. * Web page containing multiple images: https://people.csail.mit.edu/ericchan/hdr/hdr-jxl.php * Image in question: https://people.csail.mit.edu/ericchan/hdr/jxl_images/20140606_102418_IMGP0297.jxl So far I've tested it on a non-HDR-cabable Windows 11 system. ## Seems to work * PhotoQt v3.4 * Thorium browser M117.0.5938.157 ( https://github.com/Alex313031/Thorium-Win-AVX2/releases/tag/M117.0.5938.157 ) ## Dark and dull (I've sent feedback about this to appropriate places) * ImageGlass v8.10.9.27 * IrfanView v4.62 with plugins v4.62 * JPEGView v1.2.45.0 * Paint.NET v5.0.11 with pdn-jpegxl v1.0.3 * XnViewMP v1.6.1 ## Questions 1. The sample image seems legit/correct, nothing funky going on with it? 2. Thorium seems to handle it correctly, right? Attached is a screenshot of Thorium vs. JPEGView. 3. Do we know of a Windows compatible image viewer with known good JPEG XL HDR decoding?
w
2023-10-17 12:25:46
btw paint.net will not do any color management (by choice)
veluca
w btw paint.net will not do any color management (by choice)
2023-10-17 12:29:09
isn't paint.net supposed to be an image editor? that seems like a bold choice
w
2023-10-17 12:29:52
i think it's an edit pixels vs edit photo angle
2023-10-17 12:30:14
like old mspaint
veluca
2023-10-17 12:31:15
I wish people would stop thinking that images can be displayed without colorspaces...
novomesk
2023-10-17 01:50:53
Krita
2023-10-17 01:54:40
nomacs
JendaLinda
2023-10-17 02:05:57
Speaking of Irfanview. I like this program, I'm using it all the time. It has many limitations due to it's old architecture, but if you know how to work around these limitations, it's still very useful program. It can do color management but it's also limited. The interesting quirk of IrfanView is that it's using Windows bitmap format to do all image processing. Upon loading, any image format is converted to color unmanaged Windows bitmap, either 24 bpp or paletted. It even preserves junk data in padding bytes inside BMP files.
Traneptora
Olav Found a JPEG XL HDR sample image. * Web page containing multiple images: https://people.csail.mit.edu/ericchan/hdr/hdr-jxl.php * Image in question: https://people.csail.mit.edu/ericchan/hdr/jxl_images/20140606_102418_IMGP0297.jxl So far I've tested it on a non-HDR-cabable Windows 11 system. ## Seems to work * PhotoQt v3.4 * Thorium browser M117.0.5938.157 ( https://github.com/Alex313031/Thorium-Win-AVX2/releases/tag/M117.0.5938.157 ) ## Dark and dull (I've sent feedback about this to appropriate places) * ImageGlass v8.10.9.27 * IrfanView v4.62 with plugins v4.62 * JPEGView v1.2.45.0 * Paint.NET v5.0.11 with pdn-jpegxl v1.0.3 * XnViewMP v1.6.1 ## Questions 1. The sample image seems legit/correct, nothing funky going on with it? 2. Thorium seems to handle it correctly, right? Attached is a screenshot of Thorium vs. JPEGView. 3. Do we know of a Windows compatible image viewer with known good JPEG XL HDR decoding?
2023-10-17 02:48:42
Here's what I get with Mercury, vs with Thorium
2023-10-17 02:48:51
first thing to mention: There's no "correct" way to render an HDR image on an SDR display
2023-10-17 02:48:56
you *have* to make some compromise
2023-10-17 02:49:11
there are incorrect ways, but nothing is "correct"
2023-10-17 02:50:10
do note: if you see something very dark like this, that's because this is what libjxl produces
2023-10-17 02:50:12
2023-10-17 02:50:20
libjxl does no peak detection
2023-10-17 02:50:41
which is necessary for viewing HDR on SDR monitors most of the time. It's something that libjxl relies on clients to do themselves
2023-10-17 02:53:26
other things of note
2023-10-17 02:53:39
if you ask libjxl to output PQ images, it will work fine with color-managed software
2023-10-17 02:54:34
`djxl 20140606_102418_IMGP0297.jxl --color_space=RGB_D65_202_Rel_PeQ djxl.png`