18 unstable releases (7 breaking)

0.9.1 Jul 11, 2024
0.8.0 Jul 10, 2024
0.6.6 Apr 10, 2023
0.6.5 Mar 7, 2023
0.5.1 Dec 30, 2021

#281 in Images

Download history 245/week @ 2024-07-20 482/week @ 2024-07-27 281/week @ 2024-08-03 364/week @ 2024-08-10 143/week @ 2024-08-17 606/week @ 2024-08-24 577/week @ 2024-08-31 623/week @ 2024-09-07 419/week @ 2024-09-14 614/week @ 2024-09-21 484/week @ 2024-09-28 368/week @ 2024-10-05 447/week @ 2024-10-12 462/week @ 2024-10-19 438/week @ 2024-10-26 616/week @ 2024-11-02

2,049 downloads per month
Used in 6 crates (4 directly)

MIT/Apache

46KB
1K SLoC

jpeg2k

JPEG 2000 image loader.

Example: Convert a Jpeg 2000 image to a png image.

use image::DynamicImage;

use jpeg2k::*;

fn main() {
  // Load jpeg 2000 file from file.
  let jp2_image = Image::from_file("./assets/example.j2k")
		.expect("Failed to load j2k file.");

  // Convert to a `image::DynamicImage`
  let img: DynamicImage = jp2_image.try_into()?;

  // Save as png file.
  img.save("out.png")?;
}

lib.rs:

Jpeg 2000 image support.

A safe wrapper of openjpeg-sys for loading/saving Jpeg 2000 images.

Example: Convert a Jpeg 2000 image to a png image.

use image::DynamicImage;

use jpeg2k::*;

fn main() {
  // Load jpeg 2000 file from file.
  let jp2_image = Image::from_file("./assets/example.j2k")
		.expect("Failed to load j2k file.");

  // Convert to a `image::DynamicImage`
  let img: DynamicImage = jp2_image.try_into()?;

  // Save as png file.
  img.save("out.png")?;
}

Dependencies

~8MB
~166K SLoC