serialimage-1.0.1 has been yanked.
serialimage
This crate extends the image crate with serializable DynamicImages: the DynamicSerialImages. Additionally, it implements an ImageMetaData struct to pack additional metadata information.
Note, however, the metadata information is lost on conversion from DynamicSerialImage to DynamicImage.
Usage
Add the following to your Cargo.toml:
[]
= "1.0.0"
and the following to your source code:
use ;
Then, you can create a new image metadata object:
let meta = new;
Then, a DynamicSerialImage can be created from a DynamicImage. For example, with a DynamicImage from a Luma<u16> pixel type image buffer,
let img = from; // create DynamicImage
let mut img = from; // create DynamicSerialImage
img.set_metadata; // set the metadata
let imgstr = to_string.unwrap; // serialize
let simg: DynamicSerialImage = from_str.unwrap; // deserialize
assert_eq!;
Now img can be sent on its merry way with full serialization
Traits
DynamicSerialImage and SerialImageBuffer implements the TryFrom and TryInto traits for image::DynamicImage.