image
image copied to clipboard
`impl GenericImage for DynamicImage` looses precision
As follow-up on the F32 dynamic image changes, I open this issue to discuss an itch: Dynamic image currently implements GenericImage by converting all pixels to Rgb8.
This is the smallest pixel type, meaning that 32 bit images and 16 bit images will loose precision and the value range may even be clamped. I see several options in case we want to improve that situation:
- Replicate all
imageopsfunctions as methods on the dynamic image, as it is currently done, and then not implement generic image for dynamic image. Are there currently situations where the dynamic image is used as a generic image? - Implement generic image with pixel type F32. This means all color operations are done in f32, then stored in the original format.
- Some kind of
enum DynamicPixel, but this will probably have an unacceptable performance overhead.
Maybe there are even more possibilities, any ideas?