#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

#18 in Images

Download history 144/week @ 2018-10-25 238/week @ 2018-11-01 339/week @ 2018-11-08 231/week @ 2018-11-15 213/week @ 2018-11-22 310/week @ 2018-11-29 172/week @ 2018-12-06 157/week @ 2018-12-13 155/week @ 2018-12-20 338/week @ 2018-12-27 111/week @ 2019-01-03 199/week @ 2019-01-10 182/week @ 2019-01-17

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

~641KB
~13K SLoC