randy408 / libspng

Simple, modern libpng alternative
https://libspng.org
BSD 2-Clause "Simplified" License
731 stars 71 forks source link

Decode RGB16 / G16 #243

Open MiSo1289 opened 1 year ago

MiSo1289 commented 1 year ago

Currently, 16-bit images can be encoded without alpha, but not decoded (there is not rgb16 / g16 format for decoding, just rgba16 / ga16 / rgb8 / g8). Any plans to include this feature?

randy408 commented 1 year ago

SPNG_FMT_PNG works for both encode and decode for all formats, if you want RGB16 from a RGB16 PNG or G16 from a G16 PNG then an explicit format enum is not needed.

Upliner commented 6 months ago

SPNG_FMT_PNG works for both encode and decode for all formats, if you want RGB16 from a RGB16 PNG or G16 from a G16 PNG then an explicit format enum is not needed.

It doesn't solve my problem. I really need to be able to decode RGBA16 image to RGB16 buffer without temporary RGBA16 buffer for good performance.

Upliner commented 6 months ago

I've committed experimental RGB16 support to my fork. Haven't checked G16 yet.