title: c# image filter parallel.for takes longer time
body: <p>here is the code is there any way to make it faster cause its slowerden single </p>
  
  <pre><code>public Bitmap pSetInvert(Bitmap _currentBitmap)
      {
          Bitmap temp = (Bitmap)_currentBitmap;
          Bitmap bmap = (Bitmap)temp.Clone();
          Color c;
          Parallel.For(0, bmap.Width, i =&gt;
          {
              lock (bmap)
              {
                  for (int j = 0; j &lt; bmap.Height; j++)
                  {
                      c = bmap.GetPixel(i, j);
                      bmap.SetPixel(i, j, Color.FromArgb(255 - c.R, 255 - c.G, 255 - c.B));
                  } 
              }
          });
          return (Bitmap)bmap.Clone();
      }
  </code></pre>