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

#303 in Images

Download history 618/week @ 2024-09-08 464/week @ 2024-09-15 577/week @ 2024-09-22 489/week @ 2024-09-29 375/week @ 2024-10-06 445/week @ 2024-10-13 465/week @ 2024-10-20 434/week @ 2024-10-27 615/week @ 2024-11-03 827/week @ 2024-11-10 479/week @ 2024-11-17 828/week @ 2024-11-24 630/week @ 2024-12-01 655/week @ 2024-12-08 458/week @ 2024-12-15 669/week @ 2024-12-22

2,433 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