Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QOI decoding does not convert between sRGB and Linear #545

Open
de-odex opened this issue Sep 15, 2023 · 4 comments
Open

QOI decoding does not convert between sRGB and Linear #545

de-odex opened this issue Sep 15, 2023 · 4 comments

Comments

@de-odex
Copy link

de-odex commented Sep 15, 2023

Hello, this is less a bug than an observation, but when I was reading the code for QOI decoding I noticed that the colourspace is never checked in conversion to an Image.
I was wondering if there was a mistake here as that would mean Image could either have gamma-encoded sRGB values or linear sRGB values, whilst not also storing which it would be.
Furthermore, perhaps more clarification as to what ColorRGBX (and friends RGB RGBA) stores in terms of colourspace is needed.

@treeform
Copy link
Owner

treeform commented Oct 4, 2023

@ehmry could you look into this? You wrote the entire encoding/decoding stack. It looks like there is a flag in the spec for linear and sRGB, pixie should support reading sRGB and should always write linear.

Pixie does not support sRGB.
ColorRGBX is just premultiplied alpha RGBA (its not a color space).

@ehmry
Copy link
Contributor

ehmry commented Oct 5, 2023

I'll see what I­ can do.

@ehmry
Copy link
Contributor

ehmry commented Oct 5, 2023

All of the QOI images I can find are in sRGB (https://qoiformat.org/qoi_test_images.zip) and when decoding a QOI and encoding to PNG the grays come out the same. I'm not sure what is going on here.

@de-odex
Copy link
Author

de-odex commented Oct 5, 2023

I only noticed this from reading the specification; I do not know if it is used in practice but it is nonetheless in the spec... I don't know why it is in the spec but if it doesn't matter then it's probably fine to drop this for now

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

No branches or pull requests

3 participants