image icon indicating copy to clipboard operation
image copied to clipboard

Decode to sRGB

Open jrmuizel opened this issue 4 years ago • 4 comments

Many image formats store image data in a color space other than sRGB. It would be nice to be able to be able to request sRGB and have the stored image data converted to sRGB as needed.

I'm interested in implementing this using qcms to do the conversion and was hoping for some pointers on how to expose and plug in this kind of functionality.

jrmuizel avatar Mar 31 '21 00:03 jrmuizel

An ImageBuffer derefs into a slice. I think you should just be able to pass that to qcms::Transform::apply(...).

fintelia avatar Mar 31 '21 01:03 fintelia

Would the Pixel trait then have some way of obtaining the color space of the source data?

jrmuizel avatar Mar 31 '21 02:03 jrmuizel

Unfortunately, no. Some of the individual decoding crates provide a bit more information, but we don't have any common abstraction for that (yet) at the level of this crate. You'd probably have to get that information out of band

fintelia avatar Mar 31 '21 03:03 fintelia

https://github.com/image-rs/image/pull/2531 implements color space awareness

Shnatsel avatar Aug 24 '25 21:08 Shnatsel