Add support for reading indices of palletized pngs' #2709
Replies: 1 comment
-
I recommend people who need to use pngs' in a non-destructive way to use the pngcs library. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
There are many reasons why someone might need to read the raw indices of a png. I've written tools and applications in various languages (C#, Python and C) for various platforms and API's (currently Spectrum Next and DAVE2D) where I need access to the raw index data.
ImageSharp supports reading indexed pngs' but converts the indices to a color format which is destructive. Once converted you no longer know which color in the palette a pixel is. Also a platform such as DAVE2D supports palletized formats directly and a conversion back to indices would be required. And finally this doesn't work because there are often repeating colors in a palette such as for when a png contains 16 4-bit color palettes in an 8-bit palette.
Please add PixelFormats.Index1, PixelFormats.Index2, PixelFormats.Index4 and PixelFormats.Index8 formats and copy the indices directly from the png data.
Beta Was this translation helpful? Give feedback.
All reactions