AldaronLau / png_pong

A pure Rust PNG image decoder and encoder based on lodepng.
https://docs.rs/png_pong
Apache License 2.0
26 stars 3 forks source link

Support 1, 2, and 4 bit palette modes #11

Open kitlith opened 3 years ago

kitlith commented 3 years ago

Is your feature request related to a problem? Please describe. Attempting to decode a PNG with a 4bpp palette results in a ColorMode(Palette, 4) error.

Describe the solution you'd like I'd like it to "just work", perhaps providing the {1, 2, 4} bits in the 8 bit channel as before. (different types could also work, but would be more frustrating to deal with).

Describe alternatives you've considered Converting the image to 8bpp ahead of time. (convert 4bpp.png PNG8:8bpp.png works for this) Using the chunked api instead. Using a different library.

Additional context test_image.png