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

#292 in Images

Download history 366/week @ 2024-08-12 145/week @ 2024-08-19 742/week @ 2024-08-26 450/week @ 2024-09-02 623/week @ 2024-09-09 467/week @ 2024-09-16 566/week @ 2024-09-23 489/week @ 2024-09-30 370/week @ 2024-10-07 451/week @ 2024-10-14 457/week @ 2024-10-21 433/week @ 2024-10-28 784/week @ 2024-11-04 667/week @ 2024-11-11 495/week @ 2024-11-18 811/week @ 2024-11-25

2,766 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
~167K SLoC