Function convert_adaptive

Source
pub fn convert_adaptive(img: &mut GrayAlphaImage, negative: bool)
Expand description

Converts the pixels of a GrayAlphaImage to negative if negative is true, otherwise, converts them to positive.

For Telegram’s adaptive emojis, it doesn’t matter, made to better show what should you use depending on the background.

§Arguments

  • img - A mutable reference to a GrayAlphaImage.
  • negative - A boolean indicating whether to convert to negative or not.

§Examples

let mut img = image::open("./assets/examples/original.webp")?.to_luma_alpha8();

adaptemoji::convert_adaptive(&mut img, true);