pub extern "C" fn __wasm_bindgen_generated_seam_carve(
    arg0: <PhotonImage as RefFromWasmAbi>::Abi,
    arg1: <u32 as FromWasmAbi>::Abi,
    arg2: <u32 as FromWasmAbi>::Abi
) -> <PhotonImage as ReturnWasmAbi>::Abi
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);