What is libimagequant?
mainlibimagequant is an image quantization library that converts RGBA images to palette-based 8-bit indexed images, including the alpha component. It is designed for generating small PNG images and high-quality GIFs.
Key constraints:
- No Encoding/Decoding: The library does not handle file formats (like PNG or GIF). It operates exclusively on raw, uncompressed pixel arrays in memory. You must use a separate library (e.g.,
libpng,lodepng) to decode files into pixels and encode the resulting palette-based pixels back into a file. - Input Formats: It primarily works with RGBA data, though custom conversion functions can be provided for other formats.