#image #resize #imagemagick #conversion #interlacing

image-convert

A high level library for image identification, conversion, interlacing and high quality resizing

26 releases

✓ Uses Rust 2018 edition

0.9.10 Jul 6, 2020
0.9.8 Jun 27, 2020
0.9.5 Mar 1, 2020
0.8.10 Sep 16, 2019
0.8.9 Jul 28, 2019

#34 in Images

Download history 89/week @ 2020-03-20 31/week @ 2020-03-27 16/week @ 2020-04-03 145/week @ 2020-04-10 53/week @ 2020-04-17 10/week @ 2020-04-24 2/week @ 2020-05-01 31/week @ 2020-05-08 16/week @ 2020-05-15 26/week @ 2020-05-22 27/week @ 2020-05-29 106/week @ 2020-06-05 108/week @ 2020-06-12 48/week @ 2020-06-19 37/week @ 2020-06-26 104/week @ 2020-07-03

225 downloads per month
Used in 3 crates

MIT license

56KB
1.5K SLoC

Image Convert

Build Status

This crate is a high level library using MagickWand (ImageMagick) for image identification, conversion, interlacing and high quality resizing.

Examples

Identify an image.

extern crate image_convert;

use image_convert::{ImageResource, InterlaceType, identify};

let input = ImageResource::from_path("tests/data/P1060382.JPG");

let mut output = None;

let id = identify(&mut output, &input).unwrap();

assert_eq!(4592, id.resolution.width);
assert_eq!(2584, id.resolution.height);
assert_eq!("JPEG", id.format);
assert_eq!(InterlaceType::NoInterlace, id.interlace);

Convert an image to a PNG image and also resize it.

extern crate image_convert;

use std::path::Path;

use image_convert::{ImageResource, PNGConfig, to_png};

let source_image_path = Path::new("tests/data/P1060382.JPG");

let target_image_path = Path::join(source_image_path.parent().unwrap(), "P1060382_output.png");

let mut config = PNGConfig::new();

config.width = 1920;

let input = ImageResource::from_path(source_image_path);

let mut output = ImageResource::from_path(target_image_path);

to_png(&mut output, &input, &config).unwrap();

Supported output formats are BMP, JPG, PNG, GIF, WEBP, ICO, PGM and GrayRaw.

Crates.io

https://crates.io/crates/image-convert

Documentation

https://docs.rs/image-convert

License

MIT

Dependencies

~2.5–4.5MB
~102K SLoC