-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JPEGXL lossless float16 is not lossless #114
Comments
I can reproduce this on Windows, AMD64 and ARM64. It looks like a bug in libjxl to me. The glitches are quite rare though, maybe one in several thousand random values. Try to reproduce this with the cjxl/djxl tools and open an issue at https://github.com/libjxl/libjxl/issues. |
Ok, glad to hear it's not just me. I'll try the tools. |
The cjxl/djxl tools don't appear to currently allow any formats that support float16, so I haven't been able to find a way to reproduce the issue using the tools. The issue appears to be related to specific input values. For instance, the input value |
Did you check EXR? Also,the GIMP plugin supports float16. Not sure, I have not tried either. |
Looks like EXR support has been dropped for the time being:
Gonna try GIMP. |
Tried GIMP 2.99.19, which supports JPEG-XL. However, support appears a bit buggy. Opening float16 or float32 jxl-files encoded using GIMP does not appear to support saving JPEG-XL as floating types. I've already spent too much time on this, and there doesn't appear to be any good way of encoding float16 using |
FWIW, darktable can do fp16 EXR and TIFF. It should also decode any JXL. For JXL encoding, 4.8.1 does just lossy floats, only the dev version can do fp32 lossless but crashes for fp16 lossless (also reported to libjxl; seems like there is no built-in fp32->fp16 down-conversion like there is when targeting integer lossless...). |
I have it here (MSYS2 package). Just means it was built w/o OpenEXR present for you. Doesn't mean it works though, haven't tested...
|
@kmilos , thanks for chipping in. At this point, I'd be surprised if the error isn't in the encoder. Especially given the encoded size of a If you want, you're very welcome to try and open the The zip also contains two EXR files that should contain the same 65536 values as the JXL files. If you've got cjxl/djxl working to EXR, perhaps you can check if they encode correctly. |
Hey,
First of all, really nice work on supporting so many image formats. I've been playing around with lossless encoding of some
float16
data. However, when decoding there appears to be artifacts. I don't know if the issue is in your wrapper or in libjxl, however, before I raise an issue over there I just wanted bring it up here, since it's probably easy for you to check if the issue resides here.The issue can be replicated on WSL2 Ubuntu Python 3.10 with
imagecodecs==2024.9.22
using this test:Visually, it looks like this:
The text was updated successfully, but these errors were encountered: