Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Gamma handling? #8

Open
lilith opened this issue Jul 9, 2015 · 1 comment
Open

Gamma handling? #8

lilith opened this issue Jul 9, 2015 · 1 comment

Comments

@lilith
Copy link

lilith commented Jul 9, 2015

24-bit RGB and YCbCr both use a gamma-adjusted scale for luminosity. Averaging of luminosity values must be done in the linear space in order to avoid corruption (shadows expanding/eating nearby pixels).

Does this library address this? I don't see a reference to gamma adjustment, and the storage format appears to be 8-bit per channel, which can only contain gamma-adjusted data without loss, since you need 14 bits to store linearized values without truncation.

The approach you took to SIMD acceleration here is impressive; I haven't seen an equivalent elsewhere.

@bamiaux
Copy link
Owner

bamiaux commented Jul 9, 2015

No, the library only support 8-bit currently, which means no gamma correction
To do that, like you said, you would need to add 8-bit to N-bit conversion, N-bit resize and N-bit to 8-bit.
That was part of my original plans but lost motivation along the way.

Also, I'm not completely satisfied by the current design. Adding N-bit resizes would explode complexity, and maybe just in time code generation is a better way forward.

Anyway, thanks for your comments !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants