|
|
veluca
|
|
spider-mario
ah there is another commit “Don’t crash” after that
|
|
2021-09-10 11:54:24
|
seems useful 😛
|
|
|
spider-mario
|
2021-09-10 11:56:46
|
alright, I think I see how it works
|
|
2021-09-10 11:57:09
|
I predict that the hardest part will be to rearrange the processing so that the splines are drawn at the right time and all that :p
|
|
2021-09-10 11:57:33
|
updating the spline drawing itself doesn’t look hard
|
|
2021-09-10 11:58:27
|
it almost approaches making JXL a vector format
|
|
2021-09-10 11:59:16
|
(just with extremely basic vector primitives and very advanced bitmap capabilities)
|
|
|
_wb_
|
2021-09-10 12:52:08
|
spec says to first apply patches, then splines, then noise, and then do upsampling and color conversion
|
|
2021-09-10 12:52:33
|
so technically it's not correct to do something else
|
|
2021-09-10 12:53:48
|
I don't mind changing it to do splines after upsampling, that does seem better, but it requires a spec change (we can do it in the 2nd edition)
|
|
2021-09-10 12:55:12
|
while we're at it: it might also make sense to have spline coords in the upsampled image, not in the downsampled image, but that's an even bigger spec change because it will totally change the way things look if splines + upsampling is used
|
|
2021-09-10 12:57:34
|
(having the coords in the upsampled image allows more accurate splines, and would be needed if you want to do something like spline-based text with an upsampled photo background)
|
|
2021-09-10 12:58:01
|
(then again, you can always put the spline on the next frame which is not downsampled, if you want to do that)
|
|
|
|
veluca
|
2021-09-10 01:37:39
|
pretty sure it says to do noise *after* upsampling 😛
|
|
|
_wb_
|
2021-09-10 02:03:58
|
oh right
|
|
2021-09-10 02:04:22
|
spec says first upsample, then patches, then splines, then noise, then color conversion
|
|
2021-09-10 02:05:08
|
|
|
2021-09-10 02:05:21
|
I was confused by this figure, which is not quite completely correct
|
|
|
|
veluca
|
2021-09-10 02:06:08
|
there's no upsampling
|
|
2021-09-10 02:06:15
|
are you sure it says upsample first?
|
|
2021-09-10 02:06:33
|
what we do today is patches -> splines -> upsample -> noise
|
|
|
_wb_
|
2021-09-10 02:06:37
|
the upsampling from L.7 and L.8 is done first, then K.2 (patches), K.3 (splines), K.4 (noise), and then anything else from Annex L
|
|
2021-09-10 02:07:08
|
|
|
2021-09-10 02:08:07
|
ugh
|
|
2021-09-10 02:08:46
|
so we're doing it wrong? or the spec is wrong? or I'm missing something?
|
|
2021-09-10 02:10:19
|
oh wait
|
|
2021-09-10 02:10:42
|
new_sample is the sample from the patch frame
|
|
2021-09-10 02:10:50
|
old_sample is the sample from the current frame
|
|
2021-09-10 02:11:25
|
so this says only that patch frames have to be upsampled before they are stored for future reference
|
|
2021-09-10 02:14:14
|
|
|
2021-09-10 02:15:57
|
that's kind of vague
|
|
2021-09-10 02:16:06
|
"after decoding", what does that mean
|
|
2021-09-10 02:16:36
|
I can't find anything specific in the spec saying when exactly the upsampling is supposed to be done
|
|
2021-09-10 02:18:01
|
Figure 2 and the text around it doesn't mention upsampling specifically, it only mentions Annex L in general (which includes both upsampling and color transforms)
|
|
2021-09-10 02:18:41
|
another thing to put on my list of "things to clarify/fix in the second edition of the spec"
|
|
2021-09-10 03:59:49
|
anyway
|
|
2021-09-10 03:59:59
|
Looks like we're getting ready for a v0.6 release!
|
|
2021-09-10 04:01:22
|
|
|
2021-09-10 04:01:51
|
|
|
2021-09-10 04:02:29
|
these blended emojis are fun but why does it make such huge images, haha
|
|
|
Traneptora
|
2021-09-10 05:00:34
|
where can I find libjxl documentation
|
|
2021-09-10 05:00:43
|
docs/api.txt just says "generate html docs"
|
|
2021-09-10 05:00:54
|
is it not something I can just find on a webserver somewhere?
|
|
|
|
veluca
|
2021-09-10 05:03:07
|
I think in build/html if you build it yourself
|
|
2021-09-10 05:03:21
|
a prebuilt version... IDK
|
|
2021-09-10 05:03:49
|
asking 🙂
|
|
|
Traneptora
|
2021-09-10 05:06:10
|
`file:///usr/share/doc/libjxl/index.html` giving me a blank page
|
|
2021-09-10 05:06:16
|
well not blank, it's got doxygen boilerplate
|
|
2021-09-10 05:06:19
|
but no content
|
|
2021-09-10 05:08:49
|
is the library just not well documented?
|
|
|
|
veluca
|
2021-09-10 05:09:08
|
I'm not sure where the doxygen stuff is
|
|
|
Traneptora
|
2021-09-10 05:09:26
|
|
|
2021-09-10 05:09:29
|
I mean
|
|
2021-09-10 05:09:32
|
this
|
|
|
|
veluca
|
2021-09-10 05:09:33
|
but in `/usr/include/libjxl/*.h` there's a few comments that should give some documentation
|
|
|
Traneptora
|
2021-09-10 05:09:35
|
there's no docs
|
|
2021-09-10 05:09:58
|
why documentation in comments in header files when we have doxygen
|
|
|
|
veluca
|
2021-09-10 05:10:24
|
in theory doxygen should give you something
|
|
2021-09-10 05:10:28
|
not sure what went wrong
|
|
|
Traneptora
|
2021-09-10 05:10:36
|
I've never used the API before. what I'd like is a quickstart intro to showcase its use
|
|
|
|
veluca
|
2021-09-10 05:11:10
|
ah
|
|
2021-09-10 05:11:14
|
go to "Files"
|
|
2021-09-10 05:11:30
|
nah, we don't have that yet unfortunately - try reading `examples/decode_oneshot.cc`
|
|
|
Traneptora
|
2021-09-10 05:15:07
|
ah, that helps thanks
|
|
|
w
|
|
_wb_
|
|
2021-09-10 06:00:52
|
Where can I see this document?
|
|
|
_wb_
|
2021-09-10 06:06:15
|
Nowhere unless you're an ISO member, atm
|
|
2021-09-10 06:06:18
|
Unfortunately
|
|
2021-09-10 06:06:53
|
I hope for the second edition, we can make a public Committee Draft that will be identical in content to the published standard
|
|
|
BlueSwordM
|
2021-09-10 06:06:57
|
Actually, isn't it possible for a company like Google to just pay an X/year fee for the spec to be available to everyone?
|
|
|
_wb_
|
2021-09-10 06:07:13
|
Nope, not afaik
|
|
|
Traneptora
|
2021-09-10 06:08:29
|
I've always hated that the ISO charges for specs
|
|
|
_wb_
|
2021-09-10 06:08:53
|
Afaik ISO only has two options:
- paywall
- no paywall (but nobody knows how you can get that done for non-trivial specs)
|
|
2021-09-10 06:09:17
|
Giving them money to just drop the paywall is not an option, afaik
|
|
|
Traneptora
|
2021-09-10 06:09:18
|
Option 3: neither just give them away
|
|
2021-09-10 06:09:31
|
the software itself is given away
|
|
2021-09-10 06:09:33
|
why can't the spec
|
|
|
_wb_
|
2021-09-10 06:10:08
|
I am legally not allowed to do that because a condition for participating in ISO standardization is that you transfer copyright to ISO
|
|
|
Traneptora
|
2021-09-10 06:10:19
|
Ah, so they own the copyright
|
|
2021-09-10 06:10:38
|
but what I meant was, why can't *they* just give it a way
|
|
|
_wb_
|
2021-09-10 06:10:51
|
So while I literally wrote a big chunk of that spec (together with other jxl devs), we cannot just publish it
|
|
2021-09-10 06:10:58
|
They get income from selling specs
|
|
2021-09-10 06:11:06
|
It's a private company
|
|
2021-09-10 06:11:19
|
They have two main sources of income
|
|
2021-09-10 06:11:33
|
Selling specs, and membership fees
|
|
|
Traneptora
|
2021-09-10 06:11:54
|
it's especially funny when I found that ISO apparently charges for the MPEG-4 AVC spec
but the H.264 spec is available for free from the ITU's website.
|
|
|
_wb_
|
2021-09-10 06:12:08
|
I have to pay (or rather, Cloudinary pays for me) to be an ISO member
|
|
2021-09-10 06:12:57
|
Yeah, they're cracking down on ITU too now though, lots of stuff that used to be available through ITU is getting removed there so ISO can sell it
|
|
|
Traneptora
|
2021-09-10 06:14:15
|
you say "cracking down" but it's a division of the UN
|
|
|
_wb_
|
2021-09-10 06:14:27
|
Yeah
|
|
2021-09-10 06:14:44
|
ISO is bullying ITU somehow
|
|
|
w
|
2021-09-10 06:14:44
|
this sucks
|
|
|
Scope
|
2021-09-10 06:14:47
|
Perhaps some pirate sites like LibGen may have ISO papers
|
|
|
_wb_
|
2021-09-10 06:14:53
|
https://docs.google.com/document/d/12Gmy2s4Nmkw6VDv2B6b5K1DLYhPrTUqSntrlmYzJpNw/edit?usp=drivesdk
|
|
|
w
|
2021-09-10 06:15:46
|
lmao it's actually on libgen thank god
|
|
|
_wb_
|
2021-09-10 06:16:00
|
I am trying to get something going, but it might be a bit too much of a niche thing to get significant public attention
|
|
|
lithium
|
2021-09-10 06:23:47
|
we need a site like this 😛
> www.iso.onion
|
|
|
Traneptora
|
2021-09-10 06:24:42
|
speaking of ITU
|
|
2021-09-10 06:24:51
|
is this goign to become ITU-T recommendtion T.900 or something
|
|
|
_wb_
|
2021-09-10 06:27:36
|
No, for some reason I don't quite understand, jxl is only an ISO/IEC project, not an ITU one
|
|
2021-09-10 06:28:56
|
(the reason has something to do with Gary Sullivan from Microsoft not wanting jxl to be an ITU recommendation, but I don't really know why not)
|
|
|
w
|
2021-09-10 06:31:07
|
for splines, it is unclear what the coordinates should be in. It's unspecified for the starting points in that doc, but in libjxl, starting points are floats and control points in QuantizedSpline are deltas as integers. Is there a reason why everything isn't just floats?
|
|
|
lithium
|
2021-09-10 06:33:51
|
> Gary Sullivan
> he became a founding co-chairman of the
> Joint Video Experts Team (JVET) that developed the Versatile Video Coding (VVC) standard
Something not quite right...🤔
|
|
|
Traneptora
|
2021-09-10 06:39:33
|
<@!288069412857315328> I found a previous draft of the spec free on ISO's website
|
|
2021-09-10 06:39:39
|
and by I found I mean JEEB found
|
|
|
_wb_
|
|
w
for splines, it is unclear what the coordinates should be in. It's unspecified for the starting points in that doc, but in libjxl, starting points are floats and control points in QuantizedSpline are deltas as integers. Is there a reason why everything isn't just floats?
|
|
2021-09-10 06:44:19
|
<@604964375924834314> any idea what is correct? I think everything is encoded using ints, right?
|
|
|
Traneptora
<@!288069412857315328> I found a previous draft of the spec free on ISO's website
|
|
2021-09-10 06:45:55
|
The CD is the last draft ISO lets us publish, for DIS, FDIS and IS they don't allow it
|
|
2021-09-10 06:46:22
|
That one is for part 2, the file format, not part 1, the core codestream
|
|
2021-09-10 06:47:11
|
Unfortunately the CD versions are quite early drafts, not very correct compared to the final draft
|
|
|
Nova Aurora
|
|
_wb_
https://docs.google.com/document/d/12Gmy2s4Nmkw6VDv2B6b5K1DLYhPrTUqSntrlmYzJpNw/edit?usp=drivesdk
|
|
2021-09-10 06:51:09
|
Nice, seems like you have a few big names behind you there <:Hypers:808826266060193874>
|
|
|
w
|
2021-09-10 06:56:10
|
It would be great if everything can be encoded as floats. It would also be good with upsampling
|
|
|
_wb_
|
2021-09-10 07:12:53
|
We cannot change the bitstream anymore
|
|
2021-09-10 07:13:29
|
We could consider interpreting the int coords in the upsampled image though, as opposed to the downsampled one
|
|
2021-09-10 07:14:56
|
Spec isn't super clear on when exactly to do upsampling, so it's not really set in stone yet what exactly to do when there are splines+upsampling
|
|
2021-09-10 07:15:28
|
(which is an issue a second edition can clarify/fix)
|
|
|
Traneptora
|
2021-09-10 07:26:58
|
speaking of that, what pixel formats does jxl support
|
|
|
_wb_
|
2021-09-10 07:27:27
|
The bitstream spec itself is formulated in terms of mathematical real numbers
|
|
2021-09-10 07:28:13
|
You can in principle signal bitdepths up to 64-bit, iirc
|
|
2021-09-10 07:28:31
|
(for lossless)
|
|
2021-09-10 07:28:52
|
For lossy, it's all defined as infinite-precision arithmetic in the spec
|
|
2021-09-10 07:29:07
|
And it is a matter of conformance how accurate you have to implement it
|
|
2021-09-10 07:29:28
|
In practice though:
|
|
2021-09-10 07:29:55
|
Libjxl does everything internally with standard single precision floats
|
|
2021-09-10 07:30:14
|
So 8 exponent bits, 24 mantissa bits
|
|
2021-09-10 07:30:40
|
(23 explicit mantissa bits, 1 implicit one, and a sign bit)
|
|
2021-09-10 07:31:05
|
Modular mode does things with int32_t
|
|
2021-09-10 07:32:35
|
The libjxl implementation supports lossless up to 24-bit uint, and lossless float of anything that fits into a single precision float
|
|
2021-09-10 07:32:56
|
(which includes bfloat16, binary16, fp24 and binary32)
|
|
2021-09-10 07:33:19
|
So we can do lossless compression of pfm
|
|
2021-09-10 07:33:26
|
Or openEXR
|
|
2021-09-10 07:34:06
|
For lossy, we have plenty of precision internally
|
|
2021-09-10 07:34:50
|
As far as the API is concerned, we're trying to keep it simple and define only a few pixel formats
|
|
2021-09-10 07:35:35
|
I think we have uint8, uint16, binary16 (half-float) and binary32 (float)
|
|
2021-09-10 07:36:27
|
That's regarding the single sample representation
|
|
2021-09-10 07:37:07
|
A pixel format is also about how multiple components are represented
|
|
2021-09-10 07:37:49
|
The spec doesn't really say anything about that, since that's an implementation question
|
|
2021-09-10 07:38:12
|
Libjxl internally uses planar representations atm, not interleaved
|
|
2021-09-10 07:39:23
|
The API only has interleaved formats atm, afaik. RGB, RGBA, and I think we will likely add permutations like BGR and ignored-alpha (RGBX)
|
|
2021-09-10 07:39:42
|
That is for the main color channels plus alpha
|
|
2021-09-10 07:40:02
|
The remaining extra channels are handled in a planar way also in the API
|
|
2021-09-10 07:41:39
|
The bitstream supports RGB, YCbCr (444, 422, 420 and 440), and CMYK
|
|
2021-09-10 07:44:19
|
For lossy we usually use XYB (an absolute colorspace with nice perceptual properties), for lossless we have YCoCg-R and a bunch of other reversible color transforms, which can be switched up per group (tile)
|
|
2021-09-10 07:46:06
|
There are a bunch of extra channels where the spec defines what they mean, like depth, temperature, the K of CMYK, selection masks, spot colors, and additional alpha channels.
|
|
2021-09-10 07:47:07
|
And you can have custom extra channels that have a name and a type id that you can set to inform the decoder if it can safely just ignore that extra channel or not
|
|
2021-09-10 07:48:13
|
Every extra channel can have its own bitdepth and dimension shift (1x, 2x, 4x or 8x downsampled)
|
|
2021-09-10 07:49:45
|
So what pixel formats does jxl support? I think pretty much anything any image format has ever supported, and then some
|
|
|
Traneptora
|
|
_wb_
The API only has interleaved formats atm, afaik. RGB, RGBA, and I think we will likely add permutations like BGR and ignored-alpha (RGBX)
|
|
2021-09-10 07:56:40
|
If you plan on adding extra permutations then GBR planar is another one
|
|
2021-09-10 07:57:01
|
I do think that exposing the planar format makes sense
|
|
2021-09-10 07:57:07
|
but not doing anything with it other than telling you the order
|
|
2021-09-10 07:57:41
|
it seems unecessary to me to store it internally as planar, export only an interface as packed, so callers then have to unpack it back from packed to planar
|
|
2021-09-10 07:58:19
|
while I understand a lot of these things are for convience for the caller, there should be an option to request the more basic format in case someone has their own more optimized (or empty) way to handle it
|
|
|
_wb_
So what pixel formats does jxl support? I think pretty much anything any image format has ever supported, and then some
|
|
2021-09-10 08:00:21
|
thanks, this is pretty cool. I think only EXR has it beat since it supports 32-bit integer
|
|
2021-09-10 08:00:33
|
also JPEG does not support "Oy Vey!"
|
|
2021-09-10 08:00:42
|
my nickname for packed UYVY422
|
|
|
_wb_
|
2021-09-10 08:06:35
|
The internal representation is not just planar, it's also using padding on the left and right
|
|
2021-09-10 08:07:10
|
(that's needed if you want to be able to do simd without lots of edge cases)
|
|
|
Traneptora
|
2021-09-10 08:08:08
|
well isn't that just with a variable rowstride
|
|
|
_wb_
|
|
Traneptora
|
2021-09-10 08:08:58
|
in either case, packing a buffer only for it to be unpacked back to planar is kind of disappointing
|
|
2021-09-10 08:09:21
|
I think if the internal buffer is planar it should at least be exposed as an option
|
|
2021-09-10 08:09:28
|
to receive planar RGB
|
|
2021-09-10 08:09:38
|
(although BGR makes more sense since the rest of the spec is little endian)
|
|
|
_wb_
|
2021-09-10 08:09:50
|
Yeah, for applications that want planar I suppose it would make sense to just get access to the internal representation
|
|
2021-09-10 08:10:15
|
Though it's a bit more complicated than that: we don't always keep the full decoded buffer internally
|
|
|
Traneptora
|
2021-09-10 08:10:31
|
I didn't mean necessarily a pointer reference to it
|
|
2021-09-10 08:10:48
|
just, rather than pack it and return packed, just don't pack it. and then return it not packed.
|
|
|
_wb_
|
2021-09-10 08:11:33
|
Yes, makes sense
|
|
|
BlueSwordM
|
2021-09-11 05:49:15
|
So, I know this might sound strange, but can butteraugli_main actually be made faster?
|
|
|
_wb_
|
2021-09-11 05:52:38
|
I assume it can, but I dunno
|
|
|
BlueSwordM
|
|
_wb_
I assume it can, but I dunno
|
|
2021-09-11 05:53:50
|
Is downscaling the input a viable strategy for lots of inputs, IE when processing thousands of frames from a video to get the average pooled butteraugli score?
|
|
|
_wb_
|
2021-09-11 06:00:29
|
Downscaling? Maybe, if you're interested in high distance... But of course d1 on a 1:2 image means something else than d1 on the 1:1 image
|
|
2021-09-11 06:01:33
|
Depending on the use case, you maybe could do cropping (look only at the middle of each frame)
|
|
2021-09-11 06:02:59
|
But likely there are also just speed optimizations possible or computationally good-enough approximations to just speed it up without having to make such compromises
|
|
|
BlueSwordM
|
|
_wb_
But likely there are also just speed optimizations possible or computationally good-enough approximations to just speed it up without having to make such compromises
|
|
2021-09-11 06:07:16
|
I see. It is just that I prefer not using VMAF much for pure quality evaluation(rather than just compression efficiency) since the current VMAF models don't exactly take into account color performance, or in some of its metrics, not at all. Even metrics that are supposedly more "accurate" than VMAF like Fraunhofer's XPSNR aren't actually better in that regard, or are even worse.
butteraugli in that regard works much better and is usually better psycho-visually speaking, especially in challenging scenarios(low luminance/low contrast scenes).
The only problem is that the compute requirements in video for butteraugli are a lot higher than something like VMAF, which makes it tricky to use in large comparisons.
|
|
|
_wb_
|
2021-09-11 06:13:34
|
Something like dssim/ssimulacra might also work
|
|
2021-09-11 06:14:02
|
(ms-ssim in Lab space)
|
|
|
BlueSwordM
|
|
_wb_
(ms-ssim in Lab space)
|
|
2021-09-12 12:43:53
|
Yeah, SSIMulacra is indeed a lot faster.
|
|
2021-09-12 01:02:29
|
```[bluezakm@bluezakmpc ~]$ ssimulacra_main '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31.ppm' '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.ppm'
0.02659602
[bluezakm@bluezakmpc ~]$ time ssimulacra_main '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31.ppm' '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.ppm'
0.02659602
real 0m0.491s
user 0m0.441s
sys 0m0.049s
[bluezakm@bluezakmpc ~]$ time butteraugli_main '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31.ppm' '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.ppm'
1.8718318939
3-norm: 0.685487
real 0m1.322s
user 0m1.263s
sys 0m0.102s
```
|
|
|
BlueSwordM
```[bluezakm@bluezakmpc ~]$ ssimulacra_main '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31.ppm' '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.ppm'
0.02659602
[bluezakm@bluezakmpc ~]$ time ssimulacra_main '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31.ppm' '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.ppm'
0.02659602
real 0m0.491s
user 0m0.441s
sys 0m0.049s
[bluezakm@bluezakmpc ~]$ time butteraugli_main '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31.ppm' '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.ppm'
1.8718318939
3-norm: 0.685487
real 0m1.322s
user 0m1.263s
sys 0m0.102s
```
|
|
2021-09-12 01:14:21
|
MTed DSSIM:
```time dssim '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31.png' '/home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.png'
0.00086633 /home/bluezakm/Pictures/Test/SonicGenerations 2020-05-28 17-21-31_lul.png
real 0m0.313s
user 0m1.212s
sys 0m0.183s
```
|
|
|
mastercooker
|
2021-09-12 11:48:16
|
Does anyone have any ideas to debug a `JXL_ENC_ERROR` result from `JxlEncoderAddImageFrame`? I am thinking I might have to compile with debug messages added in manually. Or maybe compiling with debug symbols and using gdb. It seems strange that there is no better error distinction than just returning `JXL_ENC_ERROR` for every error - it would be very beneficially to have something like printing to stderr, even if it had to be enabled at runtime.
|
|
|
_wb_
|
2021-09-13 05:31:30
|
We want to avoid bloating binary size of the library by having lots of error strings in it, but yes, it would be good to have at least a debug compile option where there are useful errors.
|
|
|
|
veluca
|
2021-09-13 06:33:27
|
you can avoid stripping debug messages
|
|
2021-09-13 06:33:46
|
say by compiling with CMAKE_BUILD_TYPE=relwithdebinfo
|
|
|
mastercooker
|
|
veluca
say by compiling with CMAKE_BUILD_TYPE=relwithdebinfo
|
|
2021-09-13 07:49:16
|
Thank You, that might make it viable to debug with gdb
|
|
|
|
veluca
|
2021-09-13 08:17:13
|
it *should* also make JXL_API_ERROR print a message on the CLI
|
|
|
mastercooker
|
2021-09-13 05:32:59
|
Thank You, that helped a lot. Turns out I forgot to account for the 3 channels when providing the buffer size, I just did `width * height * sizeof(float)`
|
|
2021-09-13 05:33:10
|
Now it is kind of working XD
|
|
|
_wb_
|
2021-09-13 05:41:33
|
Heh time for <#805007255061790730>
|
|
|
mastercooker
|
2021-09-13 05:44:13
|
good idea lol
|
|
|
_wb_
|
2021-09-13 06:11:38
|
What is going wrong here? Wrong buffer format?
|
|
|
mastercooker
|
2021-09-13 11:53:11
|
not quite sure, it is quite strange
|
|
2021-09-13 11:53:46
|
you can see very clearly in this image it seems to be splitting the image into fourths, overlaying those splits, then repeating the overlay three times
|
|
2021-09-13 11:53:51
|
|
|
2021-09-13 11:55:40
|
anyway I dont think its a libjxl bug
|
|
2021-09-13 11:55:59
|
just a result of me not giving libjxl the right data
|
|
|
|
veluca
|
2021-09-14 12:13:56
|
that's the usual kind of stuff you get when you get strides wrong, FWIW
|
|
|
_wb_
|
2021-09-14 05:15:03
|
Yes, maybe stride is not multiplied by 3?
|
|
|
mastercooker
|
2021-09-14 03:08:14
|
idk if this is better or not
|
|
2021-09-14 03:08:27
|
feel like its a slight improvement...
|
|
2021-09-14 03:34:57
|
With lossless mode output now looks perfect!
|
|
2021-09-14 03:35:02
|
Thanks for the advice
|
|
2021-09-14 03:36:05
|
It was a stride issue
|
|
2021-09-14 03:36:34
|
there are still some weird artifacts when encoding it in lossy though
|
|
2021-09-14 03:37:18
|
|
|
|
_wb_
|
2021-09-14 04:00:18
|
what kind of quality setting is that?
|
|
|
mastercooker
|
2021-09-14 04:00:47
|
14
|
|
2021-09-14 04:00:53
|
oh
|
|
2021-09-14 04:00:59
|
I just realised I forgot to invert the scale
|
|
2021-09-14 04:01:10
|
because its as distance
|
|
2021-09-14 04:01:14
|
so smaller should be higher quality
|
|
|
|
Deleted User
|
2021-09-14 04:07:22
|
I see only 8x8 blocks in these lossy encodes... Maybe something else is wrong, too?
|
|
|
_wb_
|
2021-09-14 04:17:43
|
It's indeed quite blocky, what encode effort is this?
|
|
2021-09-14 04:18:22
|
Is it distance 14? That is very lossy of course
|
|
|
mastercooker
|
2021-09-14 04:35:57
|
Yes, it was distance 14
|
|
2021-09-14 04:36:18
|
Now I have fixed it so that a quality setting of 14 will be transformed into a distance setting of 1.0
|
|
2021-09-14 04:36:31
|
this is the output now and it looks great
|
|
|
fab
|
2021-09-14 04:38:37
|
are you trying to make a new heuristics
|
|
2021-09-14 04:39:18
|
so the encoder isn't changed
|
|
|
mastercooker
|
2021-09-14 04:39:52
|
no, just using libjxl from the github
|
|
|
fab
|
|
mastercooker
because its as distance
|
|
2021-09-14 04:40:17
|
ok
|
|
|
_wb_
|
2021-09-14 04:41:11
|
The nice thing about software libraries is that if there are encoder improvements in the future, all applications will get them
|
|
|
fab
|
2021-09-14 04:41:56
|
does darktable work with windows 7
|
|
2021-09-14 04:42:00
|
should i install it
|
|
|
_wb_
|
2021-09-14 04:45:49
|
How are you passing the color profile?
|
|
|
mastercooker
|
2021-09-14 04:47:02
|
As an ICC binary blob
|
|
|
_wb_
|
2021-09-14 04:52:31
|
Kind of strange that you don't get the error all the time, but only at effort 5
|
|
|
mastercooker
|
2021-09-14 05:05:16
|
yeah, it works from 3-4 (on v0.5 so 1-2 are not available), but from 5 onwards it crashes
|
|
2021-09-14 05:05:31
|
I will try building from latest main and see if that fixes it
|
|
2021-09-14 05:34:49
|
switching to latest main fixed it 👍
|
|
|
novomesk
|
2021-09-14 06:52:41
|
I have one unanswered question regarding animated JXL files. I'd like to get number of total frames inside a JXL file. API let's me to decode till the end and to count them. Isn't it possible to get the number directly?
|
|
|
_wb_
|
2021-09-14 07:17:53
|
Not really
|
|
2021-09-14 07:18:20
|
It's not something that is in the global header
|
|
2021-09-14 07:19:08
|
There might be streaming use cases where an encoder doesn't know yet in advance how many frames will be encoded
|
|
2021-09-14 07:20:55
|
There is a "frame index" box defined at the file format level, which maybe contains that info (not sure actually), it's meant to make seeking easier in large files
|
|
2021-09-14 07:21:30
|
But I don't think it has been properly implemented yet, and in any case it's an optional box
|
|
2021-09-14 07:22:34
|
It should be quite fast to skip through all the frames to get the count and timing info, without actually decoding the frames
|
|
2021-09-14 07:23:50
|
(jxlinfo does that now, iirc)
|
|
|
|
veluca
|
|
mastercooker
Now I have fixed it so that a quality setting of 14 will be transformed into a distance setting of 1.0
|
|
2021-09-14 10:40:34
|
can the quality go above 14? 🙂
|
|
|
mastercooker
|
2021-09-14 11:21:53
|
Yes, 0-15, 15 would be reversed into distance of 0
|
|
|
_wb_
|
2021-09-15 05:12:37
|
I think for this use case, and assuming 0-15 is the scale it uses for all formats, it might make more sense to put d1 at 10 so there is more room for d0.5 etc
|
|
|
|
veluca
|
2021-09-15 07:15:50
|
or maybe at 12, say - I'd want something between 1.0 and 0.0
|
|
2021-09-15 07:16:02
|
and exposing d14 is likely not very useful tbh 😛
|
|
|
mastercooker
|
|
_wb_
I think for this use case, and assuming 0-15 is the scale it uses for all formats, it might make more sense to put d1 at 10 so there is more room for d0.5 etc
|
|
2021-09-15 05:57:36
|
No, the 0-15 quality slider is specific to and controlled by the jxl format module.
That’s a good idea though, I mean I could just increase the slider step range? At the moment it steps by 0.5, I could make it 0.1.
|
|
|
Scope
|
2021-09-15 06:01:39
|
I think it would be better to match `-q` in cjxl (although I don't know if libjxl has it)
``` -q QUALITY, --quality=QUALITY
Quality setting (is remapped to --distance). Range: -inf .. 100.
100 = mathematically lossless. Default for already-lossy input (JPEG/GIF).
Positive quality values roughly match libjpeg quality.```
|
|
2021-09-15 06:03:00
|
https://discord.com/channels/794206087879852103/803645746661425173/818396672081788958
|
|
|
|
veluca
|
2021-09-15 07:18:32
|
I'd match what the Gimp plugin does :D
|
|
|
|
testerrrrr
|
2021-09-15 11:40:56
|
hi, i was wondering, what is the best way to convert a jxl file to a jpeg bytestream in memory?
|
|
|
_wb_
|
2021-09-16 05:17:30
|
Arbitrary jxl or recompressed-jpeg jxl?
|
|
|
|
Deleted User
|
2021-09-16 12:14:05
|
Could somebody compile and share add-noise.exe?
|
|
2021-09-16 12:24:26
|
*plz
|
|
|
|
testerrrrr
|
|
_wb_
Arbitrary jxl or recompressed-jpeg jxl?
|
|
2021-09-16 07:27:01
|
i suppose arbitrary would be great, but i would like to know just recompressed primarily
|
|
|
_wb_
|
2021-09-16 07:28:51
|
I guess `djxl foo.jxl /tmp/bar.jpg` is the easiest way (assuming /tmp/ is a ramdisk)
|
|
2021-09-16 07:29:47
|
You can also use the api to decode to memory
|
|
|
|
testerrrrr
|
2021-09-16 07:35:23
|
ah ok, interesting ty
|
|
|
eddie.zato
|
2021-09-17 05:30:05
|
What's wrong with this .gif?
... except that it's not an anime chibi girl. 😜
|
|
2021-09-17 05:30:17
|
|
|
2021-09-17 05:30:43
|
```
PS > cjxl patrick.gif
JPEG XL encoder v0.7.0 233e5c8 [SSE4]
Corrupt or CMYK JPEG.
Failed to read image patrick.gif.
```
|
|
|
_wb_
|
2021-09-17 07:32:31
|
```
lib/extras/codec_gif.cc:147: JXL_FAILURE: GIF specifies out-of-bounds background color
```
|
|
2021-09-17 07:33:38
|
also looks like we're saying "Corrupt or CMYK JPEG" a bit too easily - it's only supposed to say that when the file looks like a JPEG but is broken
|
|
|
eddie.zato
|
2021-09-17 07:51:22
|
So is it a .gif or .jpeg? I see `GIF89a` at the beginning of the file.
|
|
2021-09-17 07:51:30
|
I used `magick` to convert it to .png, then passed it to `cjxl` since I need to add an exif comment anyway.
|
|
|
|
Deleted User
|
|
Could somebody compile and share add-noise.exe?
|
|
2021-09-17 08:20:56
|
<@!111445179587624960>, <@!179701849576833024> or anybody?
|
|
|
_wb_
|
|
eddie.zato
So is it a .gif or .jpeg? I see `GIF89a` at the beginning of the file.
|
|
2021-09-17 08:22:58
|
it's a gif
|
|
2021-09-17 08:23:16
|
a gif is also a corrupt jpeg, in a way 🙂
|
|
2021-09-17 08:23:23
|
but that error is not helpful
|
|
|
|
veluca
|
|
<@!111445179587624960>, <@!179701849576833024> or anybody?
|
|
2021-09-17 08:26:47
|
I'm traveling :D also I don't really have a real windows build environment... I guess I could cook something up but not this week for sure
|
|
|
Scope
|
2021-09-17 08:30:26
|
I will compile later, because I also need my main PC with MSYS2 and stuff
|
|
|
_wb_
|
|
eddie.zato
What's wrong with this .gif?
... except that it's not an anime chibi girl. 😜
|
|
2021-09-17 09:14:02
|
https://github.com/libjxl/libjxl/pull/601
|
|
|
Scope
|
|
Could somebody compile and share add-noise.exe?
|
|
2021-09-17 09:39:35
|
|
|
|
|
Deleted User
|
2021-09-17 09:40:08
|
<:Hypers:808826266060193874>
|
|
2021-09-17 09:40:20
|
thx
|
|
2021-09-17 09:43:12
|
... but it is not what I thought it would be ... 😄
|
|
|
fab
|
|
diskorduser
|
|
fab
avx2
|
|
2021-09-17 10:56:01
|
Hmm what avx2?
|
|
|
fab
|
2021-09-17 11:03:14
|
Addnoise.exe
|
|
|
spider-mario
|
|
... but it is not what I thought it would be ... 😄
|
|
2021-09-17 11:36:57
|
out of curiosity, what did you think it would be?
|
|
|
|
Deleted User
|
2021-09-17 01:27:44
|
I thought you could input a JXL with noise and apply the noise to another JXL. ^^
|
|
|
spider-mario
|
2021-09-17 02:27:46
|
oh, so sort of like that elusive jxltran we so much want?
|
|
|
|
Deleted User
|
|
Traneptora
|
2021-09-17 08:10:09
|
> `typedef void *(*jpegxl_alloc_func)(void *opaque, size_t size)`
|
|
2021-09-17 08:10:18
|
if you do not provide these, does it rely on libc's system malloc?
|
|
2021-09-17 08:19:25
|
it doesn't quite say what the default is
|
|
2021-09-17 08:19:57
|
also is there any practical difference to passing a memory manager struct with all entries set to NULL
|
|
|
|
veluca
|
|
Traneptora
if you do not provide these, does it rely on libc's system malloc?
|
|
2021-09-18 07:41:32
|
yup
|
|
|
Traneptora
also is there any practical difference to passing a memory manager struct with all entries set to NULL
|
|
2021-09-18 07:41:51
|
I *think* today that function call is 100% ignored
|
|
|
|
Deleted User
|
|
spider-mario
oh, so sort of like that elusive jxltran we so much want?
|
|
2021-09-18 04:59:45
|
YUP! 😃
I wrote a bit about it in https://github.com/libjxl/libjxl/issues/477
|
|
|
spider-mario
|
|
YUP! 😃
I wrote a bit about it in https://github.com/libjxl/libjxl/issues/477
|
|
2021-09-18 05:01:06
|
what you describe reminds me a little of swfmill somehow
|
|
2021-09-18 05:01:45
|
you could convert asset libraries back and forth between SWF and XML
|
|
|
w
|
2021-09-23 04:01:00
|
progressive modular works great now 👍 (in firefox with updated libjxl)
|
|
|
improver
|
2021-09-23 04:41:37
|
v nice
|
|
|
Scope
|
2021-09-23 10:08:48
|
Yep
|
|
2021-09-23 10:08:59
|
|
|
2021-09-23 10:10:02
|
So, waiting for Chrome
|
|
|
|
Deleted User
|
2021-09-23 10:56:05
|
<@111445179587624960> what's that website?
|
|
|
Scope
|
2021-09-23 10:56:22
|
https://stan-kondrat.github.io/progressive-image-viewer/
|
|
|
The_Decryptor
|
2021-09-23 10:57:20
|
That's a cool tool
|
|
|
|
Deleted User
|
2021-09-23 11:10:05
|
Indeed, thanks! 😃
|
|
|
Scope
|
2021-09-23 01:44:52
|
Unless, perhaps, this is one of the last of the progressive features that have not yet been implemented:
> Error: progressive lossless JPEG transcode is not yet implemented.
|
|
|
improver
|
2021-09-23 02:12:13
|
what exactly is progressive jpeg transcode?
|
|
|
w
|
2021-09-23 02:14:46
|
transcoding progressive jpegs always worked for me
|
|
2021-09-23 02:14:49
|
what does this mean
|
|
|
diskorduser
|
|
w
transcoding progressive jpegs always worked for me
|
|
2021-09-23 02:16:58
|
jpeg transcoded jxl?
|
|
|
The_Decryptor
|
2021-09-23 02:17:56
|
It's about the output, not input. Currently transcoding JPEG results in just the "baseline progressiveness" that JXL offers
|
|
|
Scope
|
2021-09-23 02:20:29
|
Yep, now MQIP and sequential block rendering works
|
|
2021-09-23 02:31:02
|
True progressive at ~60%
|
|
2021-09-23 02:31:26
|
Regular with center-first groups at ~60%
|
|
2021-09-23 02:37:11
|
Regular modular with center-first groups
|
|
2021-09-23 02:52:09
|
However, yes, if center-first or other custom group order is a bit more resource-intensive, it might be not a good idea to enable it by default for normal encoding, but perhaps for `--progressive` it may be useful, since this encoding option implies that progressive features are more likely to be used
|
|
|
improver
|
|
w
progressive modular works great now 👍 (in firefox with updated libjxl)
|
|
2021-09-23 08:50:00
|
how does one update firefox 3rd party stuff?
|
|
|
w
|
2021-09-23 08:50:09
|
you import the patch
|
|
2021-09-23 08:50:42
|
import this https://phabricator.services.mozilla.com/D126359
|
|
|
improver
|
2021-09-23 09:06:56
|
ok we rebuildin
|
|
2021-09-23 09:24:18
|
|
|
2021-09-23 09:24:20
|
very nice it works
|
|
2021-09-23 09:24:59
|
though progressive modular is awful size wise
|
|
|
w
|
2021-09-23 09:25:57
|
it's not progressive modular. that always worked i think
|
|
2021-09-23 09:26:05
|
it was progressive loading of non progressive modular
|
|
|
improver
|
2021-09-23 09:27:05
|
so uhh just default `-m` right?
|
|
|
w
|
2021-09-23 09:27:08
|
yeah
|
|
2021-09-23 09:27:20
|
before it didnt load until the end but now it loads in blocks
|
|
|
Scope
|
2021-09-23 09:28:01
|
Yes, except that MQIP will not work, something like an initial preview
|
|
|
improver
|
2021-09-23 09:28:01
|
|
|
2021-09-23 09:29:15
|
why is progressive modular so inefficient :<
|
|
|
Scope
|
2021-09-23 09:30:07
|
Also, `--centerfirst` may be interesting
|
|
|
w
|
2021-09-23 09:30:18
|
does that make it the same size
|
|
2021-09-23 09:30:35
|
if it does then i may have to re encode every single modular file i have
|
|
2021-09-23 09:30:35
|
...
|
|
2021-09-23 09:30:55
|
and that's going over 30000 files
|
|
|
Scope
|
2021-09-23 09:30:56
|
It increases the size slightly, from a few to hundreds of bytes
|
|
|
improver
|
2021-09-23 09:31:21
|
tbh blocky without background from center kinda makes no sense to me idk
|
|
2021-09-23 09:31:30
|
itd look weird
|
|
|
w
|
2021-09-23 09:31:34
|
hmm yeah ur right
|
|
2021-09-23 09:31:37
|
may aswell load from top down
|
|
|
improver
|
2021-09-23 09:32:48
|
playing with slider too much crashed the tab :--DDD
|
|
2021-09-23 09:33:34
|
okay this encoded image crashes tab basically
|
|
2021-09-23 09:33:41
|
|
|
2021-09-23 09:34:03
|
(firefox nightly with D126359.diff and jxl-2c2fbc870b92617a6bcda90e3976e252c47c3fbf.patch applied)
|
|
|
Scope
|
2021-09-23 09:34:05
|
For photos this is more often useful, given that loading each block separately will anyway rarely occur (only in very bad or slow connection) and usually the updates will be packs of groups
|
|
|
improver
|
2021-09-23 09:34:20
|
(it's lossy encode)
|
|
2021-09-23 09:34:39
|
vardct
|
|
|
w
|
2021-09-23 09:35:33
|
doesnt crash if you go real slowly
|
|
2021-09-23 09:37:01
|
i dont notice any difference past 300kb
|
|
|
improver
|
2021-09-23 09:37:33
|
around 60k it p much always dies for me
|
|
|
w
|
2021-09-23 09:37:35
|
nvm the difference is there but it's so tiny
|
|
2021-09-23 09:38:14
|
hmm yeah it instantly crashes at 65
|
|
2021-09-23 09:38:38
|
if it's not libjxl ill take a look at it uhhhh when im free
|
|
|
Scope
|
2021-09-23 09:39:57
|
Is this a progressive image? At about ~60-65% it will be almost like a fully loaded image
|
|
|
improver
|
2021-09-23 09:40:24
|
encoded with `-s 8 -d 0.5 --progressive`
|
|
|
Scope
|
2021-09-23 09:42:16
|
Then yep, in the beginning will be MQIP, then HQIP at 60-65% (almost full quality), maybe on HQIP something is broken
|
|
|
w
|
2021-09-23 09:42:37
|
65 as in 65kb
|
|
2021-09-23 09:42:42
|
before any image shows up
|
|
|
_wb_
|
|
w
if it's not libjxl ill take a look at it uhhhh when im free
|
|
2021-09-24 05:04:52
|
It's libjxl
|
|
|
w
|
|
_wb_
|
2021-09-24 05:05:45
|
https://github.com/libjxl/libjxl/pull/629
|
|
2021-09-24 05:05:57
|
That might fix it
|
|
|
improver
|
2021-09-24 09:36:40
|
i cant reproduce crashes with current djxl though
|
|
2021-09-24 09:42:57
|
how does one get backtrace from firefox nightly
|
|
|
w
|
2021-09-24 09:48:22
|
you build with debug on
|
|
2021-09-24 09:48:30
|
it's a pain to do so
|
|
2021-09-24 09:49:16
|
1
|
|
2021-09-24 09:49:27
|
just under 1 hour for clobber build
|
|
2021-09-24 09:49:48
|
it's not fast
|
|
|
improver
|
2021-09-24 09:50:09
|
iirc chromium compiles way slower than firefox
|
|
|
w
|
2021-09-24 09:50:20
|
chromium takes about 10 hours to download
|
|
|
Scope
|
2021-09-27 04:42:35
|
Interesting 🤔
|
|
2021-09-27 04:43:12
|
JXL `-s 2` Nomacs
|
|
2021-09-27 04:43:57
|
JXL `-s 9` Nomacs
|
|
2021-09-27 04:46:47
|
Same in jxl-winthumb, but displaying correctly in djxl and browsers
|
|
2021-09-27 04:49:01
|
Except for Firefox with the recent libjxl and with patches from <@!288069412857315328>
|
|
2021-09-27 04:49:14
|
|
|
2021-09-27 04:49:18
|
|
|
|
_wb_
|
2021-09-27 04:50:41
|
Weird
|
|
2021-09-27 04:52:59
|
Could be a bug in the new codepath that tries to reduce memory cost by decoding modular straight to the output buffer
|
|
2021-09-27 04:53:38
|
(in -e 2 it would apply, and in -e 9 probably not because the global Palette transform blocks it)
|
|
|
Scope
|
2021-09-27 04:55:21
|
Compared the other speeds and it only happens at speeds 1-4 🤔 (5-9 fine)
|
|
|
_wb_
|
2021-09-27 04:56:56
|
Could be that palette is tried at e5 and up
|
|
2021-09-27 04:57:48
|
It does look like YCoCg data being shown as RGB or something
|
|
2021-09-27 04:58:39
|
Please file a bug
|
|
2021-09-27 04:58:46
|
This is Not Good (tm)
|
|
2021-09-27 04:59:46
|
How does decode_oneshot render it?
|
|
|
Scope
|
2021-09-27 05:05:33
|
Seems to be ok (although I'm not sure if I'm using it correctly)
|
|
|
|
veluca
|
2021-09-27 05:44:22
|
what happens if you use `-e 9 --palette 0`?
|
|
|
Scope
|
2021-09-27 05:51:21
|
Same as just `-e 9`
|
|
|
|
veluca
|
2021-09-27 05:54:49
|
interesting, so apparently it's not *just* palette
|
|
2021-09-27 05:55:00
|
I'm sure Jon will be having loads of fun with it 😛
|
|
|
Scope
|
2021-09-27 06:00:01
|
Also on photo images it happens even more often (it seems that always)
|
|
|
|
veluca
|
2021-09-27 06:04:21
|
does it happen with v0.5?
|
|
|
Scope
|
2021-09-27 06:04:36
|
But, on other types, here, the colors are fine
|
|
2021-09-27 06:05:19
|
here - not
|
|
2021-09-27 06:06:24
|
Hmm, if I find an old plugin, I'll try to compare versions
|
|
2021-09-27 06:14:00
|
On an older version the colors are fine (but I don't know the exact version, something like 0.5 or older) 🤔
|
|
|
_wb_
|
2021-09-27 06:18:32
|
Whar about `-e 9 --palette 0 -X 0 -Y 0`?
|
|
2021-09-27 06:18:59
|
(to disable all kinds of palette, you also need the -X 0 -Y 0)
|
|
2021-09-27 06:19:47
|
I think it always happens when no palette is done.
|
|
2021-09-27 06:20:57
|
When it's only doing RCT and no Squeeze or Palette, it skips the global modular image and directly copies decoded modular groups to the output buffer
|
|
|
Scope
|
2021-09-27 06:23:12
|
No, nothing has changed
|
|
|
_wb_
|
2021-09-27 06:24:33
|
With -e 9 --palette 0 -X 0 -Y 0 it still looks OK?
|
|
|
Scope
|
2021-09-27 06:26:16
|
Yep
|
|
2021-09-27 06:26:46
|
`-s 2`
|
|
|
_wb_
|
2021-09-27 06:34:21
|
What about -s 2 -C 0 ?
|
|
2021-09-27 06:35:39
|
And -s 9 with all the those options but also -C 1 ?
|
|
2021-09-27 06:42:04
|
I need a way to reproduce but I don't have a patched firefox or nomacs/winthumb
|
|
|
Scope
|
2021-09-27 06:42:20
|
Yep, so it's `-c 1/0`
`-s 9 --palette 0 -X 0 -Y 0 -C 1`
|
|
2021-09-27 06:42:50
|
`-s 2 -C 0`
|
|
|
_wb_
|
2021-09-27 06:49:44
|
I suspect something is going wrong when it moves a global RCT to the group level, somehow causing it to not be undone
|
|
2021-09-27 07:42:05
|
yep, that was it
|
|
2021-09-27 07:42:12
|
https://github.com/libjxl/libjxl/pull/652
|
|
|
|
testerrrrr
|
2021-09-28 12:15:40
|
trying to use container + jpegmetadata on an image frame so as to be able to decode to a jpeg but looks like i can only decode to pixels this way?
|
|
|
_wb_
|
2021-09-28 05:24:20
|
How are you encoding/decoding?
|
|
|
Scope
|
2021-09-28 01:52:22
|
<https://github.com/libjxl/libjxl/commit/fd06f61d0e49a28b8b0894e227994b40d2e446d0>
> distance, lower = higher quality. Range: 0 .. 15.
Also, it's not up to 20 now?
|
|
|
Cool Doggo
|
2021-09-28 01:57:53
|
It is up to 25 no?
|
|
|
Scope
|
2021-09-28 01:59:28
|
Or even 25
|
|
2021-09-28 02:03:12
|
And also images with `--resampling` still do not work correctly, including in browsers and apps, it would require a lot of rewriting to fix and not so easy to find the cause?
Because, given that it is now enabled by default (with higher -d) and also can be useful for encoding, this is quite a noticeable bug
|
|
|
_wb_
|
2021-09-28 02:09:06
|
Agreed
|
|
|
improver
|
2021-09-28 02:14:38
|
imo resampling stuff should internally upsample and only give downsampled size when relevant flag is passed which would be something in lines of "plz giv downsample i can resample myself", similar with how colorspaces are handled
|
|
2021-09-28 02:15:09
|
(ive not dug into this so may be misunderstanding something)
|
|
|
w
|
2021-09-28 02:18:16
|
what's the point of resampling
|
|
|
Scope
|
2021-09-28 02:20:49
|
This way to achieve better quality with very high compression (although not for all types of content, mostly for photos)
This is something more advanced than normal downsampling/upsampling, especially when there are compression artifacts
|
|
|
improver
|
2021-09-28 02:21:51
|
it probably actually is not even exposed to users right now. so above comment of mine is silly
|
|
|
Scope
|
2021-09-28 02:36:24
|
This is a weapon for lowbpp encoding fans
|
|
2021-09-28 02:36:37
|
Source
|
|
2021-09-28 02:37:03
|
lowbpp JXL
|
|
2021-09-28 02:37:36
|
Same size lowbpp JXL (+ `--resampling=2` and `photon_noise`)
|
|
|
improver
|
2021-09-28 02:46:17
|
what abt lowbpp JXL + photon_noise
|
|
2021-09-28 02:46:45
|
to me it seems like the most of effect comes from photon_noise
|
|
2021-09-28 02:47:26
|
though some things are really more detailed in resampled version
|
|
|
Scope
|
2021-09-28 02:48:40
|
No, photon_noise cannot add details
|
|
|
improver
|
2021-09-28 02:49:33
|
yeah I see. though it looks closer to original still
|
|
2021-09-28 02:50:41
|
than non-noise lowbpp JXL I mean
|
|
|
Scope
|
2021-09-28 02:53:15
|
And for low bpp it is anyway impossible to achieve high accuracy of the image and the main goal is to reduce artifacts, save some details and create a more appealing image, in what AVIF and other video-based codecs are good, but JXL was not and this is also one of the ways to improve it
|
|
|
|
veluca
|
|
Scope
And also images with `--resampling` still do not work correctly, including in browsers and apps, it would require a lot of rewriting to fix and not so easy to find the cause?
Because, given that it is now enabled by default (with higher -d) and also can be useful for encoding, this is quite a noticeable bug
|
|
2021-09-28 04:22:46
|
that with 0.6?
|
|
|
Scope
|
2021-09-28 04:25:20
|
As far as I remember it has not worked for a long time, also in 0.5 and 0.7
|
|
|
novomesk
|
2021-09-29 06:08:30
|
I would like to see some examples how to read/write CMYK, CMYKA images via libjxl API. Is the API final/ready for CMYK or we can expect some changes?
|
|
|
_wb_
|
2021-09-29 09:42:56
|
bitstream-wise, the K is stored in an extrachannel of type kBlack
|
|
2021-09-29 09:43:09
|
and the CMY just in the RGB
|
|
2021-09-29 09:43:34
|
convention is that 0=max ink, so CMY behaves like RGB
|
|
2021-09-29 09:45:41
|
so reading it should be a matter of getting the RGB (CMY) and the kBlack extrachannel, then possibly giving those 4 channels to lcms/skcms together with the ICC profile (which should be a CMYK profile in this case) so you can convert it to something displayable
|
|
|
w
|
2021-09-29 09:47:45
|
it's all gonna be in the api right? As in output RGB.
|
|
|
_wb_
|
2021-09-29 09:48:32
|
the aim is to at some point have a high-level api that deals with color management too and that can provide RGB output also for CMYK files
|
|
2021-09-29 09:49:10
|
the low-level api can only return the CMYK itself, since full color management is out of its scope
|
|
|
w
|
2021-09-29 09:49:50
|
but with the decode API, what happens when the output format is 3 channels?
|
|
|
_wb_
|
2021-09-29 09:50:28
|
it will just give you the CMY only
|
|
2021-09-29 09:51:11
|
in the low-level api (currently the only api), you'll have to explicitly check if there's a kBlack extrachannel and separately get it
|
|
2021-09-29 09:51:35
|
or I guess you can ask 4-channel CMYK output too
|
|
2021-09-29 09:51:48
|
for CMYKA you'll definitely need to fetch either A or K separately
|
|
2021-09-29 09:52:22
|
I hope we can make a high-level api soon, it will make the task of "just show me the image" easier
|
|
|
w
|
2021-09-29 09:52:29
|
oh and I'm guessing the higher level API, when it happens, would allow to request specific output formats like RGB, gray, etc?
|
|
|
_wb_
|
2021-09-29 09:52:45
|
atm even djxl gets it wrong, https://github.com/libjxl/libjxl/pull/237 fixes that but still needs to be merged
|
|
|
w
|
2021-09-29 09:53:09
|
so right now CMYK isn't "supported"? I just don't want to worry about it
|
|
|
_wb_
|
2021-09-29 09:54:06
|
in Level 5 of jxl, CMYK/kBlack is not allowed
|
|
2021-09-29 09:54:14
|
which is what we expect browsers to implement
|
|
|
w
|
2021-09-29 09:54:20
|
oh epic
|
|
|
_wb_
|
2021-09-29 09:54:58
|
the bitstream supports it but atm it requires manually getting the kBlack and doing proper color management
|
|
|
w
|
2021-09-30 09:08:04
|
is there any plan atm for the high-level api? i figured it's something i want to contribute to
|
|
|
|
veluca
|
2021-09-30 09:09:42
|
not yet, but contributions are certainly welcome...
|
|
|
_wb_
|
2021-09-30 11:31:24
|
I suppose it can be developed as a rather thin library that depends on libjxl and some color management library, and just does something like decode/encode_oneshot (calling the low-level api to do the work) but also including color management (converting the RGB or CMYK output data to whatever RGB color space that gets requested by the application)
|
|
|
|
veluca
|
|
w
is there any plan atm for the high-level api? i figured it's something i want to contribute to
|
|
2021-09-30 03:56:19
|
https://github.com/libjxl/libjxl/issues/668
|
|
2021-09-30 03:56:25
|
you can start commenting there 😄
|
|
|
w
|
2021-09-30 04:27:03
|
nice 👍
|
|
2021-09-30 07:34:22
|
interesting progressive load
|
|
2021-09-30 07:37:51
|
(jpeg transcode)
|
|
|
_wb_
|
2021-09-30 07:40:36
|
Looks like chroma upsampling is not done when flushing? <@179701849576833024>
|
|
|
|
veluca
|
2021-09-30 07:41:29
|
ugh
|
|
2021-09-30 07:41:48
|
have I mentioned that I really really don't like chroma upsampling?
|
|
2021-09-30 07:42:11
|
but no, I think something is more broken than that
|
|
2021-09-30 07:42:23
|
what's the original image? is it a recompressed JPEG?
|
|
|
w
|
2021-09-30 07:42:48
|
```$ exiftool 001.jpg
ExifTool Version Number : 11.88
File Name : 001.jpg
Directory : .
File Size : 866 kB
File Modification Date/Time : 2020:11:05 05:31:28-08:00
File Access Date/Time : 2021:09:30 12:42:27-07:00
File Inode Change Date/Time : 2021:09:30 12:42:26-07:00
File Permissions : rwxrwxrwx
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : inches
X Resolution : 96
Y Resolution : 96
Image Width : 2078
Image Height : 3040
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 2078x3040
Megapixels : 6.3```
|
|
2021-09-30 07:42:50
|
the image is just jxl lossless transcode of this
|
|
|
_wb_
|
2021-09-30 07:47:17
|
Does look like in the top left it properly did upsampling (since AC is available and that group is finalized), but in the rest we see Y DC correctly and chroma DC without upsampling
|
|
|
|
veluca
|
2021-09-30 09:05:54
|
... file a bug?
|
|
2021-09-30 09:06:25
|
I currently don't see how this would happen
|
|
|
w
|
2021-09-30 09:46:38
|
I have the hardest times describing bugs, i'll submit this anyway
|
|
|
|
veluca
|
2021-10-01 10:05:35
|
I should have fixed it: https://github.com/libjxl/libjxl/pull/675
|
|
2021-10-01 10:05:57
|
I really hate chroma subsampling related bugs, there's too many of them xD
|
|
|
The_Decryptor
|
2021-10-01 12:06:12
|
Can confirm it's fixed 👍
|
|
|
|
veluca
|
|
w
|
2021-10-02 09:59:48
|
i'm having(had) trouble building the libjxl cmake project when included inside another cmake project (using include_subdirectory).
${CMAKE_SOURCE_DIR} in <https://github.com/libjxl/libjxl/blob/main/third_party/skcms.cmake#L35> is referring to the root project, but when fetched, it's under a subdirectory deps created by cmake.
I'm able to fix this by changing `${CMAKE_SOURCE_DIR}/lib/jxl/enc_jxl_skcms.h` to `${CMAKE_CURRENT_SOURCE_DIR}/../lib/jxl/enc_jxl_skcms.h` but I'm unsure about the correctness
|
|
|
|
veluca
|
2021-10-03 07:37:37
|
It is probably correct... But please open a PR :)
|
|
|
novomesk
|
|
w
i'm having(had) trouble building the libjxl cmake project when included inside another cmake project (using include_subdirectory).
${CMAKE_SOURCE_DIR} in <https://github.com/libjxl/libjxl/blob/main/third_party/skcms.cmake#L35> is referring to the root project, but when fetched, it's under a subdirectory deps created by cmake.
I'm able to fix this by changing `${CMAKE_SOURCE_DIR}/lib/jxl/enc_jxl_skcms.h` to `${CMAKE_CURRENT_SOURCE_DIR}/../lib/jxl/enc_jxl_skcms.h` but I'm unsure about the correctness
|
|
2021-10-03 09:49:23
|
This enc_jxl_skcms.h include is doing problems frequently.
|
|
|
w
|
2021-10-03 09:49:52
|
yeah my first solution was to disable it and make it use lcms2
|
|
|
|
veluca
|
2021-10-03 09:54:35
|
It is a bit of a hack...
|
|
|
w
|
2021-10-03 11:59:21
|
is there an example for decoding to jpeg using the api?
|
|
|
|
veluca
|
2021-10-03 12:24:45
|
https://github.com/libjxl/libjxl/pull/583/files#diff-ab4713b34c4b813999f1b8467050d922a5f6b61fd5b3b23ed6391199f3ac9b9bR236
|
|
2021-10-03 12:24:48
|
does that count?
|
|
|
w
|
2021-10-04 07:07:06
|
hmm not quite... I'll wait for jpeg to be more flushed out
|
|
2021-10-04 07:08:08
|
on another note, i found some weird behaviour when decoding some headers, waiting a bit (maybe jumping out of memory), then continuing decoding
after basic_info:
lib/jxl/dec_bit_reader.h:212: JXL_FAILURE: Non-zero padding bits
lib/jxl/toc.cc:64: JXL_RETURN_IF_ERROR code=1: reader->JumpToByteBoundary()
lib/jxl/decode.cc:991: invalid toc entries
or after color_encoding:
lib/jxl/dec_frame.cc:370: JXL_RETURN_IF_ERROR code=1: dec_state_->shared_storage.matrices.DecodeDC(br)
lib/jxl/decode.cc:1325: decoding frame failed
lib/jxl/quant_weights.cc:476: JXL_FAILURE: Invalid dc_quant: coefficient is too small.
|
|
2021-10-04 07:08:36
|
and to get around this i just setinput and flush the decoder every time
|
|
2021-10-04 07:09:02
|
I don't know if this is intentional but it works
|
|
|
|
veluca
|
|
w
hmm not quite... I'll wait for jpeg to be more flushed out
|
|
2021-10-04 07:10:50
|
what's missing from that?
|
|
|
w
|
2021-10-04 07:11:13
|
i just have no idea how to use it after staring it lol
|
|
|
|
veluca
|
|
w
and to get around this i just setinput and flush the decoder every time
|
|
2021-10-04 07:11:33
|
... what happens if you don't flush instead?
|
|
|
w
i just have no idea how to use it after staring it lol
|
|
2021-10-04 07:11:56
|
haha ok, that function should give you a buffer containing the JPEG as output and do nothing else...
|
|
|
w
|
2021-10-04 07:11:58
|
i get JXL_DEC_ERROR along with the errors above
|
|
|
|
veluca
|
2021-10-04 07:12:15
|
odd
|
|
2021-10-04 07:12:21
|
does it happen if you don't flush?
|
|
2021-10-04 07:12:26
|
I mean
|
|
2021-10-04 07:12:33
|
still set input, but not flush
|
|
2021-10-04 07:12:37
|
(and also release input)
|
|
|
w
|
2021-10-04 07:12:41
|
oh i mean release, not flush
|
|
|
|
veluca
|
2021-10-04 07:13:20
|
ok 😄
|
|
2021-10-04 07:13:38
|
then maybe some stuff moves around in memory? did you try running it under sanitizers?
|
|
2021-10-04 07:13:49
|
(you might have to build libjxl with sanitizers too)
|
|