Function photon_rs::monochrome::grayscale
source · pub fn grayscale(img: &mut PhotonImage)
Expand description
Convert an image to grayscale using the conventional averaging algorithm.
Arguments
photon_image
- A PhotonImage.
Example
// For example, to convert an image of type `PhotonImage` to grayscale:
use photon_rs::monochrome::grayscale;
use photon_rs::native::open_image;
let mut img = open_image("img.jpg").expect("File should open");
grayscale(&mut img);