This is quite simple actually. All you need to do is determine the color of a given pixel, and then subtract the RGB values from 255 (the maximum) and then reset the pixel.
Here is the pertinent code.[Code - C#]
Note: This modifies the existing image, so work on a copy if you want to maintain the original.