Remove white backgrounds from images

c++cocoaimage-manipulationimage-processingobjective-c

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

alt text
(source: dewalt.at)

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: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=10665