开发者

Hiding certain channel of an image with C#

i have an image processing application that is able to getpixel, anyone know how can i hide or show the RGB channel of my image? For ex开发者_如何学编程ample when i click a button call "RED" it will hide red channel and show only blue and green. i m using C# btw thanks alot


Try the AForge.NET library. Use the AForge.Imaging.Filters.ChannelFiltering filter.


Allocate a blank image (1 channel) of the same size as the original image. Then, when handling a button press for RED, do the following:

  • split your original image into R, G and B
  • compose a new image using blank, G, B (in that order, as the order of channels is important). This leaves out the red channel
  • display the composed image

Handle button presses for BLUE and GREEN in similar fashion.

split, compose and display methods are common in imaging libraries. Their exact names may differ depending on the library you are using, but their overall functionality should generally be the same. By the way, what library are you using? You didn't mention it in your question.

If you're not using any library to achieve what you're doing, you will have to write your own split and compose functions (or something along those lines). You would have to say more about the data structures you are using to get help in that direction.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜