[][src]Function seamcarving::resize

pub fn resize<IMG: GenericImageView>(
    img: &IMG,
    width: u32,
    height: u32
) -> ImageBuffer<IMG::Pixel, Vec<<<IMG as GenericImageView>::Pixel as Pixel>::Subpixel>> where
    <IMG as GenericImageView>::Pixel: 'static, 

Resizes an image to a lower width and height, using seam carving to avoid deforming the contents.

This works by removing horizontal and then vertical seams until both the width and the height of the image are inferior to the given dimensions.

If the image is already smaller than the given dimensions, then the returned image is identical to the input.

let img = image::open("./my_image.jpg").unwrap();
let resized = seamcarving::resize(&img, 100, 100); // Creates a 100x100 version of the image
resized.save("./resized.jpg");