Remove white backgrounds from images


I have some product photos, from which I would like to remove the white background.
An example:

alt text

Is there a nice library or a manual way to do it with Cocoa or C?
For which keywords (image processing methods) do I have to search?

Best Solution

You can try ImageMagick:

convert input.gif -transparent white output.gif

For more advanced features you should try something like image masking or do it manually using any image library, setting the pixel values to something with a high alpha value.

See also this thread: