Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a free tool that's good at extracting objects from photos?

It has to work on linux

For instance, extracting a person from a photograph.

share|improve this question
Define 'object'...'cause my first thought was something about cryptographic. – Bobby Nov 8 '09 at 22:45
Edited for clarification. I guess I should've said photographs instead of images – hasen Nov 8 '09 at 22:50

Using imagemagick, you can use a mask, edge detection, or a combination of the two techniques to cut shapes out of an image. The mask example in particular is very powerful if you have a picture with a known background.

The add texture to image example shows how to create a mask of a complex photo as part of the process, but it would work on a person also.

On a photo of a pagoda, the command:

convert pagoda_sm.jpg -fuzz 10% -transparent white \
      -alpha extract -negate  pagoda_mask.png


pagoda image mask

Which you can then use to cut the out everything that's not background in this case from the image.

There are no perfect tools, free or no, that perform this task automatically on all images.

share|improve this answer

Computer vision is a research area and a Hard Problem. I don't think you should expect to find free software that will do a good job of it.

share|improve this answer
I know, there's no way to do it perfectly, but there are many ways to make it easier. – hasen Nov 9 '09 at 3:30

It's overkill (a full application as opposed to a tool), but you can do this with GIMP.

The basic tutorials are here and you can certainly make a script that will speed the process up.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.