An advice? You use of parallel is pretty much pointless here. You kill all the performance with the use of
GetPixel/SetPixel
. You should not use these methods at all, unless you don't care of performance at all, or if you have to access very few pixels. If this is
System.Drawing
, you should use
System.Drawing.Bitmap.LockBits
:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.lockbits.aspx[
^].
The MSDN help page on the first of the methods contains a short and very simple code sample.
With WPF, you need to use pretty similar approach with the class
System.Windows.Media.Imaging.WriteableBitmap
:
http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap.aspx[
^].
—SA