pub fn into_red_channel<C>(image: &Image<Rgb<C>>) -> Image<Luma<C>>
where
    Rgb<C>: Pixel<Subpixel = C>,
    C: Primitive,
{
    map_pixels(image, |p| Luma([p[0]]))
}
Creates a grayscale image by extracting the red channel of an RGB image.

# Examples
```
# extern crate image;
# #[macro_use]
# extern crate imageproc;
# fn main() {
use image::Luma;
use imageproc::map::into_red_channel;

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

let expected = gray_image!(
1, 2;
3, 4);

let actual = into_red_channel(&image);
assert_pixels_eq!(actual, expected);
# }
```
src/map.rs