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

unsigned int not supported as image and buffer #75

Closed
tharindu-mathew opened this issue Jul 13, 2018 · 1 comment
Closed

unsigned int not supported as image and buffer #75

tharindu-mathew opened this issue Jul 13, 2018 · 1 comment

Comments

@tharindu-mathew
Copy link

It seems only 8 bit buffers are supported. But, 16 bit needs unsigned ints or similar, if the 16 bit is already available to the user, who doesn't want to downsample it to 8bit.

@lvandeve
Copy link
Owner

16-bit color is indeed available, for RGB, RGBA, greyscale and greyscale+alpha. It stores them in an 8-bit unsigned chars buffer, but using 2 unsigned chars per pixel

For example if you have 16-bit RGB, it will use 6 bytes per pixel.

The values are in big endian order, just like they are inside the PNG file format

Please check out the code snippet in the comment in #74 to see a working example (greyscale in that case)

Please feel free to reopen this bug if you have any further questions about this :)

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

2 participants