react-native-skia icon indicating copy to clipboard operation
react-native-skia copied to clipboard

Support loading 16-bit PNGs

Open stevengoldberg opened this issue 9 months ago • 1 comments

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 avatar May 15 '25 19:05 stevengoldberg

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.

wcandillon avatar May 21 '25 09:05 wcandillon