[][src]Function imageproc::map::green_channel

pub fn green_channel<I, C>(image: &I) -> Image<Luma<C>> where
    I: GenericImage<Pixel = Rgb<C>>,
    C: Primitive + 'static, 

Creates a grayscale image by extracting the green channel of an RGB image.

Examples

use image::Luma;
use imageproc::map::green_channel;

let image = rgb_image!(
    [1, 2, 3], [2, 4, 6];
    [3, 6, 9], [4, 8, 12]);

let expected = gray_image!(
    2, 4;
    6, 8);

let actual = green_channel(&image);
assert_pixels_eq!(actual, expected);