zune-jpegxl 0.4.0

A simple, fast and fully safe modular jxl encoder
Documentation

zune-jpegxl

A simple jpeg-xl encoder

This features a simple jpeg-xl lossless encoder with the following features

  • Lossless encoding
  • 8 bit and 16 bit support
  • Grayscale and RGB{A} encoding
  • Threading capabilities

Usage

First add the latest into your cargo toml

By cargo add

cargo add zune-jpegxl

Or adding directly to your Cargo.toml

zune-jpegxl = "0.4"

Then use the JxlSimpleEncoder struct to encode an image

use zune_core::bit_depth::BitDepth;
use zune_core::options::EncoderOptions;
use zune_jpegxl::JxlSimpleEncoder;
// this example won't work
fn main()->Result<(),JxlEncodeErrors> {
    let mut encoder = JxlSimpleEncoder::new(&[255,0,255,0], EncoderOptions::new(2,2,co));
    encoder.encode().unwrap();
}