#jpeg #libjpeg #image #encoder #decoder

mozjpeg

Higher-level wrapper for Mozilla’s JPEG library

21 releases

0.8.24 Feb 10, 2021
0.8.21 Nov 14, 2020
0.8.20 Jul 20, 2020
0.8.15 Jan 4, 2020
0.8.5 May 9, 2018

#3 in #jpeg

Download history 527/week @ 2020-11-06 609/week @ 2020-11-13 411/week @ 2020-11-20 528/week @ 2020-11-27 1121/week @ 2020-12-04 1146/week @ 2020-12-11 705/week @ 2020-12-18 336/week @ 2020-12-25 619/week @ 2021-01-01 553/week @ 2021-01-08 882/week @ 2021-01-15 778/week @ 2021-01-22 1019/week @ 2021-01-29 842/week @ 2021-02-05 781/week @ 2021-02-12 838/week @ 2021-02-19

3,121 downloads per month
Used in 6 crates (3 directly)

IJG license

54KB
1K SLoC

Rust wrapper for MozJPEG library

This library is compatible with Rust 1.46 or later.

This library offers convenient reading and writing of well-compressed JPEG images using a safe Rust interface.

The interface is still being developed, so it has rough edges and may change.

Decoding

let d = mozjpeg::Decompress::with_markers(mozjpeg::ALL_MARKERS)
    .from_path("tests/test.jpg")?;

d.width();
d.height();
d.color_space() == mozjpeg::ColorSpace::JCS_YCbCr;
for marker in d.markers() {}

let image = d.rgb().unwrap();
image.width();
image.height();
image.color_space() == mozjpeg::ColorSpace::JCS_RGB;

Dependencies

~5MB
~97K SLoC