[−][src]Function photon::channels::selective_greyscale
pub fn selective_greyscale(photon_image: PhotonImage, ref_color: Rgb)
Selectively changes a pixel to greyscale if it is not visually similar or close to the colour specified. Only changes the colour of a pixel if its RGB values are within a specified range.
(Similarity between two colours is calculated via the CIE76 formula.) For example, if a user wishes all pixels that are NOT blue to be displayed in greyscale, they can selectively specify only the blue pixels to be kept in the photo.
Arguments
img
- A PhotonImage.ref_color
- TheRGB
value of the reference color (to be compared to)
Example
// For example, to greyscale all pixels that are *not* visually similar to the RGB colour RGB{20, 40, 60}: let ref_color = Rgb{20, 40, 60}; photon::channels::selective_greyscale(&mut img, ref_color);