tachiyomiorg / image-decoder

Image decoder supporting JPEG, JPEGXL, PNG, WebP, AVIF, and HEIF with the option to crop borders
Mozilla Public License 2.0
48 stars 75 forks source link

Add color management #2

Closed wwww-wwww closed 1 year ago

wwww-wwww commented 3 years ago

This enables using embedded icc profiles and also using a provided display profile. Additionally, the jxl decoder is changed to not decode twice.

For each available format for L, LA, RGB, RGBA in RGB565 and 32-bit, I have tested with: v4 YCC-RGB, v2 GBR A large image to test the subsampling, with embedded profile, without embedded profile. testimages.zip

A patch is ready for subsampling-scale-image-view and reader options in tachiyomi.

wwww-wwww commented 3 years ago

At this point, this is quite thoroughly tested for png, jpg, and jxl.

arkon commented 1 year ago

@wwww-wwww Sorry, I guess @inorichi never ended up reviewing this. Do you still want to update this and I can at least do some basic testing + get it into a preview app build for wider testing?

inorichi commented 1 year ago

@wwww-wwww Sorry, I guess @inorichi never ended up reviewing this. Do you still want to update this and I can at least do some basic testing + get it into a preview app build for wider testing?

Yeah... TBH this is outside of my knowledge so I don't know what are the benefits of this PR. At most I could only complain about some nitpicks

foundObjects commented 1 year ago

I just wanted to say thanks for adding proper color management. I've been slowly transcoding my library to jxl to reduce space usage and I just ran into a situation where some chapters were released as PNG with an embedded Adobe RGB ICC profile. Those render fine, and convert to JPEG XL as expected with cjxl, but the final .jxl files don't render correctly in Tachiyomi without proper color management. I was just taking screenshots to report this when I found this PR, so thanks 👍

Any idea when the image-decoder dependency in main will be updated to include this? I'd like to test it out and see if it handles my converted images correctly as soon as a preview build with this work is available.