I want to separate the R, G, B channels of RGB images into three grayscale images. How should I operate?
You could do it like this:
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
.Select(image => image.Clone())
before the .ToArray()
call.
3 Likes