[][src]Function photon_rs::monochrome::grayscale_shades

pub fn grayscale_shades(photon_image: &mut PhotonImage, num_shades: u8)

Employ only a limited number of gray shades in an image.

Arguments

  • photon_image - A PhotonImage.
  • num_shades - The number of grayscale shades to be displayed in the image.

Example

// For example, to limit an image to four shades of gray only:
monochrome::grayscale_shades(&mut img, 4);