mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-14 09:39:15 +00:00
Few notes: - Lots of deprecated SIMD intrinsic warnings & errors in JPEG-XL -> Highway; had to suppress erorrs to make project build. - Moved couple of common link flags to cpp.Dockerfile (note: can't move `EXPORT_ES6` otherwise `configure` will fail). - MODULARIZE=1 is no longer necessary and implied by EXPORT_ES6. - EXPORT_NAME=... is no longer necessary in EXPORT_ES6. - Changed visdif to also use EXPORT_ES6 and ENVIRONMENT=node instead of generic JS.
AVIF encoder
- Source: https://github.com/AOMediaCodec/libavif
- Version: v0.5.4
Example
Run example.js
API
Uint8Array encode(std::string image_in, int image_width, int image_height, AvifOptions opts)
Encodes the given image with given dimension to AVIF. Options looks like this:
struct AvifOptions {
// 0 = lossless
// 63 = worst quality
int minQuantizer;
int maxQuantizer;
// [0 - 6]
// Creates 2^n tiles in that dimension
int tileRowsLog2;
int tileColsLog2;
// 0 = slowest
// 10 = fastest
int speed;
// 0 = 4:2:0
// 1 = 4:2:2
// 2 = 4:4:4
int subsample;
};