Skip to content

Support loading 16-bit PNGs #3145

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

Open
stevengoldberg opened this issue May 15, 2025 · 1 comment
Open

Support loading 16-bit PNGs #3145

stevengoldberg opened this issue May 15, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@stevengoldberg
Copy link

Description

It looks like when I load a 16-bit PNG into an SkImage (via the useImage hook) the result is still an 8-bit PNG: image.getImageInfo().colorType is 4, which corresponds to RGBA_8888.

Is it possible to support 16-bit PNGs in SkImage?

@stevengoldberg stevengoldberg added the enhancement New feature or request label May 15, 2025
@wcandillon
Copy link
Contributor

this is an interesting question. If we load the image and do a readPixels on it, no Skia surface (texture format) is involved, I would like to investigate it this further.
readPixel has an image info parameter, if you set the right color format, could it be that you get the expected decoded bytes?
I have a branch where you can set an Skia surface to be 16bits and I'm wondering if providing the readPixel(correct image info) on that surface return the appropriate information.

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

No branches or pull requests

2 participants