jixel 0.2.7

Tiny JPEG XL encoder
Documentation

jixel

A tiny JPEG XL encoder in Rust, ported and reworked from libjxl/libjxl-tiny.

Example

fn main() {
    let output = "encoded_lossy2.jxl";
    let image = image::open(Path::new("./assets/abstract_alpha.png")).unwrap();
    let bytes = jixel::encode_image_with_alpha(
        image.to_rgba8().as_raw(),
        image.width() as usize,
        image.height() as usize,
        &EncodeConfig::default().with_quality(90.),
    );
    std::fs::write(&output, &bytes).expect("failed to write output");
}

License

This project is licensed under either of

  • BSD-3-Clause License (see LICENSE)
  • Apache License, Version 2.0 (see LICENSE)

at your option.