Crates.io | jpeg-encoder |
lib.rs | jpeg-encoder |
version | 0.6.0 |
source | src |
created_at | 2021-04-29 12:17:30.15993 |
updated_at | 2023-10-09 05:51:44.581842 |
description | JPEG encoder |
homepage | |
repository | https://github.com/vstroebel/jpeg-encoder |
max_upload_size | |
id | 391001 |
size | 167,850 |
A JPEG encoder written in Rust featuring:
unsafe
by default (Enabling the simd
feature adds unsafe code)use jpeg_encoder::{Encoder, ColorType};
// An array with 4 pixels in RGB format.
let data = [
255, 0, 0,
0, 255, 0,
0, 0, 255,
255, 255, 255,
];
// Create new encoder that writes to a file with maximum quality (100)
let mut encoder = Encoder::new_file("some.jpeg", 100)?;
// Encode the data with dimension 2x2
encoder.encode(&data, 2, 2, ColorType::Rgb)?;
std
(default): Enables functionality dependent on the std libsimd
: Enables SIMD optimizations (implies std
and only AVX2 as for now)This crate needs at least 1.61 or higher.
This project is licensed under either of
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in jpeg-encoder by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.