OK, now I see you're using
System.Drawing
. For performance reasons, never use
SetPixe
l/
GetPixel
! Use
System.Drawing.Bitmap.LockBits
. The MSDN help page has a code sample:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx[
^].
There are different approaches to color balance. You can implement the simplest approach: a manual balance. You present reg, green and blue sliders; the user adds or reduces the contribution of each; and you retouch each color component one by one for each pixel.
—SA