Crates.io | jpeg2k |
lib.rs | jpeg2k |
version | 0.9.1 |
source | src |
created_at | 2021-12-28 20:12:51.227715 |
updated_at | 2024-07-11 13:21:18.590929 |
description | JPEG 2000 image loader. |
homepage | https://github.com/Neopallium/jpeg2k |
repository | https://github.com/Neopallium/jpeg2k |
max_upload_size | |
id | 504418 |
size | 68,726 |
JPEG 2000 image loader.
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")?;
}