Function photon_rs::transform::seam_carve
source · pub fn seam_carve(img: &PhotonImage, width: u32, height: u32) -> PhotonImage
Expand description
Resize image using seam carver. Resize only if new dimensions are smaller, than original image.
NOTE: This is still experimental feature, and pretty slow.
Arguments
img
- A PhotonImage.width
- New width.height
- New height.
Example
// For example, resize image using seam carver:
use photon_rs::native::open_image;
use photon_rs::transform::seam_carve;
use photon_rs::PhotonImage;
let img = open_image("img.jpg").expect("File should open");
let result: PhotonImage = seam_carve(&img, 100_u32, 100_u32);