icc: Add way to get the actual profile
Closed this issue · 3 comments
The data that is returned by jxl-oxide at the moment probably contains the output_size
, the commands_size
and the "commands stream" as described by Annex B.3 of the draft?
Would it be possible to have a function that returns the actual ICC profile?
I haven't figured out yet what the function of the commands stream even is. So I'm a bit unsure what's the correct solution xD
Thanks for providing this crate. I'm using it for so first rough support of jxl in GNOME's new default Image Viewer.
I guess https://docs.rs/jxl-color/latest/jxl_color/icc/fn.decode_icc.html is already doing what I'm looking for
JxlImage::embedded_icc
returns the (optional) embedded ICC profile, that is decoded as specified in B.3. It might not match the actual colorspace of decoded images (which is described by rendered_icc
) when it's XYB encoded.
You'll almost always want rendered_icc
for display purposes. embedded_icc
is useful when you're transcoding the image and you want to preserve the original colorspace. If you get awkward results with rendered_icc
, it might be a bug; please let me know in that case!
Hey again! Looks like I got very confused during debugging. The problem seems to be that GIMP messes up saving exif profiles for JPEG XL. My test images saved with Krita work just fine.
Sorry for the noise.