|
Quackdoc
|
2023-12-01 07:17:12
|
does djxl use rendering intent specified when converting from xyb to a given gamut? for instance say I encode a JXL image from a bt.2020 image and decode it using colorspace into srgb
will `--color_space RGB_D65_SRG_Per_SRG` use a perceptual gamut mode and `--color_space RGB_D65_SRG_Rel_SRG` use a relative gamut mapping mode? or will it just apply the appropriate icc stuff?
|
|
|
Demiurge
|
|
Demiurge
I haven’t taken a look at djxl’s source yet, so I don’t even know why it’s so slow to begin with, or what library it’s using
|
|
2023-12-01 09:33:43
|
I just took a look. Looks like it's just using regular libpng.
|
|
2023-12-01 09:34:04
|
And whatever the default speed settings are.
|
|
2023-12-01 09:47:31
|
A simple png_set_compression_level might help
|
|
|
|
veluca
|
|
Quackdoc
does djxl use rendering intent specified when converting from xyb to a given gamut? for instance say I encode a JXL image from a bt.2020 image and decode it using colorspace into srgb
will `--color_space RGB_D65_SRG_Per_SRG` use a perceptual gamut mode and `--color_space RGB_D65_SRG_Rel_SRG` use a relative gamut mapping mode? or will it just apply the appropriate icc stuff?
|
|
2023-12-01 11:27:13
|
I don't think so
|
|
2023-12-01 11:27:35
|
but <@604964375924834314> knows better than I
|
|
2023-12-01 11:27:47
|
(among other things, he probably even understands the question!)
|
|
|
Quackdoc
|
2023-12-01 11:33:45
|
for context, I want to look into the possibility on mastering for JXL directly, taking advantage of the built in gamut mapping JXL can support
|
|
2023-12-01 11:34:05
|
djxl does a really decent job from what I can tell already for this
|
|
|
Jyrki Alakuijala
|
|
tufty
libheif (AVIF and HEIC) and libwebp don't have streaming, but I can't think of others offhand
|
|
2023-12-02 06:33:10
|
I believe libwebp has streaming decoding
|
|
|
Traneptora
|
|
afed
is there any png encoders/decoders that support streaming?
to also support one of the most used compressed formats
libpng as far as I know?
|
|
2023-12-02 02:52:37
|
hydrium uses spng. it's not a library but a single include
|
|
|
|
afed
|
|
Demiurge
A simple png_set_compression_level might help
|
|
2023-12-02 07:00:07
|
`--effort` in djxl for output formats is also not a bad idea, at least for switching between default, slow (best compression) and fastest modes
but, it may be a bit complex for many formats and libraries
|
|
|
Traneptora
hydrium uses spng. it's not a library but a single include
|
|
2023-12-02 07:15:55
|
but, for a fully libpng replacement there is still no apng support, which is important for libjxl
|
|
|
Traneptora
|
|
afed
but, for a fully libpng replacement there is still no apng support, which is important for libjxl
|
|
2023-12-02 08:53:49
|
to be honest, PNG decoding is so simple that I'm considering adding a home-rolled PNG decoder to libhydrium
|
|
2023-12-02 08:54:44
|
It would, of course, require zlib but I don't see what's wrong with that
|
|
2023-12-02 08:55:10
|
saves me the trouble of rolling my own deflate decoder
|
|
2023-12-02 08:55:51
|
libpng requires setjmp for error handling which makes it somewhat not portable
|
|
|
|
veluca
|
2023-12-02 10:49:38
|
pretty sure lodepng can do apng relatively easily
|
|
2023-12-02 10:50:20
|
kinda want to write a fast Rust png decoder at some point of my life though xD
|
|
2023-12-02 10:50:32
|
(and maybe port fpnge while I'm at it)
|
|
|
|
afed
|
2023-12-02 10:51:38
|
yeah, but lodepng doesn't support streaming
|
|
|
|
veluca
|
2023-12-02 10:55:14
|
fair enough
|
|
|
|
afed
|
2023-12-02 11:26:17
|
fpnge with streaming (and potential multithreading for chunks, sadly there is no unified standard)
and a fast png decoder with fast path for fpnge would be something unbeatable <:Stonks:806137886726553651>
|
|
|
|
veluca
|
2023-12-02 11:29:21
|
pretty much all the variants boil down to "at this DAT chunk, the gzip stream is reset, prediction mode is 0, and a row starts", no?
|
|
2023-12-02 11:29:39
|
(well, s/is reset/behaves as if it were reset/)
|
|
|
|
afed
|
2023-12-02 11:31:32
|
https://github.com/w3c/PNG-spec/issues/54#issuecomment-996883205
|
|
|
|
veluca
|
2023-12-02 11:39:07
|
I recognize a bunch of names there 😛
|
|
2023-12-02 11:41:02
|
although it's lovely to see that none of the proposals seem to do what I would do 😆 (I probably would record a list of # of DAT chunks and # of rows such that you can start parallel decoding at those boundaries)
|
|
|
Traneptora
|
2023-12-03 01:09:41
|
It could help to see how Pigz does it
|
|
2023-12-03 01:10:15
|
pigz is mark adler's parallel zlib/gzip/etc. encoder
|
|
|
yurume
|
2023-12-03 04:23:48
|
generally you can flush the stream to make each fragment independent from others, and record the stream offset and compressed offset for seeking
|
|
2023-12-03 04:25:56
|
hmm, it seems that pigz actually uses `Z_SYNC_FLUSH` which does not reset states (i.e. later fragments can refer to prior fragments for backreferences)
|
|
2023-12-03 04:26:14
|
anyway pigz doesn't generally support parallel decompression, so that should be not very relevant to that proposal
|
|
|
Traneptora
|
2023-12-03 04:36:45
|
ah fair
|
|
|
jonnyawsom3
|
2023-12-03 03:43:48
|
Silly question, but are there DLLs being hosted anywhere from builds? I was going to try replacing old libjpeg DLLs with jpegli, but very quickly realised the dev builds don't have DLLs
|
|
|
|
afed
|
2023-12-03 03:52:11
|
yeah, that would be nice, but as far as I know there is still no dll for jpegli to seamlessly replacing libjpeg
|
|
|
jonnyawsom3
|
2023-12-03 04:03:11
|
Huh, so I guess it's just placeholder here then? <https://github.com/libjxl/libjxl/tree/main/lib/jpegli#building>
|
|
|
|
afed
|
2023-12-03 04:04:31
|
only as .so libs for linux, but not as dlls for windows
|
|
|
Traneptora
|
2023-12-04 02:46:28
|
It seems a decently common use case for the library is to request pixel data from libjxl in the tagged space, for XYB encoded images
|
|
2023-12-04 02:47:13
|
Should there be a function to shortcircuit this process?
|
|
2023-12-04 02:49:13
|
Ive seen code in a few places that calls getColorAsEncodedProfile(target original), followed by setPreferedColorProfile, followed by getColorAsEncodedProfile(target data)
|
|
2023-12-04 02:49:36
|
I'm wondering if this dance can be short-circuited
|
|
|
|
afed
|
|
Silly question, but are there DLLs being hosted anywhere from builds? I was going to try replacing old libjpeg DLLs with jpegli, but very quickly realised the dev builds don't have DLLs
|
|
2023-12-04 03:48:21
|
<@532010383041363969> ^ is jpegli development finished or just other tasks for libjxl are more important right now?
and anyway it would be nice to also have windows libraries for drop-in replacement
|
|
|
jonnyawsom3
|
2023-12-04 03:51:48
|
It was just now I realised they helped make Zopfli too, seems they're an expert at squeezing the most out of the old formats
|
|
|
Jyrki Alakuijala
|
|
afed
<@532010383041363969> ^ is jpegli development finished or just other tasks for libjxl are more important right now?
and anyway it would be nice to also have windows libraries for drop-in replacement
|
|
2023-12-04 08:37:37
|
We have all the data, everything lined up for the blog post lightly documenting jpegli's performance, but the team prioritized streaming encoding in JPEG XL before that. I believe technically it is ready, just the evidence that is actually awesome is a secret still... 😅
|
|
2023-12-04 08:38:35
|
Jpegli is finished from technical viewpoint or at least in a milestone where it is great to implement
|
|
2023-12-04 08:39:50
|
It might make sense to add more dequantization or filtering modes for the decoder later, but if it ever happens it is more likely for 2027 than 2024
|
|
2023-12-04 08:40:15
|
Shortly put: it's finished 🌞🌞🌞
|
|
|
|
afed
|
|
Jyrki Alakuijala
Shortly put: it's finished 🌞🌞🌞
|
|
2023-12-04 09:06:59
|
i see, that's great
so it's just the compilation scripts?
would be nice to fix this too, because currently there are only binary encoders and decoders for windows, but not libs for easy libjpeg replacement
|
|
|
Demiurge
|
2023-12-04 10:47:17
|
it should probably be pretty simple to compile a dll for windows, just like it is on linux.
|
|
2023-12-04 10:47:43
|
keep in mind though that it only implements the libjpeg 6b interface
|
|
2023-12-04 10:47:49
|
not 7
|
|
2023-12-04 10:48:08
|
Some software was made with v7 in mind
|
|
2023-12-04 10:49:12
|
for some reason Arch Linux uses v7 system-wide
|
|
2023-12-04 10:49:42
|
idk if a compatibility layer exists
|
|
|
|
afed
|
2023-12-04 10:52:36
|
most likely
even for 8.0
|
|
|
Demiurge
|
2023-12-04 11:03:40
|
Afaik nobody uses v8 or higher and everyone seems to agree libjpeg API changes suck and stupidly break compatibility
|
|
2023-12-04 11:04:50
|
v6b and v7 seem to be what everyone uses
|
|
|
Jyrki Alakuijala
|
2023-12-04 11:24:24
|
Jpegli gives 16 but frame buffer access through API extensions
|
|
|
Demiurge
|
2023-12-05 01:26:15
|
Does it implement some sort of dithering for 8 bit output?
|
|
|
sklwmp
|
|
Demiurge
for some reason Arch Linux uses v7 system-wide
|
|
2023-12-05 06:15:41
|
Arch for me is running on libjpeg 8
|
|
2023-12-05 06:16:12
|
I sometimes inject jpegli when converting via imagemagick
|
|
|
Demiurge
|
2023-12-05 06:28:19
|
Wow, you're right...
|
|
2023-12-05 07:58:13
|
Apparently Arch provides v6 and v8
|
|
2023-12-05 07:58:39
|
Not v7. Weird.
|
|
|
yurume
|
2023-12-05 08:03:23
|
is v6 the actual libjpeg v6 or libjpeg-turbo or mozjpeg (both of which derive from v6)?
|
|
|
Traneptora
|
|
Demiurge
Not v7. Weird.
|
|
2023-12-05 10:37:43
|
v9 is the first version of IJG libjpeg that most people don't use
|
|
2023-12-05 10:37:56
|
v8 is where turbojpeg stopped following the ABI
|
|
2023-12-05 10:40:36
|
https://libjpeg-turbo.org/About/Jpeg-9
|
|
|
Demiurge
|
2023-12-05 10:53:29
|
What about software that uses v7? Is v8 compatible?
|
|
|
Traneptora
|
2023-12-05 10:56:35
|
apparently not
|
|
2023-12-05 10:56:39
|
v7 is quite rare to use iirc
|
|
|
|
Joao
|
2023-12-05 12:42:57
|
Hi all, I'm a just a jxl noob and sorry for the long text. From the perspective of an end user, is Jpeg XL format ready for production yet? Example: I convert my photos to JPEG XL format using Libjxl 0.8 tools, but in the future libjxl will reach version 1.0 with some changes to the image format and could make those jxl photos incompatible. Is it highly recommended to wait for version 1.0 to be released? Another thing I would like to now is about the amazing work of jxl art. It looks to me that jxl has pseudo vectorial capabilities. For example: a jxl with splines for anime lineart decodes for a specific resolution. But with proper software those splines points can be re-calculated easily and the lineart upscaled without loss of quality like a vectorial program (not sure if original tree can be retrieved from jxl though). And I wonder doing this automated on the web as well. I suspect many tree elements won't be easily recalculated for upscaling and probably only a few selected functions can be used if intending to use jxl as a vectorial image format. But not only jxl could replace png, gif and jpeg but could replace vectorial formats in some situations. Am I right about this? Likewise, I wonder if it's possible to use older formats like png or jpeg similarly as "jxl art".
|
|
|
Demiurge
|
2023-12-05 12:58:35
|
The format is finalized.
|
|
2023-12-05 01:00:07
|
So the files should be future proof and future tools will be able to decode them no problem
|
|
|
|
Joao
|
2023-12-05 01:04:53
|
Thanks. I couldn't get any answer when doing an internet search using keywords: is jxl complete, is jxl ready, is jxl finalized.
|
|
|
jonnyawsom3
|
2023-12-05 01:08:08
|
As Pashi said, any files made now will work indefinitely. Yes, splines can be used as basic replacements for some vector graphics (there's even a tool already made https://github.com/wwww-wwww/spline). The original tree can be retrieved from a file with some work, there was a Google CTF where it was required to solve <https://github.com/google/google-ctf/tree/master/2023/quals/rev-jxl/solution>. And not easily. JXL can have block sizes of 1024x1024 that are turing complete, so you can code in a way similar to shader art
|
|
|
Joao
Thanks. I couldn't get any answer when doing an internet search using keywords: is jxl complete, is jxl ready, is jxl finalized.
|
|
2023-12-05 01:12:18
|
<https://github.com/libjxl/libjxl/blob/main/CHANGELOG.md#added-6>
|
|
2023-12-05 01:16:31
|
It used to be listed under the 0.2 release, but it seems the older ones have since been removed
|
|
|
|
Joao
|
2023-12-05 01:21:13
|
Thank you for the answers
|
|
|
Tirr
|
2023-12-05 02:16:44
|
jxl is quite flexible but it's not turing complete; it would be decoder's nightmare if it were turing complete, because it wouldn't know when the decoding ends
|
|
|
jonnyawsom3
|
2023-12-05 02:22:04
|
Rather, it would be if not limited to the 1024x1024 blocks
|
|
|
MSLP
|
|
Joao
Hi all, I'm a just a jxl noob and sorry for the long text. From the perspective of an end user, is Jpeg XL format ready for production yet? Example: I convert my photos to JPEG XL format using Libjxl 0.8 tools, but in the future libjxl will reach version 1.0 with some changes to the image format and could make those jxl photos incompatible. Is it highly recommended to wait for version 1.0 to be released? Another thing I would like to now is about the amazing work of jxl art. It looks to me that jxl has pseudo vectorial capabilities. For example: a jxl with splines for anime lineart decodes for a specific resolution. But with proper software those splines points can be re-calculated easily and the lineart upscaled without loss of quality like a vectorial program (not sure if original tree can be retrieved from jxl though). And I wonder doing this automated on the web as well. I suspect many tree elements won't be easily recalculated for upscaling and probably only a few selected functions can be used if intending to use jxl as a vectorial image format. But not only jxl could replace png, gif and jpeg but could replace vectorial formats in some situations. Am I right about this? Likewise, I wonder if it's possible to use older formats like png or jpeg similarly as "jxl art".
|
|
2023-12-05 03:59:43
|
The bitstream format is finalized, but IIRC the current encoder does not yet generate splines. So if you plan encoding lossy, and delete the originals, then maybe future versions of the encoder will achieve beter compression ratios due to more usage of more advanced techniques.
If you plan to use losless mode this doesn't matter, as you'll still have the unchanged image.
Anyway anything you'll encode will be opened by any future versions of libjxl.
|
|
2023-12-05 04:01:30
|
Oh. I see _wb_ posted the status about current encoder today https://discord.com/channels/794206087879852103/848189884614705192/1181543024354938921
|
|
|
spider-mario
|
2023-12-05 04:03:26
|
I’m usually wary of replacing originals with _any_ lossily-compressed version
|
|
2023-12-05 04:04:26
|
even if it’s the ultimate lossy codec one could possibly ever want, as soon as you go in the other direction (need to make a lossy copy for an old device that doesn’t support it), you still incur generation loss
|
|
|
jonnyawsom3
|
2023-12-05 04:07:12
|
Earlier today I realised I had converted about 350 game screenshots into jpeg to save space about a year ago (Originally to copy onto my phone, but apparently I overwrote the original PNGs too). Now I'm wishing I hadn't so I could use all the new encoders I've learnt about since
|
|
2023-12-05 04:08:34
|
Even if I had just known about OxiPNG back then I likely wouldn't have needed to jpeg everything
|
|
|
MSLP
|
2023-12-05 04:12:41
|
now you can at least loselessly-jxlize those jpegs 😁
|
|
|
jonnyawsom3
|
2023-12-05 04:18:31
|
Yeah, worst thing is I used a ffmpeg script to do it, only using `-q:v 1` for quality control. So I have no idea what actual quality they used, baseline or progressive, subsampling, ect
|
|
|
Traneptora
|
|
Yeah, worst thing is I used a ffmpeg script to do it, only using `-q:v 1` for quality control. So I have no idea what actual quality they used, baseline or progressive, subsampling, ect
|
|
2023-12-05 04:48:35
|
-q:v sets the qp to 1
|
|
|
jonnyawsom3
|
2023-12-05 04:49:36
|
Yeah, but I don't know what jpeg quality that translates to. I could check with trial and error, or spend 15 minutes reading sourcecode, but maybe later
|
|
|
Traneptora
|
|
Yeah, but I don't know what jpeg quality that translates to. I could check with trial and error, or spend 15 minutes reading sourcecode, but maybe later
|
|
2023-12-05 04:50:09
|
"jpeg quality" isn't really a thing
|
|
2023-12-05 04:50:35
|
there's "quality roughly matching a specific encoder's Q setting"
|
|
2023-12-05 04:50:37
|
but that's about it
|
|
|
w
|
2023-12-05 04:50:42
|
in other words quality?
|
|
|
Traneptora
|
2023-12-05 04:50:50
|
right but it's not universal
|
|
2023-12-05 04:51:02
|
since jpeg encoders aren't universal
|
|
|
jonnyawsom3
|
2023-12-05 04:51:03
|
For Jpeg is practically is
|
|
|
w
|
2023-12-05 04:51:03
|
that's just pedantic
|
|
|
jonnyawsom3
|
2023-12-05 04:51:10
|
Oh, hmm
|
|
|
Traneptora
|
2023-12-05 04:51:26
|
no? windows jpeg encoder notably is different from turbojpeg
|
|
2023-12-05 04:51:37
|
which is notably different from mozjpeg (iirc gimp on windows uses mozjpeg, for example)
|
|
|
w
|
2023-12-05 04:51:58
|
well encoder was never mentioned
|
|
2023-12-05 04:52:00
|
just jpeg
|
|
|
jonnyawsom3
|
2023-12-05 04:52:33
|
Well yeah, every implementation is different, but they all try to use roughly the same scale
|
|
|
w
|
2023-12-05 04:53:24
|
we all know what bad jpeg and good jpeg is
|
|
|
jonnyawsom3
|
2023-12-05 04:54:13
|
Point was, I rushed into compressing everything before I knew what I was doing
|
|
|
w
|
2023-12-05 04:54:53
|
do you regret knowing what you are doing now
|
|
|
Traneptora
|
|
Well yeah, every implementation is different, but they all try to use roughly the same scale
|
|
2023-12-05 04:57:52
|
ffmpeg's jpeg encoder uses the same quality control as its mpegvideo encoder
|
|
2023-12-05 04:57:59
|
which is based on qscale
|
|
2023-12-05 04:58:04
|
which is floored at 3
|
|
|
jonnyawsom3
|
2023-12-05 04:58:29
|
I did wonder about that, which is why I also used -qmin 1
|
|
|
Traneptora
|
2023-12-05 05:01:29
|
in either case, if you're looking for specific numbers
|
|
2023-12-05 05:01:46
|
-q:v 1 is roughly on-par with libjpeg-turbo at ~87 or so
|
|
2023-12-05 05:01:50
|
in terms of file size
|
|
|
jonnyawsom3
|
2023-12-05 05:04:36
|
About what I expected, thank you
|
|
|
|
Joao
|
2023-12-05 06:02:22
|
Image compression results dependends on multiple factors, not just chosing an ideal image format and it's parameters. Examples: lowering resolution exactly to 1/2, 1/3, 1/4 and so on, to give better metric results, lowering colour depth, indexing colours (ex.: lineart, screenshots), approximating small images to disc cluster size, cropping image a certan amount of pixels so it's divisible by 2, 3, 4.., applying filters like selective gaussian blur and desaturating gently to facilitate the compression algorithms. Is there a "magical" program that intelligently does all this calculations automatically when the user wishes to lower a 3Mb photo to lets say 50Kb with the best quality possible? Ideally the program would give suggestions to the user when necessary, while still allowing to manually tweak some factors for better results? I'm interested in a program that tackles the most basic important factors easy to deal with, but that many times we don't think about it as they are so many. Advanced A.I. features are welcome but not necessary (ex.: face recognition and face mask). That program together with jxl would be amazing.
|
|
|
spider-mario
|
|
w
just jpeg
|
|
2023-12-05 06:49:08
|
jpeg itself has no concept of quality level, only quantization tables
|
|
2023-12-05 06:49:37
|
Traneptora’s point is that the mapping of q0..q100 to quantization tables varies widely by encoder, as therefore does the reverse
|
|
2023-12-05 06:49:53
|
if the encoder even uses a q0..q100 scale (Photoshop doesn’t, it’s 0..12)
|
|
|
w
|
2023-12-05 06:51:01
|
but everything else does that. does that mean nothing has quality?
|
|
2023-12-05 06:52:46
|
and by everything I mean everything in the world since quality is subjective
|
|
|
spider-mario
|
2023-12-05 06:52:55
|
everything else does what?
|
|
|
w
|
2023-12-05 06:53:26
|
map quantity to some other quantity
|
|
|
spider-mario
|
2023-12-05 06:54:34
|
right, but if you ask “which distance is this .jxl?”, most people will assume that it has been produced by libjxl, and that the question is which distance was used then
|
|
2023-12-05 06:54:59
|
or perhaps, if it was not produced by libjxl, what libjxl distance would produce a similar file
|
|
2023-12-05 06:55:16
|
for a jpeg produced by ffmpeg, what does the question mean?
|
|
|
w
|
2023-12-05 06:55:38
|
could mean image quality
|
|
|
spider-mario
|
2023-12-05 06:55:39
|
which libjpeg-turbo quality level would use similar quantization tables? which mozjpeg quality? which sjpeg quality?
|
|
2023-12-05 06:56:43
|
the question here was “jpeg quality”
|
|
2023-12-05 06:56:55
|
Traneptora described why there is essentially no such thing
|
|
2023-12-05 06:57:33
|
you took issue with the fact that encoder was never mentioned, but they are arguably what gives “jpeg quality” any meaning at all in the first place
|
|
|
w
|
2023-12-05 06:59:23
|
I initially interpreted it as the likes of image quality
|
|
2023-12-05 07:00:23
|
encoding brainrot
|
|
|
|
binkythehorse
|
2023-12-07 01:01:54
|
I'm working on getting very early previews of images (at 1% of the file size) which as I understand should be possible with progressive_dc, is that possible with libjxl as it currently stands? I've done a few experiments but haven't been able to get it to decode with less than 30% of the image.
|
|
|
MSLP
|
2023-12-07 06:34:27
|
Tirr was doing some experiments on this, and was able to pull it off
https://discord.com/channels/794206087879852103/1065165415598272582/1167351454110064660
https://discord.com/channels/794206087879852103/1065165415598272582/1167387552500678656
https://discord.com/channels/794206087879852103/1065165415598272582/1176213246437494935
https://discord.com/channels/794206087879852103/1065165415598272582/1176552787786612797
The decoder was jxl-oxide, and I'm not sure what encode parameters were.
|
|
|
Tirr
|
2023-12-07 06:37:42
|
maybe libjxl renders only when a progressive scan is complete
|
|
|
jonnyawsom3
|
2023-12-07 10:15:50
|
It used to have an LQIP decode mode but it's not in the current decoder https://youtu.be/uzYHXqjGgL4
|
|
|
_wb_
|
2023-12-07 12:41:37
|
when building on MacOS, after `cmake --install .` I get this:
```
$ cjxl
dyld[80790]: Library not loaded: @rpath/libjxl_extras_codec.0.10.dylib
Referenced from: <D820F31B-DF5D-33E1-AE1D-BB075178CF04> /usr/local/bin/cjxl
Reason: no LC_RPATH's found
```
|
|
2023-12-07 12:44:09
|
does anyone know how to fix that? I can run cjxl from the local `build/tools/cjxl` fine, but the installed one isn't finding the libraries
|
|
|
spider-mario
|
2023-12-07 12:44:28
|
do the libraries actually get installed correctly?
|
|
|
_wb_
|
2023-12-07 12:44:40
|
they're in /usr/local/lib
|
|
|
spider-mario
|
2023-12-07 12:44:59
|
a stopgap solution would be to rebuild/reinstall after `cmake -DBUILD_SHARED_LIBS=OFF .`
|
|
|
_wb_
|
2023-12-07 12:45:35
|
to make static binaries?
|
|
|
spider-mario
|
2023-12-07 12:46:29
|
semi-static, so to speak
|
|
2023-12-07 12:46:38
|
libjxl* would be built and linked statically
|
|
2023-12-07 12:46:42
|
system libraries, still dynamically
|
|
|
_wb_
|
2023-12-07 01:08:48
|
oh I just realized I was working in x86 mode for some silly reason, trying again in arm64 mode
|
|
|
Traneptora
|
|
_wb_
they're in /usr/local/lib
|
|
2023-12-07 03:59:31
|
how is your dynamic loader configured?
|
|
2023-12-07 04:00:01
|
Linux has ldconfig and ld.so.conf
|
|
2023-12-07 04:00:13
|
im sure macOS has an equiv
|
|
2023-12-07 04:01:06
|
if not, does macho have rpath?
|
|
|
gb82
|
|
It used to have an LQIP decode mode but it's not in the current decoder https://youtu.be/uzYHXqjGgL4
|
|
2023-12-07 07:22:45
|
What is LQIP decode mode & why was it removed?
|
|
|
jonnyawsom3
|
|
gb82
What is LQIP decode mode & why was it removed?
|
|
2023-12-07 07:42:31
|
You can see in the video, it allowed the image to be displayed after a single KB, as for where it went... I'm struggling to find any mention of it now
|
|
|
gb82
|
2023-12-07 07:43:09
|
<:PepeOK:805388754545934396>
|
|
|
jonnyawsom3
|
|
Jyrki Alakuijala
Shortly put: it's finished 🌞🌞🌞
|
|
2023-12-07 08:01:57
|
Just stumbled across this issue, thought it would be worth bringing up. Since being JXL compatible on release might help down the road ;P https://github.com/libjxl/libjxl/issues/2284
|
|
|
Traneptora
|
|
Just stumbled across this issue, thought it would be worth bringing up. Since being JXL compatible on release might help down the road ;P https://github.com/libjxl/libjxl/issues/2284
|
|
2023-12-07 11:49:08
|
This has been fixed, I can close the issue
|
|
|
jonnyawsom3
|
2023-12-07 11:53:58
|
Ah, nice
|
|
|
Demiurge
|
2023-12-08 12:41:58
|
When decompressing an XL to JPEG, non-reconstruction... does it use jpegli?
|
|
|
Traneptora
|
|
Demiurge
When decompressing an XL to JPEG, non-reconstruction... does it use jpegli?
|
|
2023-12-08 02:30:43
|
No, it uses libjpeg
|
|
2023-12-08 02:30:57
|
```
leo@gauss ~/Pictures/George :) $ cjxl --lossless_jpeg=0 -d 0 input.jpg test.jxl
JPEG XL encoder v0.10.0 739d9dab [AVX2]
Encoding [Modular, lossless, effort: 7]
Compressed to 928.7 kB (9.555 bpp).
1080 x 720, 0.654 MP/s [0.65, 0.65], 1 reps, 8 threads.
leo@gauss ~/Pictures/George :) $ djpegli input.jpg jpegli.png
Read 604428 compressed bytes.
1080 x 720, 26.362 MP/s [26.36, 26.36], 1 reps, 1 threads.
leo@gauss ~/Pictures/George :) $ djxl test.jxl libjxl-default-jpeg.png
JPEG XL decoder v0.10.0 739d9dab [AVX2]
Decoded to pixels.
1080 x 720, 17.303 MP/s [17.30, 17.30], 1 reps, 8 threads.
leo@gauss ~/Pictures/George :) $ /usr/bin/djpeg -targa input.jpg | magick convert tga:- libjpeg.png
leo@gauss ~/Pictures/George :) $ magick compare -verbose -metric pae jpegli.png libjxl-default-jpeg.png null:-
jpegli.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.22903MiB 0.020u 0:00.023
libjxl-default-jpeg.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.23833MiB 0.020u 0:00.023
Image: jpegli.png
Channel distortion: PAE
red: 1028 (0.0156863)
green: 1028 (0.0156863)
blue: 1799 (0.027451)
all: 1799 (0.027451)
jpegli.png=>- PNG 1080x720 8-bit sRGB 1.22903MiB 0.330u 0:00.049
leo@gauss ~/Pictures/George :( $ magick compare -verbose -metric pae libjpeg.png libjxl-default-jpeg.png null:-
libjpeg.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.23273MiB 0.020u 0:00.023
libjxl-default-jpeg.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.23833MiB 0.020u 0:00.023
Image: libjpeg.png
Channel distortion: PAE
red: 0 (0)
green: 0 (0)
blue: 0 (0)
all: 0 (0)
libjpeg.png=>- PNG 1080x720 8-bit sRGB 1.23273MiB 0.300u 0:00.037
leo@gauss ~/Pictures/George :) $
```
|
|
2023-12-08 02:31:40
|
if you do `cjxl --lossless_jpeg=0 -d 0 input.jpg output.jxl`, you get identical pixel data to if you had done /usr/bin/djpeg
|
|
2023-12-08 02:32:04
|
if you do djpegli you get something different
|
|
2023-12-08 02:32:39
|
when I say libjpeg I mean whatever it linked to, which in my system is libjpeg-turbo
|
|
2023-12-08 02:33:11
|
```
leo@gauss ~/Pictures/George :) $ ldd /usr/bin/djpeg
linux-vdso.so.1 (0x00007fff7abf9000)
libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f66fd5d0000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f66fd3ee000)
/lib64/ld-linux-x86-64.so.2 => /usr/lib64/ld-linux-x86-64.so.2 (0x00007f66fd68c000)
leo@gauss ~/Pictures/George :) $ pacman -Qo /usr/lib/libjpeg.so.8
/usr/lib/libjpeg.so.8 is owned by libjpeg-turbo 3.0.1-1
```
|
|
|
Demiurge
|
2023-12-08 03:12:18
|
Well it's kind of weird that libjxl depends on so many external libraries, but especially in the case where it already comes with its own, superior JPEG encoder and decoder library that it doesn't even use itself, for anything.
|
|
|
sklwmp
|
|
Traneptora
```
leo@gauss ~/Pictures/George :) $ cjxl --lossless_jpeg=0 -d 0 input.jpg test.jxl
JPEG XL encoder v0.10.0 739d9dab [AVX2]
Encoding [Modular, lossless, effort: 7]
Compressed to 928.7 kB (9.555 bpp).
1080 x 720, 0.654 MP/s [0.65, 0.65], 1 reps, 8 threads.
leo@gauss ~/Pictures/George :) $ djpegli input.jpg jpegli.png
Read 604428 compressed bytes.
1080 x 720, 26.362 MP/s [26.36, 26.36], 1 reps, 1 threads.
leo@gauss ~/Pictures/George :) $ djxl test.jxl libjxl-default-jpeg.png
JPEG XL decoder v0.10.0 739d9dab [AVX2]
Decoded to pixels.
1080 x 720, 17.303 MP/s [17.30, 17.30], 1 reps, 8 threads.
leo@gauss ~/Pictures/George :) $ /usr/bin/djpeg -targa input.jpg | magick convert tga:- libjpeg.png
leo@gauss ~/Pictures/George :) $ magick compare -verbose -metric pae jpegli.png libjxl-default-jpeg.png null:-
jpegli.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.22903MiB 0.020u 0:00.023
libjxl-default-jpeg.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.23833MiB 0.020u 0:00.023
Image: jpegli.png
Channel distortion: PAE
red: 1028 (0.0156863)
green: 1028 (0.0156863)
blue: 1799 (0.027451)
all: 1799 (0.027451)
jpegli.png=>- PNG 1080x720 8-bit sRGB 1.22903MiB 0.330u 0:00.049
leo@gauss ~/Pictures/George :( $ magick compare -verbose -metric pae libjpeg.png libjxl-default-jpeg.png null:-
libjpeg.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.23273MiB 0.020u 0:00.023
libjxl-default-jpeg.png PNG 1080x720 1080x720+0+0 8-bit TrueColor sRGB 1.23833MiB 0.020u 0:00.023
Image: libjpeg.png
Channel distortion: PAE
red: 0 (0)
green: 0 (0)
blue: 0 (0)
all: 0 (0)
libjpeg.png=>- PNG 1080x720 8-bit sRGB 1.23273MiB 0.300u 0:00.037
leo@gauss ~/Pictures/George :) $
```
|
|
2023-12-08 03:56:13
|
This is *compressing* JPEG to JXL, I think <@1028567873007927297> meant *decompressing* JXL to JPEG
But it's probably the same in both cases?
|
|
|
Demiurge
|
2023-12-08 03:56:47
|
Still, it’s using the system library instead of its own.
|
|
|
Traneptora
|
|
sklwmp
This is *compressing* JPEG to JXL, I think <@1028567873007927297> meant *decompressing* JXL to JPEG
But it's probably the same in both cases?
|
|
2023-12-08 03:57:25
|
you are correct, but I believe it is not different
|
|
|
Demiurge
|
2023-12-08 03:57:35
|
And considering jpegli is supposed to offer supreme quality improvements, it makes little sense not to capitalize on that
|
|
|
Traneptora
|
2023-12-08 03:57:45
|
open an issue ig
|
|
|
sklwmp
|
|
Traneptora
you are correct, but I believe it is not different
|
|
2023-12-08 04:00:55
|
Yep, it isn't. Using djxl straight to JPG is the same as djxl -> PNG -> magick -> JPG at q95 (default).
|
|
|
Demiurge
|
2023-12-08 05:40:27
|
libjxl is poised to take over the planet if it could just capitalize on its strengths without getting in its own way. The libjpeg quality improvement is a huge deal, just like mozjpeg was a huge deal. But it’s not emphasized or advertised at all, or linked to, and it’s impossible for the layman to even know about the existence of it.
|
|
|
_wb_
|
2023-12-08 07:18:00
|
Eventually I think we should integrate jpegli into libjxl, make the decode API also handle jpeg input and have encode options to produce jpeg output and jpeg-reconstructible-jxl output. Not for version 1.0 though.
|
|
|
sklwmp
|
2023-12-08 08:06:31
|
I think this has been talked about since last year, when we were discussing using libjxl as a drop-in replacement for libjpeg. It would be nice, but I agree that it's probably not a very high priority.
|
|
|
|
ajekb78
|
2023-12-08 09:01:48
|
When I use libjxl to save an image with an ICC profile and then re-open the same image, why is the ICC profile read back using JXL_COLOR_PROFILE_TARGET_ORIGINAL sometimes the actual profile I provided when saving, and sometimes a functionally identical one but with the description changed to what looks like a formulaic description? Eg if I save a file with a Rec2020 ICC profile with the description tag Rec2020-elle-V4-g10.icc then that's still the ICC profile description when I read the image back in, but if I save it with a standard sRGB profile with description sRGB-elle-V4-srgbtrc.icc it is changed to RGB_D65_SRG_Per_SRG.
|
|
|
Tirr
|
2023-12-08 09:06:02
|
perhaps libjxl checks if the profile is known one
|
|
|
_wb_
|
2023-12-08 09:17:51
|
When doing lossless, it keeps the icc profile as is.
When doing lossy, it analyzes the icc profile and if it can equivalently be represented as an Enum colorspace (which is more compact to signal), it does that. In that case, when you read it back, it will not match the original icc profile exactly, only functionally.
|
|
|
|
ajekb78
|
2023-12-08 09:40:59
|
Ah, thank you.
|
|
|
jonnyawsom3
|
|
sklwmp
I think this has been talked about since last year, when we were discussing using libjxl as a drop-in replacement for libjpeg. It would be nice, but I agree that it's probably not a very high priority.
|
|
2023-12-08 11:13:57
|
Hmm, if that meant even ancient applications could be upgraded to JXL with a drag and drop, I'd be very impressed
|
|
|
Demiurge
|
2023-12-08 01:23:43
|
I think it is a very big deal, that could be the turning point in libjxl popularity and adoption, if more people knew about its ability to produce regular JPEG at greatly improved quality/bitrate ratio
|
|
2023-12-08 01:24:08
|
It’s the perfect “gateway drug” to bring it into the mainstream
|
|
2023-12-08 01:25:01
|
But I guess I’m the only one who sees it that way, or it would be higher priority to put it front and center
|
|
2023-12-08 01:35:04
|
It seems to me like libjxl is getting in the way of its own popularity and success, by not taking advantage of its unique abilities and strengths that it can offer to the largest groups of people.
|
|
2023-12-08 02:10:14
|
The other two problems that I see, is... aside from the GIMP plugin, which is a nice start, there doesn't seem to be anyone from libjxl looking over the libjxl glue code for any other popular image libraries, to offer suggestions and improvements for how to use the libjxl API. For example:
https://github.com/libvips/libvips/blob/master/libvips/foreign/jxlload.c
https://github.com/libvips/libvips/blob/master/libvips/foreign/jxlsave.c
https://sourceforge.net/p/graphicsmagick/code/ci/default/tree/coders/jxl.c
Lastly, the only other problem I see getting in the way of broader adoption and spread and pull requests, is the very messy libjxl source tree with lots of external dependencies.
|
|
|
Cacodemon345
|
2023-12-08 02:26:55
|
libvips devs were asking for help recently though.
|
|
|
Traneptora
|
|
ajekb78
When I use libjxl to save an image with an ICC profile and then re-open the same image, why is the ICC profile read back using JXL_COLOR_PROFILE_TARGET_ORIGINAL sometimes the actual profile I provided when saving, and sometimes a functionally identical one but with the description changed to what looks like a formulaic description? Eg if I save a file with a Rec2020 ICC profile with the description tag Rec2020-elle-V4-g10.icc then that's still the ICC profile description when I read the image back in, but if I save it with a standard sRGB profile with description sRGB-elle-V4-srgbtrc.icc it is changed to RGB_D65_SRG_Per_SRG.
|
|
2023-12-08 02:39:07
|
cjxl detects ICC profiles and if it can be represented with the enums, then it will use those instead
|
|
2023-12-08 02:39:57
|
so what's likely happening here is cjxl sees that the profile is actually just sRGB, and rather than save the sRGB profile, it's just tagging the image as sRGB
|
|
2023-12-08 02:40:05
|
and then when you request sRGB, it synthesizes an sRGB profile
|
|
|
Demiurge
|
2023-12-08 04:40:20
|
Yes, the libvips devs said they would really like someone familiar with the libjxl api and recommended usage to look over those two files and offer suggestions or comments. That sort of communication could potentially lead to improvements in libjxl’s API itself.
|
|
2023-12-08 04:41:12
|
The most important thing about libjxl is how it will be used and adopted in practice and libvips is a very important library and a very big “gateway” to broader adoption and usage.
|
|
2023-12-08 04:44:46
|
Same with Magick, since Magick has a lot of users as well, even though vips is imo a far better replacement.
But most importantly, looking at the glue code and seeing how libjxl is being integrated in practice, will provide a lot of insight into the design and expectations of the public API for libjxl.
|
|
|
Traneptora
|
2023-12-08 04:51:44
|
My biggest gripe is that there a appears to be a fairly common use case that should have a shortcut function
|
|
2023-12-08 04:52:43
|
which is
1. Request the tagged/`TARGET_ORIGINAL` information.
2. Take that information and feed it to `SetPreferredColorEncoding`.
3. Then, request `TARGET_DATA`.
|
|
2023-12-08 04:54:02
|
Basically `TARGET_DATA` *defaults* to sRGB, rather than defaulting to what is tagged. IMO, for an XYB-encoded image with enum values tagged, TARGET_DATA should default to equal TARGET_ORIGINAL. That way you don't have to do that dance.
|
|
|
Demiurge
|
2023-12-08 04:54:15
|
Stuff like that is perfect, the exact sort of feedback and attention that libjxl needs at this early stage.
|
|
2023-12-08 04:55:01
|
In fact I should link to the libjxl-ffmpeg glue here so more people look at it
|
|
|
Traneptora
|
2023-12-08 04:55:06
|
or rather, short-circuit it with a function 'JxlDecoderRequestOriginalSpace'
|
|
2023-12-08 04:55:11
|
etc.
|
|
2023-12-08 04:55:23
|
the big question becomes "what if the image is XYB encoded by the original space is an ICC profile space."
|
|
2023-12-08 04:55:29
|
then you need a CMS library set
|
|
|
Demiurge
|
|
Demiurge
The other two problems that I see, is... aside from the GIMP plugin, which is a nice start, there doesn't seem to be anyone from libjxl looking over the libjxl glue code for any other popular image libraries, to offer suggestions and improvements for how to use the libjxl API. For example:
https://github.com/libvips/libvips/blob/master/libvips/foreign/jxlload.c
https://github.com/libvips/libvips/blob/master/libvips/foreign/jxlsave.c
https://sourceforge.net/p/graphicsmagick/code/ci/default/tree/coders/jxl.c
Lastly, the only other problem I see getting in the way of broader adoption and spread and pull requests, is the very messy libjxl source tree with lots of external dependencies.
|
|
2023-12-08 04:59:03
|
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxldec.c
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxlenc.c
|
|
2023-12-08 05:02:22
|
Here’s also ImageMagick to compare with the GraphicsMagick implementation.
https://github.com/ImageMagick/ImageMagick/blob/main/coders/jxl.c
|
|
|
Traneptora
|
|
Demiurge
Stuff like that is perfect, the exact sort of feedback and attention that libjxl needs at this early stage.
|
|
2023-12-08 05:40:30
|
another possible issue is that when decoding animated JXL, the FULL_IMAGE event outputs one presented frame, but there's no way to get the duration of that frame
|
|
2023-12-08 05:41:17
|
you'd need to subscribe to the FRAME event as well, and use the most recent nonzero duration from the frame header, stash it somewhere, and then use that next time FULL_IMAGE is fired
|
|
2023-12-08 05:41:27
|
this is counterintuitive and kinda weird
|
|
|
Demiurge
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxldec.c
https://git.ffmpeg.org/gitweb/ffmpeg.git/blob/HEAD:/libavcodec/libjxlenc.c
|
|
2023-12-08 05:44:22
|
possibly relevant: https://patchwork.ffmpeg.org/project/ffmpeg/patch/20231208173106.165084-1-leo.izen@gmail.com/
|
|
|
Demiurge
|
2023-12-08 06:45:36
|
Unfortunately I'm not sure who the best person to talk to is, when it comes to API suggestions or being an authority on the public API
|
|
|
Traneptora
|
|
Demiurge
Unfortunately I'm not sure who the best person to talk to is, when it comes to API suggestions or being an authority on the public API
|
|
2023-12-08 07:35:51
|
I just ask in <#848189884614705192>
|
|
2023-12-08 07:36:08
|
I don't think there's any authority, just the yellownames are the ones who make the decisions
|
|
2023-12-08 07:47:48
|
btw, with regard to libjxl, do you have to call `JxlDecoderSetCms` before you can use a CMS on decode, and if so, how do you get the default CMS interface?
|
|
|
spider-mario
|
2023-12-08 07:48:46
|
I believe that currently, we set it to ours by default
|
|
2023-12-08 07:49:38
|
sorry, no, I had that mixed up with the encoder
|
|
|
Traneptora
|
2023-12-08 07:50:11
|
is there a way to call `JxlDecoderSetDefaultCms()`
|
|
|
spider-mario
|
2023-12-08 07:50:16
|
you get it through the new `libjxl_cms` which contains `JxlGetDefaultCms()`
|
|
|
Traneptora
|
|
spider-mario
you get it through the new `libjxl_cms` which contains `JxlGetDefaultCms()`
|
|
2023-12-08 07:50:46
|
I don't see this function in https://libjxl.readthedocs.io/en/latest/
|
|
|
spider-mario
|
2023-12-08 07:51:24
|
it’s here: https://github.com/libjxl/libjxl/blob/main/lib/jxl/cms/jxl_cms.h
|
|
|
Traneptora
|
|
spider-mario
it’s here: https://github.com/libjxl/libjxl/blob/main/lib/jxl/cms/jxl_cms.h
|
|
2023-12-08 07:52:42
|
this looks like it requires <jxl/jxl_cms_export.h>
|
|
2023-12-08 07:53:06
|
I don't see where that's located
|
|
|
spider-mario
|
2023-12-08 07:53:16
|
we should be building that now, but maybe we forget to install it?
|
|
|
Traneptora
|
|
spider-mario
it’s here: https://github.com/libjxl/libjxl/blob/main/lib/jxl/cms/jxl_cms.h
|
|
2023-12-08 07:53:52
|
where is this installed?
|
|
2023-12-08 07:54:55
|
this is what I have installed
|
|
2023-12-08 07:54:57
|
```
leo@gauss ~ :) $ ll .local/include/jxl/
total 252K
-rw-r--r-- 1 root root 1.9K May 22 2023 butteraugli_cxx.h
-rw-r--r-- 1 root root 5.1K May 22 2023 butteraugli.h
-rw-r--r-- 1 leo leo 10K Oct 5 23:02 cms_interface.h
-rw-r--r-- 1 leo leo 15K Oct 5 23:02 codestream_header.h
-rw-r--r-- 1 leo leo 5.6K Oct 5 23:02 color_encoding.h
-rw-r--r-- 1 leo leo 1.9K Oct 5 23:02 decode_cxx.h
-rw-r--r-- 1 leo leo 69K Nov 25 21:31 decode.h
-rw-r--r-- 1 leo leo 1.9K Oct 5 23:02 encode_cxx.h
-rw-r--r-- 1 leo leo 68K Dec 2 22:04 encode.h
-rw-r--r-- 1 leo leo 1.1K Dec 8 09:45 jxl_cms_export.h
-rw-r--r-- 1 leo leo 950 Oct 5 23:02 jxl_export.h
-rw-r--r-- 1 leo leo 1.2K Oct 5 23:02 jxl_threads_export.h
-rw-r--r-- 1 leo leo 2.1K Oct 5 23:02 memory_manager.h
-rw-r--r-- 1 leo leo 6.5K Oct 5 23:02 parallel_runner.h
-rw-r--r-- 1 leo leo 2.3K Sep 27 08:19 resizable_parallel_runner_cxx.h
-rw-r--r-- 1 leo leo 2.7K Sep 27 08:19 resizable_parallel_runner.h
-rw-r--r-- 1 leo leo 2.9K Oct 5 23:02 stats.h
-rw-r--r-- 1 leo leo 2.3K Sep 27 08:19 thread_parallel_runner_cxx.h
-rw-r--r-- 1 leo leo 2.5K Sep 27 08:19 thread_parallel_runner.h
-rw-r--r-- 1 leo leo 5.0K Nov 25 21:31 types.h
-rw-r--r-- 1 leo leo 1.1K Nov 25 21:31 version.h
```
|
|
|
spider-mario
|
2023-12-08 07:55:47
|
oops, it seems we are not installing the headers
|
|
2023-12-08 07:56:05
|
we install the .a/.dll/.so, as well as the .pc, but not the headers
|
|
|
Traneptora
|
2023-12-08 07:56:37
|
```
$ grep -ERHnI -e 'JxlGetDefaultCms' .local/include/jxl/ || echo "Not Found"
Not Found
```
|
|
|
spider-mario
oops, it seems we are not installing the headers
|
|
2023-12-08 07:57:31
|
it also appears that jxl_cms is now a required depedency of jxl-dec, which it shouldn't be
|
|
2023-12-08 07:57:36
|
see: https://github.com/libjxl/libjxl/issues/3009
|
|
|
spider-mario
we install the .a/.dll/.so, as well as the .pc, but not the headers
|
|
2023-12-08 08:00:10
|
https://github.com/libjxl/libjxl/issues/3010 opened an issue for tracking purposes
|
|
|
spider-mario
|
|
Traneptora
see: https://github.com/libjxl/libjxl/issues/3009
|
|
2023-12-08 08:01:05
|
I’ve just tried just not telling cmake to link jxl_dec to jxl_cms, to see what kind of dependency we have there
|
|
2023-12-08 08:01:45
|
we have these:
```
C:/msys64/mingw64/bin/ld: lib/libjxl_dec.a(decode.cc.obj):decode.cc:(.text$_ZN3jxl13ColorEncoding12FromExternalERK16JxlColorEncoding[_ZN3jxl13ColorEncoding12FromExternalERK16JxlColorEncoding]+0x55): undefined reference to `JxlCmsCreateProfile'
C:/msys64/mingw64/bin/ld: lib/libjxl_dec.a(color_encoding_internal.cc.obj):color_encoding_int:(.text+0x9b): undefined reference to `JxlCmsCreateProfile'
C:/msys64/mingw64/bin/ld: lib/libjxl_dec.a(dec_xyb.cc.obj):dec_xyb.cc:(.text+0x253b): undefined reference to `JxlCmsPrimariesToXYZ'
```
|
|
2023-12-08 08:02:07
|
as far as I remember (I’ll double check), those don’t actually depend on lcms2/skcms
|
|
2023-12-08 08:02:14
|
perhaps we could move them
|
|
2023-12-08 08:02:31
|
(to yet another library? 😵💫 )
|
|
|
Traneptora
|
2023-12-08 08:03:12
|
what if these are in their own object files that can be linked into either jxl_cms or jxl_dec
|
|
|
spider-mario
|
2023-12-08 08:03:24
|
yeah, probably something like that
|
|
|
Traneptora
|
2023-12-08 08:03:25
|
since you typically won't be using both
|
|
|
spider-mario
|
2023-12-08 08:07:05
|
at first glance, it does seem like the implementation of those functions does not depend on jxl_cms.cc
|
|
2023-12-08 08:07:11
|
there is only some dependency the other way around
|
|
|
|
veluca
|
2023-12-08 08:09:26
|
that makes sense
|
|
2023-12-08 08:09:37
|
I am so annoyed with this refactor...
|
|
|
Demiurge
|
2023-12-08 08:21:44
|
There should be an install script in the build system to install (or even use or link with) libjpeg from "jpegli"
|
|
2023-12-08 08:23:36
|
and the libjpeg example programs cjpeg, djpeg, jpegtran could also be imported into the source tree, from libjpeg-turbo for example, since I think those programs merely interface with the public libjpeg API
|
|
|
Traneptora
|
|
Demiurge
and the libjpeg example programs cjpeg, djpeg, jpegtran could also be imported into the source tree, from libjpeg-turbo for example, since I think those programs merely interface with the public libjpeg API
|
|
2023-12-08 09:27:45
|
jpegli only provides the v6 api atm
|
|
2023-12-08 09:28:07
|
cjpeg djpeg etc. on a variety of systems interface with the v8 api
|
|
2023-12-08 09:28:12
|
which makes libjpegli not a drop in replacement
|
|
|
|
afed
|
2023-12-08 09:34:45
|
and this isn't for changing version compatibility?
https://github.com/libjxl/libjxl/pull/2473
|
|
|
Demiurge
|
|
Traneptora
jpegli only provides the v6 api atm
|
|
2023-12-08 09:54:05
|
I thought libjpeg-turbo supports api 6b
|
|
|
Traneptora
|
|
Demiurge
I thought libjpeg-turbo supports api 6b
|
|
2023-12-08 09:54:21
|
it does, if you build it that way
|
|
2023-12-08 09:54:32
|
but some systems by default build libjpeg.so as libjpeg.so.8
|
|
|
Demiurge
|
2023-12-08 09:55:44
|
Yes, like Arch. But either way, that means it should be possible to just import the cjpeg/djpeg/jpegtran tools from libjpeg-turbo and compile them with libjxl "jpegli" libjpeg
|
|
|
Traneptora
|
|
Demiurge
|
2023-12-08 09:56:05
|
Assuming they use the public API like I think they do
|
|
|
Traneptora
|
2023-12-08 09:56:09
|
they do
|
|
|
afed
and this isn't for changing version compatibility?
https://github.com/libjxl/libjxl/pull/2473
|
|
2023-12-08 09:56:34
|
I don't know. v6 and v8 are incompatible in both directions so I'm not sure how this would work
|
|
2023-12-08 09:56:51
|
changing the so version number without changing the actual incompatibilities doesn't make sense
|
|
|
Demiurge
|
2023-12-08 09:57:36
|
It would probably be a good idea to import those tools into the libjxl source tree
|
|
|
Traneptora
|
2023-12-08 09:57:45
|
god no
|
|
2023-12-08 09:57:57
|
what we definitely don't need is more external repositories imported into the source tree
|
|
2023-12-08 09:58:09
|
they already shouldn't be doing that in the first place
|
|
|
Demiurge
|
2023-12-08 09:58:09
|
No, not an external repo
|
|
|
Traneptora
|
2023-12-08 09:58:15
|
that's even worse
|
|
2023-12-08 09:58:33
|
just lifting code from another repo and dropping into your repo is a bad idea
|
|
|
Demiurge
|
2023-12-08 09:58:40
|
Just the .c files with unneeded stuff removed
|
|
|
Traneptora
|
2023-12-08 09:58:46
|
god no
|
|
2023-12-08 09:59:04
|
that's how security vulnerabilities stay unfixed
|
|
|
Demiurge
|
2023-12-08 09:59:21
|
Uh, god yes? It's necessary if libjxl is going to be a drop-in replacement for libjpeg library and binaries
|
|
|
Traneptora
|
2023-12-08 09:59:40
|
why would you copy and paste code
|
|
|
Demiurge
|
2023-12-08 09:59:46
|
Why wouldn't you?
|
|
|
Traneptora
|
2023-12-08 09:59:56
|
because that's how security vulnerabilities and bugs stay unfixed
|
|
2023-12-08 10:00:02
|
god created dynamic linking for a reason
|
|
|
Demiurge
|
2023-12-08 10:00:11
|
It's just the standard libjpeg example tools
|
|
|
Traneptora
|
2023-12-08 10:00:24
|
sure, and those work perfectly fine without copy/paste
|
|
2023-12-08 10:00:29
|
there's literally no reason to include them
|
|
|
Demiurge
|
2023-12-08 10:01:04
|
You don't want to have external dependencies on some other competing libjpeg library provider, that's stupid.
|
|
|
Traneptora
|
2023-12-08 10:01:17
|
you just don't need to include them at all
|
|
|
Demiurge
|
2023-12-08 10:01:31
|
there is already cjpegli/djpegli
|
|
|
Traneptora
|
2023-12-08 10:01:36
|
good, keep it that way
|
|
|
Demiurge
|
|
Traneptora
|
2023-12-08 10:01:52
|
because they're actually different pieces of code
|
|
2023-12-08 10:01:59
|
if all you are doing is copying and pasting code you shouldn't be doing that
|
|
|
Demiurge
|
2023-12-08 10:02:11
|
ideally it should be a drop-in replacement.
|
|
|
Traneptora
|
2023-12-08 10:02:15
|
it already is
|
|
|
Demiurge
|
2023-12-08 10:02:35
|
so they should be renamed and ideally provide jpegtran too
|
|
|
Traneptora
|
2023-12-08 10:02:37
|
tbh you could rename cjpegli to cjpeg and djpegli to djpeg and you'd get the same user interface. there's no reason to literally copy and paste code
|
|
|
Demiurge
|
2023-12-08 10:02:45
|
so that everything is in the expected place and works as expected
|
|
|
Traneptora
tbh you could rename cjpegli to cjpeg and djpegli to djpeg and you'd get the same user interface. there's no reason to literally copy and paste code
|
|
2023-12-08 10:03:21
|
that's true, assuming that cjpegli/djpegli parse arguments the same way.
|
|
|
Traneptora
|
2023-12-08 10:03:27
|
you could always make them
|
|
2023-12-08 10:03:28
|
¯\_(ツ)_/¯
|
|
2023-12-08 10:03:37
|
but there's generally no need for that
|
|
2023-12-08 10:04:02
|
many things claiming to have "gzip-compatible" switches are not actually gzip-compatible
|
|
2023-12-08 10:04:07
|
and are not literal drop in replacements with gzip
|
|
2023-12-08 10:04:10
|
people won't expect that to work
|
|
2023-12-08 10:04:32
|
but if you want to, you could do that
|
|
2023-12-08 10:04:50
|
copying and pasting someone else's code into your repository is how bugs and vulnerabilities don't get fixed
|
|
|
Demiurge
|
2023-12-08 10:04:58
|
if cjpegli and djpegli have the same argument syntax as cjpeg and djpeg, then they should just be renamed. And jpegtran should be imported (copy+paste, with non-applicable/dead code removed)
|
|
|
Traneptora
|
2023-12-08 10:05:21
|
lolno
|
|
2023-12-08 10:05:31
|
copying and pasting someone else's code into your repository is how bugs and vulnerabilities don't get fixed
|
|
2023-12-08 10:06:01
|
this is not a hypothetical gripe btw, this is a real problem that actually happens IRL
|
|
|
Demiurge
|
2023-12-08 10:06:02
|
copy and pasting is what you DO when you fork something
|
|
|
Traneptora
|
2023-12-08 10:06:08
|
<:Weirdga:839363765559885844>
|
|
2023-12-08 10:06:30
|
when you fork something it *becomes your code*
that's not what you are suggesting
|
|
|
Demiurge
|
2023-12-08 10:06:40
|
You're essentially making a fork of jpegtran when you copy jpegtran.c and remove things that don't apply to jpegli
|
|
|
Traneptora
|
2023-12-08 10:06:45
|
you are literally not
|
|
2023-12-08 10:06:47
|
but okay
|
|
|
Demiurge
|
2023-12-08 10:07:01
|
What exactly would you "literally" call it then?
|
|
|
Traneptora
|
2023-12-08 10:07:10
|
copying and pasting someone else's code into your repository
|
|
2023-12-08 10:07:15
|
that's not forking
|
|
2023-12-08 10:07:18
|
that's not what a fork is
|
|
|
Demiurge
|
2023-12-08 10:17:40
|
If you already have a libjpeg but not a jpegtran, it makes no sense to start from scratch
|
|
2023-12-08 10:19:15
|
Copying it from an existing implementation is what you do. You only copy what you need and what's applicable.
|
|
|
spider-mario
|
2023-12-08 11:45:06
|
I hardly see a point in a jpegli-using `jpegtran`, to be honest
|
|
2023-12-08 11:45:50
|
as far as I can tell, none of what `jpegtran` can do makes any use of jpegli’s strengths
|
|
2023-12-08 11:47:02
|
its point is precisely not to decode and reencode image data
|
|
|
sklwmp
|
|
Traneptora
I don't know. v6 and v8 are incompatible in both directions so I'm not sure how this would work
|
|
2023-12-09 12:24:38
|
Don't know how, but it (sort of?) does. On Arch, which uses v8, I sometimes LD_PRELOAD jpegli when converting to JPG.
Seems to work fine for me.
|
|
|
Demiurge
|
|
spider-mario
as far as I can tell, none of what `jpegtran` can do makes any use of jpegli’s strengths
|
|
2023-12-09 01:08:24
|
I know, but, for completeness sake, to be a complete replacement it would have to come with that utility… Like I said maybe a standalone jpegtran can just be copypasted from libjpeg-turbo
|
|
|
|
afed
|
2023-12-09 05:43:38
|
why is lcms2 more commonly used, compared to skcms, because it is installed by default in most distros?
|
|
|
spider-mario
|
2023-12-09 07:19:27
|
it tends to support more stuff (e.g. more profile types, more rendering intents)
|
|
2023-12-09 07:19:30
|
and it’s quite battle-tested
|
|
2023-12-09 07:20:37
|
AFAIK, skcms is exercised mainly by Chrome, which doesn’t do that much with it (for example, it assumes that all monitor profiles have the sRGB tone curve)
|
|
|
|
ajekb78
|
2023-12-10 09:30:50
|
Also skcms appears to have no useful API documentation except the code itself. I had a quick look, it feels very much like something Google uses internally and open sourced but don't really care about much. And knowing Google they'll get bored and randomly cancel it. Not much incentive to move away from lcms2.
|
|
|
w
|
2023-12-10 09:37:58
|
it's been around for a long time and is what's used in chromium
|
|
|
|
ajekb78
|
2023-12-10 10:18:34
|
Which is Google codebase. Just my opinion but it just doesn't look appealing to use unless you have to. Poor documentation, not widely adopted, doesn't appear to offer anything that lcms can't do.
|
|
|
w
|
2023-12-10 10:20:17
|
just like jxl 🤓
|
|
|
|
ajekb78
|
2023-12-10 10:20:41
|
(and I should add that's one of the things I've found best about libjxl, the documentation is thorough and accessible and the examples are really helpful. The only thing I think could be improved (unless I've missed it) is a note saying which API version functions appeared at.)
|
|
|
novomesk
|
2023-12-10 11:19:02
|
If skcms has a proper release or if libjxl bundle the skcms sources in released tar.gz, it would be easier for maintainers to use it.
Maintainers have lot of work and when there is something not standard or complicated, they prefer to do something else.
It is convenient to use lcms2 because it is properly packaged and available everywhere.
|
|
|
spider-mario
|
2023-12-10 11:33:36
|
the main advantage skcms has is arguably execution speed
|
|
2023-12-10 11:34:06
|
if feature-completeness, reliability or accuracy are more important, I would tend to favour lcms2
|
|
|
Demiurge
|
2023-12-10 02:06:56
|
lcms has a gpl speed increasing module
|
|
2023-12-10 02:11:27
|
GPL license means libjxl can’t bundle it or depend on it
|
|
|
MSLP
|
2023-12-10 03:20:00
|
so an unofficial GPL libjxl fork might use them?
|
|
|
|
veluca
|
2023-12-10 04:02:55
|
IMO whether to use such a module is a decision best left to applications
|
|
|
Demiurge
|
2023-12-10 05:20:21
|
Yeah, I don't think there's any reason why libjxl itself would need to depend on it
|
|
|
bonnibel
|
2023-12-10 07:34:05
|
its not a separate dependency either afaik, its bundled w lcms2, just need to #include the relevant header & do a function call to register the plugin
|
|
|
gomer
|
2023-12-10 07:40:39
|
are the `tps_numerator` and `tps_denominator` in `JxlAnimationHeader` supposed to be flipped? i'm implementing encoding animated jpeg xl's in ffmpeg using the library, but for some reason
```c
info->animation.tps_numerator = frame->time_base.num;
info->animation.tps_denominator = frame->time_base.den;
```
produces long files, but it works correctly when i flip them
i'm using `0.8.1` from linux mint's repos
|
|
|
spider-mario
|
2023-12-10 09:40:50
|
long files as decoded/displayed by what?
|
|
|
bonnibel
|
2023-12-11 01:34:37
|
hey remember how my literal one libjxl contribution was opening a file in binary rather than image mode bc otherwise windows fucks it up
|
|
2023-12-11 01:35:04
|
turns out stdin and stdout are also in text mode so windows cant read images from / write to there properly lol
|
|
2023-12-11 01:36:25
|
& freopen doesnt seem to work for stdin/out on windows (at least not on vscode2022 clang). stackexchange suggested some windows specific api, _setmode, so i just did that for my local build for now but someone who actually knows c can hopefully do a better fix
|
|
|
Quackdoc
|
2023-12-11 01:37:50
|
are you talking about pipe | command? if so that likely powershell issue you are talking about shells like nu and cmd work fine, and piping in programming should also be fine
|
|
|
bonnibel
|
2023-12-11 01:38:33
|
nope i'm just piping in bytes programatically
|
|
|
Quackdoc
|
2023-12-11 01:39:19
|
hmm...
|
|
|
bonnibel
|
2023-12-11 01:39:39
|
ive checked reading from stdin and it is just that (at least anything using tools::ReadFile) interprets the input stream as text rather than binary
|
|
2023-12-11 01:40:27
|
so it converts \r\n to \n (inside image data) and ends way before the actual data does, presumably because it encountered a null byte and read that as the end of the "text"
|
|
2023-12-11 01:40:41
|
setting the stdin mode to rb fixes this and makes everything work how its supposed to
|
|
|
Demiurge
|
2023-12-11 02:33:36
|
https://learn.microsoft.com/en-us/cpp/c-runtime-library/text-and-binary-mode-file-i-o
|
|
2023-12-11 02:33:53
|
Sounds like Microsoft brain damage
|
|
2023-12-11 02:34:30
|
Again I’m surprised how something so broken and shitty can even exist
|
|
|
yurume
|
2023-12-11 04:30:22
|
more like why people failed to agree on newline sequences, which made MS had to adapt to C which was designed with Unix in mind and add a new mode
|
|
|
Demiurge
|
2023-12-11 04:31:43
|
Could have added text translation stuff to windows.h or better yet, not be broken in the first place
|
|
|
yurume
|
2023-12-11 04:33:06
|
well that dates long back to the DOS era, so...
|
|
|
w
|
2023-12-11 05:54:25
|
it's not broken it's just different
|
|
|
Demiurge
|
2023-12-11 09:09:52
|
Well if it's different in a way that pointlessly breaks existing portable C code then I'd say it's broken in the worst way.
|
|
2023-12-11 09:16:17
|
If there's no reason, after reading the spec, for a developer to expect the implementation to mangle or "translate" the content of file descriptors, or that the implementation should assume that stdin and stdout are "text" and should have filtering and translation applied to them, and the implementation does that anyways, then it's utterly broken garbage
|
|
|
w
|
2023-12-11 09:17:06
|
you can say the same in reverse
|
|
|
Demiurge
|
2023-12-11 09:18:18
|
Nothing in the C programming language says developers should assume stdin and stdout or any other file descriptors should have their contents filtered or translated and changed without the developer explicitly asking for that
|
|
2023-12-11 09:18:55
|
But on Windows the developer has to explicitly ask for it NOT to be changed/translated
|
|
2023-12-11 09:19:31
|
There's no reason to assume stdin or stdout are text by default either.
|
|
|
w
|
2023-12-11 09:19:53
|
I think it's reasonable when the only stdin and stdout is a console/printer
|
|
|
Demiurge
|
2023-12-11 09:19:59
|
Nothing about the language specification would give anyone that idea
|
|
|
w
|
2023-12-11 09:20:33
|
well it's use is entirely contextual
|
|
|
Demiurge
|
|
w
I think it's reasonable when the only stdin and stdout is a console/printer
|
|
2023-12-11 09:20:42
|
it often is, but that's just one case and it's common for stdin and stdout to be fed into other programs in pipelines
|
|
|
w
|
2023-12-11 09:20:54
|
at the time it was the only case
|
|
2023-12-11 09:21:13
|
hindsight 2020
|
|
|
Demiurge
|
2023-12-11 09:24:55
|
I wasn't there and I don't know the history of _fmode and related braindead microsoft things
|
|
2023-12-11 09:25:08
|
The article says nothing about the history
|
|
|
w
|
2023-12-11 09:25:09
|
well you weren't there so you can't call it braindead
|
|
|
Demiurge
|
2023-12-11 09:25:34
|
Well the fact that it's even still a thing that matters today is pretty braindead
|
|
2023-12-11 09:26:03
|
I can't talk about back then since I know nothing about its history and I can't find any articles about its history
|
|
|
w
|
2023-12-11 09:26:53
|
by that you can infer that at the time nobody could agree to a standard
|
|
2023-12-11 09:28:13
|
well, everything is a product of its time
|
|
2023-12-11 09:28:19
|
i imagine in 100 years people will be complaining about using C
|
|
2023-12-11 09:28:22
|
and not like
|
|
2023-12-11 09:28:29
|
G
|
|
2023-12-11 09:28:54
|
or like why are we using english and not mandarin
|
|
2023-12-11 09:31:30
|
I used to think like you until I started working on a 30 year old code base for work so I'm kind of passionate about this
|
|
|
Demiurge
|
2023-12-11 09:40:36
|
Well it's pretty easy to recognize braindead stuff at first glance, isn't it? The stuff we complain about today is usually things people warned about back when it was first designed.
|
|
2023-12-11 09:41:25
|
Also I still can't find any information about the history of the "file descriptor translation mode" idea but everything points to it being a Microsoft-exclusive idea, and they did not invent DOS.
|
|
|
w
|
2023-12-11 09:52:39
|
it is how it is
|
|
|
Demiurge
|
2023-12-11 10:06:43
|
The only information I can find on it, is relatively recent, and from Microsoft themselves... Pipelines were a pretty big deal on Unix, and C and Unix were made at the same time by the same team.
|
|
2023-12-11 10:07:56
|
So it would make sense if you're implementing a C environment, not to assume the developer wants the data they read from file descriptors to be silently mangled without them asking for it
|
|
2023-12-11 10:11:09
|
I don't think DOS even has a concept of file descriptors.
|
|
|
lonjil
|
|
Demiurge
Nothing in the C programming language says developers should assume stdin and stdout or any other file descriptors should have their contents filtered or translated and changed without the developer explicitly asking for that
|
|
2023-12-11 10:12:10
|
C11 says stdin and stdout are text streams, see §7.21.3, ¶7:
> At program startup, three text streams are predefined and need not be opened explicitly — standard input (for reading conventional input), standard output (for writing conventional output), and standard error (for writing diagnostic output).
(and the previous section says text streams may be mangled to hell and back)
|
|
2023-12-11 10:13:33
|
And many different environments mangle text streams, not only Windows / DOS.
|
|
2023-12-11 10:13:54
|
(actually, a good number of embedded systems mangle binary streams too!)
|
|
|
Demiurge
|
2023-12-11 10:17:29
|
So the C11 spec says it's ok to mangle pipelines by default? Well if true, I guess I stand corrected...
|
|
2023-12-11 10:18:32
|
Still seems pretty braindead without a specified standard way to request not to mangle
|
|
|
w
|
2023-12-11 10:19:06
|
why i hate finger pointing
|
|
2023-12-11 10:19:31
|
also gotta consider the mac
|
|
2023-12-11 10:19:32
|
even more odd
|
|
|
Demiurge
|
2023-12-11 10:22:55
|
Well what Lonnie says is news to me. Nothing I have ever read when reading about C has ever suggested to me that I should assume or expect file descriptors to lie to me about their contents
|
|
2023-12-11 10:23:09
|
Like this for example... https://pubs.opengroup.org/onlinepubs/9699919799/functions/stdin.html
|
|
2023-12-11 10:24:25
|
I don't remember anything in the K&R book telling me to assume file descriptors don't actually pass through their actual contents to me when I read or write to them.
|
|
|
w
|
2023-12-11 10:24:43
|
I think the cause for exception is the terminal stdin
|
|
|
Demiurge
|
2023-12-11 10:25:02
|
But maybe the K&R book actually did warn me about it and I don't remember.
|
|
|
w
|
2023-12-11 10:25:16
|
like how do you differentiate EOF from new line when typing
|
|
|
Demiurge
|
2023-12-11 10:25:38
|
ctrl+D usually sends the EOF signal
|
|
|
w
|
2023-12-11 10:26:29
|
or how do you put a newline inside a single line of input
|
|
|
Demiurge
|
2023-12-11 10:26:42
|
Newline just sends a newline character
|
|
2023-12-11 10:27:25
|
You can read past the newline character, but a lot of standard functions in the C library are designed to stop at a newline.
|
|
|
w
|
2023-12-11 10:27:39
|
oh but if it's a text file it might have different newlines so maybe it needs translation
|
|
2023-12-11 10:27:49
|
<:trollface:834012731710505011>
|
|
|
Demiurge
|
2023-12-11 10:33:35
|
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getline.html
|
|
2023-12-11 10:34:29
|
Well the C language doesn't really care what a newline is.
|
|
2023-12-11 10:35:18
|
If a system sends CRLF as a newline then the getline function implementation in the C library can just use CRLF as the delimiter
|
|
2023-12-11 10:36:00
|
getline is just a variant of getdelim
|
|
|
Quackdoc
|
2023-12-11 10:40:57
|
well the fopen stuff has been around since at least windows xp if but iirc windows 98
|
|
2023-12-11 10:48:44
|
actually yeah it would have been windows 9x since it was at the very least availible in 1998
|
|
|
Traneptora
|
|
gomer
are the `tps_numerator` and `tps_denominator` in `JxlAnimationHeader` supposed to be flipped? i'm implementing encoding animated jpeg xl's in ffmpeg using the library, but for some reason
```c
info->animation.tps_numerator = frame->time_base.num;
info->animation.tps_denominator = frame->time_base.den;
```
produces long files, but it works correctly when i flip them
i'm using `0.8.1` from linux mint's repos
|
|
2023-12-11 11:20:49
|
tps is in units of ticks per second, ffmpeg timebase units are in seconds
|
|
2023-12-11 11:21:07
|
so you have to flip it
|
|
2023-12-11 11:21:42
|
see avformat/jxl_animdec.c
|
|
|
Demiurge
Nothing in the C programming language says developers should assume stdin and stdout or any other file descriptors should have their contents filtered or translated and changed without the developer explicitly asking for that
|
|
2023-12-11 11:23:11
|
actually the C programming language by K&R book does tell you this
|
|
2023-12-11 11:23:39
|
Lemme pull out my copy, I have one in paper
|
|
|
lonjil
|
|
Demiurge
Well the C language doesn't really care what a newline is.
|
|
2023-12-11 11:43:43
|
with text streams, the expectation is that the OS newline will be translated to and from `\n` (which will be LF if you use ASCII, but if you don't use ASCII `\n` may be something else.)
|
|
|
|
ajekb78
|
2023-12-11 11:45:05
|
What is the recommended approach to handling thumbnails for a jpeg XL file? The application I'm adding support to has a thumbnail getter which has a few bespoke functions for FITS, XISF etc but for most files it uses exiv to look for a thumbnail added to the file as metadata. I haven't been saving exiv2 thumbnails because adding a small copy of the image as metadata feels like it goes against the jpeg XL focus on good compression ratios. On the other hand I haven't found any specific libjxl thumbnail-related functions and I don't really want to have to do a full decode of every jxl image in a directory just to produce a thumbnail.
|
|
|
lonjil
|
|
lonjil
with text streams, the expectation is that the OS newline will be translated to and from `\n` (which will be LF if you use ASCII, but if you don't use ASCII `\n` may be something else.)
|
|
2023-12-11 11:45:11
|
So if stdout wasn't a text stream, trying to write a new line to the console wouldn't work for normal C code that uses `\n` to indicate newlines.
|
|
|
Demiurge
|
2023-12-11 11:46:15
|
If you’re dealing with strings and characters, but what about read() and write()?
|
|
|
lonjil
|
2023-12-11 11:46:51
|
what do you mean?
|
|
|
yoochan
|
|
ajekb78
What is the recommended approach to handling thumbnails for a jpeg XL file? The application I'm adding support to has a thumbnail getter which has a few bespoke functions for FITS, XISF etc but for most files it uses exiv to look for a thumbnail added to the file as metadata. I haven't been saving exiv2 thumbnails because adding a small copy of the image as metadata feels like it goes against the jpeg XL focus on good compression ratios. On the other hand I haven't found any specific libjxl thumbnail-related functions and I don't really want to have to do a full decode of every jxl image in a directory just to produce a thumbnail.
|
|
2023-12-11 11:49:01
|
which app ? I heard that if you decode only the first block you get a 8:1 downsampled image (with var DCT)
|
|
2023-12-11 11:49:17
|
but I don't know how to get the size of the first block
|
|
2023-12-11 11:50:10
|
the idea is that, since the format is progressive, a truncated file can be a valid image file, where to truncate it to have consistent results is the main issue
|
|
|
|
ajekb78
|
2023-12-11 11:53:53
|
I'm adding support to Siril, which is an astrophotography processing programme. Jpeg XL is nice for a couple of use cases there - both for high quality lossy versions for web display (once browser support improves) and for a more space efficient format for lossless archiving of final renders.
|
|
|
Demiurge
|
2023-12-11 12:02:13
|
https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html
|
|
|
gomer
|
|
Traneptora
so you have to flip it
|
|
2023-12-11 12:02:47
|
oh okay, then flipping them was the correct solution. thanks!
|
|
|
Demiurge
|
|
lonjil
what do you mean?
|
|
2023-12-11 12:03:35
|
I mean reading data from a file descriptor…
|
|
|
|
ajekb78
|
|
yoochan
but I don't know how to get the size of the first block
|
|
2023-12-11 12:04:14
|
Thanks, that was the clue I needed, it looks like getting the JXL_DEC_FRAME_PROGRESSION should indicate when there is enough data for the 8x downsampled version.
|
|
|
lonjil
|
|
Demiurge
I mean reading data from a file descriptor…
|
|
2023-12-11 12:05:59
|
read(), write(), and file descriptors don't exist in standard C.
|
|
|
Traneptora
|
2023-12-11 12:06:06
|
those are UNIX system calls
|
|
2023-12-11 12:06:17
|
you should expect them to do what UNIX does
|
|
2023-12-11 12:06:33
|
(later, retrofitted to POSIX)
|
|
|
Demiurge
|
2023-12-11 12:06:40
|
Windows has file descriptors and fopen()
|
|
|
Traneptora
|
2023-12-11 12:06:55
|
Windows is not a POSIX system so you shouldn't expect POSIX-compliance
|
|
2023-12-11 12:07:00
|
cause it does not make that promise
|
|
2023-12-11 12:07:08
|
POSIX != portable
|
|
2023-12-11 12:07:29
|
even if it has some features that look similar to POSIX features
|
|
|
Demiurge
|
2023-12-11 12:07:35
|
I thought we were talking about Windows mangling data when reading from file descriptors
|
|
|
yoochan
|
2023-12-11 12:07:44
|
don't you want to fight in <#806898911091753051> ?
|
|
|
w
|
2023-12-11 12:07:48
|
no
|
|
2023-12-11 12:07:50
|
it has to be here
|
|
|
yoochan
|
|
ajekb78
Thanks, that was the clue I needed, it looks like getting the JXL_DEC_FRAME_PROGRESSION should indicate when there is enough data for the 8x downsampled version.
|
|
2023-12-11 12:08:39
|
nice ! I'll be curious to learn what percentage of the image is required for this 🙂 on average
|
|
|
Traneptora
|
|
yoochan
nice ! I'll be curious to learn what percentage of the image is required for this 🙂 on average
|
|
2023-12-11 12:09:54
|
generally you only need the LF groups for this
|
|
2023-12-11 12:10:01
|
which is a small fraction
|
|
2023-12-11 12:10:13
|
not sure I could give you a % based on average photographic content encoded with libjxl though
|
|
|
yoochan
|
2023-12-11 12:10:23
|
rough average
|
|
|
ajekb78
Thanks, that was the clue I needed, it looks like getting the JXL_DEC_FRAME_PROGRESSION should indicate when there is enough data for the 8x downsampled version.
|
|
2023-12-11 12:13:19
|
siril looks like a nice project, je bookmarke
|
|
|
jonnyawsom3
|
|
yoochan
rough average
|
|
2023-12-11 06:42:14
|
Just based on some tests I did the other day, around 14% seemed to be reliable, but this was on maybe half a dozen images rather than *actual* benchmarking
|
|
2023-12-11 06:42:48
|
Varies based on image and encoder/decoder settings
|
|
|
|
afed
|
|
afed
maybe add options for larger cache, memory consumption would also be higher, but still much smaller than normal mode and predictable and not depending on image size?
|
|
2023-12-12 06:07:11
|
<:Poggers:805392625934663710>
https://github.com/libjxl/libjxl/pull/3017
|
|
|
|
veluca
|
|
afed
<:Poggers:805392625934663710>
https://github.com/libjxl/libjxl/pull/3017
|
|
2023-12-13 12:52:14
|
that was one fun review xD
|
|
|
|
afed
|
|
veluca
that was one fun review xD
|
|
2023-12-13 01:24:04
|
the same is planned for lossless?
maybe it will help in slowdowns
i haven't compared decoding speeds, but smaller individual blocks may also be slower to decode for lossless?
|
|
|
|
veluca
|
2023-12-13 01:30:27
|
Lossless -e1 already does that
|
|
2023-12-13 01:30:46
|
I'm trying to speed lossless up right now 🙂
|
|
2023-12-13 01:30:55
|
(and possibly to finish a few more things, but that will not happen today)
|
|
2023-12-13 01:52:04
|
https://github.com/libjxl/libjxl/pull/3020 that was easier than I expected
|
|
|
Miku
|
2023-12-13 12:28:10
|
Is this a bug in libjxl? https://github.com/ImageMagick/ImageMagick/issues/3397
|
|
2023-12-13 12:29:46
|
I have the same issue, developer of ImageMagick think libjxl developers may help
|
|
|
|
veluca
|
2023-12-13 12:54:05
|
at best you can call it a bug in the JPEG spec
|
|
2023-12-13 12:54:15
|
JPEG decoders are not required to give you the same pixels
|
|
|
spider-mario
|
2023-12-13 12:55:14
|
right, that the .jxl can be used to reconstruct the .jpg bit-exactly doesn’t imply that decoding the .jpg with one library (presumably libjpeg-turbo or mozjpeg) and the .jxl with another (libjxl) will return the same pixels
|
|
2023-12-13 12:55:20
|
(and arguably, the pixels returned by libjxl are better)
|
|
|
Miku
|
2023-12-13 01:41:28
|
that makes sense, thank you.
|
|
|
qdwang
|
2023-12-13 05:56:28
|
Can someone explain how to enable the steaming encoding mode in nightly? https://github.com/libjxl/libjxl/pull/3017 This has already been merged.I tried to have a test. But it still consumes a lot of memory.
|
|
|
|
afed
|
2023-12-13 06:04:24
|
probably `--streaming_input --streaming_output` and most likely works only for ppm
|
|
|
qdwang
|
2023-12-13 06:15:14
|
thanks i'll have a try
|
|
|
|
veluca
|
|
afed
probably `--streaming_input --streaming_output` and most likely works only for ppm
|
|
2023-12-13 06:39:25
|
that is certainly true
|
|
|
veluca
https://github.com/libjxl/libjxl/pull/3020 that was easier than I expected
|
|
2023-12-13 08:57:47
|
Windows version done too
|
|
2023-12-13 08:57:54
|
(not that I tested it...)
|
|
|
|
afed
|
|
veluca
(not that I tested it...)
|
|
2023-12-13 09:58:56
|
windows
https://discord.com/channels/794206087879852103/803645746661425173/1184615338319548538
|
|
|
|
veluca
|
|
afed
windows
https://discord.com/channels/794206087879852103/803645746661425173/1184615338319548538
|
|
2023-12-13 10:03:37
|
That seems pretty reasonable
|
|
|
|
afed
|
2023-12-13 10:06:50
|
except with these os-specific stuff now ProcProfile doesn't hook the file size <:YEP:808828808127971399>
`0 -> 60,601,160: 0.00%. real 152 mb/s (0.379 sec) = 94%. ram 135896 KB, vmem 7980 KB`
|
|
|
|
veluca
|
2023-12-13 10:08:37
|
that's not surprising, but it should still work on a machine with much less ram than image data
|
|
|
|
afed
|
2023-12-13 10:20:12
|
streaming mode is faster by internal jxl benchmark, but by external timers it seems to be somewhat slower, not sure which one is right
|
|
|
|
veluca
|
2023-12-13 10:23:48
|
it's quite surprising that it would be faster
|
|
|
qdwang
|
2023-12-14 03:53:04
|
I'm trying to understand how `JxlEncoderAddChunkedFrame` works. I tried to encode a 6000 * 6000 image with streaming encoding. But as I run the `JxlEncoderAddChunkedFrame`, the `get_color_channel_data_at` runs only once and print `xpos: 0, ypos: 0, xsize: 6000, ysize: 6000, row_offset: 0`(shouldn't it be several times?).
|
|
2023-12-14 03:53:50
|
should i set the width and height to 2048 in basic_info? but this will result in a 2048 * 2048 output.
|
|
2023-12-14 03:58:52
|
The doc says it's a callback function and xsize and ysize will be at most 2048. Why can I get a 6000 * 6000 in the function? https://libjxl.readthedocs.io/en/latest/api_encoder.html#_CPPv4N26JxlChunkedFrameInputSource25get_color_channel_data_atE
|
|
2023-12-14 07:13:58
|
After using the main branch nightly version, the `row_offset` shows up randomly. Sometimes it is `1` and sometimes it becomes very big like `5383389184` or `5525995520`. Is it a bug? Older version like `v0.9.x` doesn't have this issue.
|
|
|
spider-mario
|
2023-12-14 07:39:06
|
that sounds suspicious
|
|
2023-12-14 07:39:19
|
are you in a position to bisect this easily?
|
|
|
qdwang
|
2023-12-14 07:50:06
|
oh, in release mode, it will always be big int like `1538260754305061192` or `17104812128822824508`, it won't be `1` anymore. The branch `v0.9.x` has no problem in release mode.
|
|
|
spider-mario
are you in a position to bisect this easily?
|
|
2023-12-14 07:50:20
|
I'm trying
|
|
2023-12-14 08:07:38
|
oh, i got it wrong. The row_offset should be set by the callee.
|
|
2023-12-14 08:14:45
|
no problems now
|
|
|
Traneptora
|
2023-12-15 10:19:41
|
<@303475549517512704> are you by any chance the one I've been talking to on the FFmpeg mailing list about libjxl_anim encoder?
|
|
|
gomer
|
2023-12-15 10:20:17
|
hello, that's right
|
|
|
Traneptora
|
2023-12-15 10:32:40
|
noice, good work btw
|
|
2023-12-15 10:32:51
|
this is something I've been meaning to do for a while and I just really haven't gotten around to it
|
|
2023-12-15 10:32:57
|
glad that it's getting some love
|
|
|
gomer
|
2023-12-15 10:43:42
|
thanks, i just wanted to see how it compares to gif and saw that there's not really a way to transcode into animated jxl
|
|
|
Traneptora
|
2023-12-15 10:44:31
|
np. the issue with packetization earlier is that it's not clearly defined for JXL
|
|
2023-12-15 10:44:48
|
and the container format 18181-2 makes things significantly more difficult to packetize it
|
|
|
gomer
|
2023-12-15 10:50:15
|
i don't really know what 18181-2 specifies because i haven't read it, but i'm fine with only emitting a single packet if that's preferable
|
|
|
Demiurge
|
2023-12-16 08:04:00
|
I was testing out cjpegli and djpegli just now, and when using the --xyb flag with cjpegli, the image appears to turn into vertical stripes. Even after using djpegli to create a decoded file.
|
|
|
Traneptora
|
|
Demiurge
I was testing out cjpegli and djpegli just now, and when using the --xyb flag with cjpegli, the image appears to turn into vertical stripes. Even after using djpegli to create a decoded file.
|
|
2023-12-16 08:50:45
|
post sample image that does this?
|
|
2023-12-16 08:50:55
|
or is it every image
|
|
2023-12-16 09:02:30
|
I can't reproduce this
|
|
|
Demiurge
|
2023-12-16 11:37:22
|
It's every image. It is after I install libjxl, but with "install jpegli libjpeg" set to false
|
|
2023-12-16 11:38:44
|
So the jpegli tools are installed but not libjpeg.
|
|
2023-12-16 11:39:48
|
The tools are linked with the system libjpeg according to ldd
|
|