#jpeg #libjpeg #image #encoder #decoder

mozjpeg

Higher-level wrapper for Mozilla’s JPEG library

18 releases

0.8.21 Nov 14, 2020
0.8.20 Jul 20, 2020
0.8.17 Jun 18, 2020
0.8.15 Jan 4, 2020
0.8.5 May 9, 2018

#221 in Images

Download history 505/week @ 2020-08-11 392/week @ 2020-08-18 397/week @ 2020-08-25 529/week @ 2020-09-01 569/week @ 2020-09-08 585/week @ 2020-09-15 591/week @ 2020-09-22 455/week @ 2020-09-29 461/week @ 2020-10-06 713/week @ 2020-10-13 731/week @ 2020-10-20 710/week @ 2020-10-27 1089/week @ 2020-11-03 595/week @ 2020-11-10 557/week @ 2020-11-17 468/week @ 2020-11-24

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

IJG license

53KB
1K SLoC

Rust wrapper for MozJPEG library

This library is compatible with Rust 1.45 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

~4.5MB
~84K SLoC