27 August 2007

SIOX: foreground image extraction with Inkscape and GIMP

A couple of years ago when the SIOX (Simple Interactive Object Extraction) surfaced the web, a lot of enthusiasm and expectations were created. Now with released or almost released applications using it, we can have an objective look at it and draw practical conclusions, not only talk about the demos which may be (at least partly) doctored.

 With fast release cycles (about two releases a year) Inkscape was the first to have a working SIOX implementation in a release, back in Inkscape 0.44.
Inkscape is a vector drawing application, so it had to implement the algorithm in its specific way, namely as a part of the tracing tool, which convert from raster to vector, so the result is not pixel-perfect, but it does not even tries that.
Another downside is that Inkscape will use only the starting photo and one single path defining the region of interest (without a mark for the sure foreground), so the result is far from perfect and the tool is not really interactive.

The receipt is simple: import the photo, draw a freehand shape covering it, select both and run a trace by colors:


 GIMP got the tool even earlier in its development branch, but only the soon-to-be-released stable GIMP 2.4 will put it in the hands of the larger audience.
Here are a lot of options: brush sizes, feather edges, smoothing and you can mark both the sure background and the sure foreground, but after the SIOX job is done, it still needed to adjust a little using classic selection tools.

The receipt is more complex: open the photo and use the foreground extraction tool, it will offer a lasso-like tool to mark the region of interest around the subject and then a brush to sample the foreground. You can change the brush size and/or zoom in and out and even an eraser to unselect foreground. When ready, press Enter to get the subject selected, but you still have to use the real lasso selection to adjust it more:

I think I have some solid experience with both application, so my conclusion is obviously biased: SIOX may look like a timesaver for some operations, but in the end you will still need a loot of additional work to improve its results, you will not save that much time, so for me it is mostly a nice gimmick.
As particular applications, Inkscape is really lacking a way to define the sure foreground so it will give satisfactory results only for selected images but with GIMP you can zoom in and use smaller brushes (like in the good old Quick Mask way) and select anything you want.
Maybe if you want vectorization for complex images is better to extract the foreground in GIMP and trace in Inkscape the already extracted foreground.


  1. Very nice tutorial, btw this forground extraction tool seems new.

  2. thank you for this tutorial.
    i get as far as the second to last step (after selecting my foreground & hitting enter) & don't know where to go from there. please help

  3. @nas: at that point you have the subject (foreground) selected. You can do with it anything you need, like copy and paste it in a new image or layer or invert the selection and delete the background.