Search code examples
c#image-processingimage-manipulation

How to manipulate images at the pixel level in C#


How do I manipulate images at the pixel level in C#?

I need to be able to read/modify each bitmap pixel RGB values separately.

A code sample would be appreciated.


Solution

  • If you want speed, then LockBits. See here for a good walkthrough by Bob Powell. If you just want to edit a few, then GetPixel/SetPixel should do what you want.