#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.

20 stable releases

✓ Uses Rust 2018 edition

2.12.5 Nov 10, 2019
2.11.9 Feb 26, 2018
2.11.7 Nov 30, 2017
2.11.1 Jul 13, 2017
2.3.3 Mar 2, 2015

#72 in Images

Download history 328/week @ 2019-11-08 627/week @ 2019-11-15 361/week @ 2019-11-22 345/week @ 2019-11-29 508/week @ 2019-12-06 257/week @ 2019-12-13 158/week @ 2019-12-20 195/week @ 2019-12-27 225/week @ 2020-01-03 631/week @ 2020-01-10 426/week @ 2020-01-17 273/week @ 2020-01-24 398/week @ 2020-01-31 519/week @ 2020-02-07 391/week @ 2020-02-14

1,586 downloads per month
Used in 3 crates (via gifski)

GPL-3.0+

23KB
376 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

~375–520KB
~10K SLoC