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
2,766 downloads per month
Used in 6 crates
(4 directly)
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