sozin wrote:Hello, I am stumped on what should be a very basic operation: converting a black background to a white background.
Their is NOTHING simple about it. It can be simple IF the the image is simple, and that is what the pointers previously given will deal with. But simple images are very very rarely the case!
Exactly what you an do really depends on what the image looks like, and many tenchinques are covered in
ImageMagick Examples (v6), Background Removal,
http://www.imagemagick.org/Usage/masking/#bg_remove
The last technique, Background Removal using Two Backgrounds
http://www.imagemagick.org/Usage/maskin ... background
allows for perfect background masking and extraction of the foreground image complete with semi-transparent anti-aliasing edge pixels. However to do this you need more information than just one image can provide, specifically the same foreground image on two different (and known) backgrounds (not necessary a solid color background, though that is simpler).
Your example image however looks like someone badly converted from white background to a black background, and a simple flood fill method should be able to restore the white background. But replacing that white background will NOT be so simple.