zune-jpegxl

Crates.iozune-jpegxl
lib.rszune-jpegxl
version0.5.0-rc0
sourcesrc
created_at2023-11-16 16:12:02.585757
updated_at2024-04-07 16:06:48.906138
descriptionA simple, fast and fully safe modular jxl encoder
homepage
repositoryhttps://github.com/etemesi254/zune-image/tree/dev/crates/zune-jpegxl
max_upload_size
id1037743
size80,630
Caleb Etemesi (etemesi254)

documentation

README

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();
}
Commit count: 1717

cargo fmt