mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-18 19:49:04 +00:00
Benefits:
- newer versions of the libraries
- zlib: 1.2.8 -> 1.2.11
- libpng: 1.6.18beta04 -> 1.6.34
- much fewer dependencies to install (as libs are already in optipng archive and we don't need napa)
- much smaller build thanks to customised versions of zlib and libpng containing only APIs necessary for optipng itself: 238950 -> 177359 bytes
- much faster build thanks to preconfigured libpng and stripped APIs: 2m15s -> 40s
- much simpler build script: 77 -> 46 lines
OptiPNG
- Source: http://optipng.sourceforge.net/
- Version: v0.7.7
Dependencies
- Docker
Example
See example.html
API
int version()
Returns the version of optipng as a number. va.b.c is encoded as 0x0a0b0c
ArrayBuffer compress(std::string buffer, {level});
compress will re-compress the given PNG image via buffer. level is a number between 0 and 7.
void free_result()
Frees the result created by compress().