#quantization #palette #image #compression #pngquant

imagequant

Convert 24/32-bit images to 8-bit palette with alpha channel. Bindings for libimagequant that powers pngquant lossy PNG compressor. Dual-licensed like pngquant. See https://pngquant.org for details.

23 stable releases

2.11.9 Feb 26, 2018
2.11.7 Nov 30, 2017
2.11.4 Oct 27, 2017
2.11.1 Jul 13, 2017
2.3.3 Mar 2, 2015

#15 in Images

Download history 126/week @ 2018-05-27 195/week @ 2018-06-03 58/week @ 2018-06-10 123/week @ 2018-06-17 94/week @ 2018-06-24 195/week @ 2018-07-01 77/week @ 2018-07-08 163/week @ 2018-07-15 145/week @ 2018-07-22 166/week @ 2018-07-29 209/week @ 2018-08-05 305/week @ 2018-08-12 86/week @ 2018-08-19

435 downloads per month
Used in 2 crates (1 directly)

GPL-3.0+

23KB
374 lines

libimagequant bindings for Rust

Imagequant library converts RGBA images to 8-bit indexed images with palette, including alpha component. It's ideal for generating tiny PNG images (although image I/O isn't handled by the library itself).

This wrapper makes the library usable from Rust.

Rust API closely follows the C API, but is slightly OO-ified:

liq_set_dithering_level(result, 1.0);
  ↓
result.set_dithering_level(1.0);

For more details see libimagequant documentation and Rust function reference.


lib.rs:

https://pngquant.org/lib/

Converts RGBA images to 8-bit with alpha channel.

This is based on imagequant library, which generates very high quality images.

See examples/ directory for example code.

Dependencies

~631KB
~13K SLoC