6 releases

Uses old Rust 2015

0.2.0 Apr 22, 2017
0.1.4 Mar 1, 2017
0.1.3 Feb 25, 2017

#32 in #resize

Download history 8/week @ 2024-02-26 90/week @ 2024-04-01

90 downloads per month
Used in enimda

MIT license

2MB
138 lines

Image Utils

Image processing utilities

crates.io Build Status

Documentation

https://docs.rs/image-utils/

Functions

Image information

extern crate image_utils;

use std::path::Path;
use image_utils::info;

fn main() {
    let inf = info(&Path::new("test.jpg")).unwrap();
    println!("{:?}", inf);
}

Crop image

extern crate image_utils;

use std::path::Path;
use image_utils::crop;

fn main() {
    crop(&Path::new("test.jpg"), 10, 10, 100, 100, &Path::new("cropped.jpg")).unwrap();
}

Resize image

extern crate image_utils;

use std::path::Path;
use image_utils::resize;

fn main() {
    resize(&Path::new("test.jpg"), 200, 200, &Path::new("resized.jpg")).unwrap();
}

Run tests

cargo test

lib.rs:

A crate to get images info and process them, including animated GIFs.

Example

extern crate image_utils;

use std::path::Path;
use image_utils::{info, crop, resize};

let path = Path::new("test.jpg");

let inf = info(&path)?;
println!("{:?}", inf);

crop(&path, 10, 10, 100, 100, &Path::new("cropped.jpg"))?;
resize(&path, 200, 200, &Path::new("resized.jpg"))?;

Dependencies

~10MB
~35K SLoC