I think I found a bug in GetPixel, there are some casts missing for retrieving the colour components. You should be able to reproduce the issue by looping over the pixels and doing bmp.SetPixel(x,y,bmp.GetPixel(x,y))
WriteableBitmapBaseExtensions.cs Line 170
return Color.FromArgb(a, (byte)((c >> 16) * ai), (byte)((c >> 8)* ai), (byte)(c * ai));
Fix:
return Color.FromArgb(a, (byte)((byte)(c >> 16) * ai), (byte)((byte)(c >> 8)* ai), (byte)((byte)c * ai));
I did try to create and upload a patch but for some reason the mime type of the file was jpeg, I don't know if that is because my TortoiseSVN is slightly out of date or if the problem lies elsewhere.
WriteableBitmapBaseExtensions.cs Line 170
return Color.FromArgb(a, (byte)((c >> 16) * ai), (byte)((c >> 8)* ai), (byte)(c * ai));
Fix:
return Color.FromArgb(a, (byte)((byte)(c >> 16) * ai), (byte)((byte)(c >> 8)* ai), (byte)((byte)c * ai));
I did try to create and upload a patch but for some reason the mime type of the file was jpeg, I don't know if that is because my TortoiseSVN is slightly out of date or if the problem lies elsewhere.