# Separate the R, G, B channels of RGB images into grayscale images. How should I operate?

**URL:** <https://forum.commonvisionblox.com/t/separate-the-r-g-b-channels-of-rgb-images-into-grayscale-images-how-should-i-operate/642>\
**Category:** .Net API\
**Created:** [January 5, 2019, 7:20am UTC](https://forum.commonvisionblox.com/t/separate-the-r-g-b-channels-of-rgb-images-into-grayscale-images-how-should-i-operate/642 "2019-01-05T07:20:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![soultower](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@soultower](https://forum.commonvisionblox.com/u/soultower)\
**Post date:** [January 5, 2019, 7:20am UTC](https://forum.commonvisionblox.com/t/separate-the-r-g-b-channels-of-rgb-images-into-grayscale-images-how-should-i-operate/642/1 "2019-01-05T07:20:43Z")

</div>

I want to separate the R, G, B channels of RGB images into three grayscale images. How should I operate?

---

<div class="post-metadata">

**Author:** ![parsd](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/parsd/32/7_2.png) [@parsd](https://forum.commonvisionblox.com/u/parsd)\
**Post date:** [January 5, 2019, 8:29pm UTC](https://forum.commonvisionblox.com/t/separate-the-r-g-b-channels-of-rgb-images-into-grayscale-images-how-should-i-operate/642/2 "2019-01-05T20:29:56Z")

</div>

You could do it like this:

```cs
var planeImages = image.Planes
                       .Select(plane => plane.Map())
                       .ToArray();

```

This doesn’t actually create new `Image`s, but views on the existing _image_ (we call these views `MappedImage`s). Thus this operation is very fast and doesn’t occupy a lot of space. If you want actual copies you can add

```cs
                       .Select(image => image.Clone())

```

before the `.ToArray()` call.
