[][src]Function photon_rs::channels::__wasm_bindgen_generated_selective_greyscale

pub extern "C" fn __wasm_bindgen_generated_selective_greyscale(
    arg0: <PhotonImage as FromWasmAbi>::Abi,
    arg1: <Rgb as FromWasmAbi>::Abi
) -> <() as ReturnWasmAbi>::Abi

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 - The RGB 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);