Grabcut GIMP plugin

I’m searching for an implementation of Grabcut for GIMP.

GrabCut is an image segmentation method based on graph cuts.

Starting with a user-specified bounding box around the object to be segmented, the algorithm estimates the color distribution of the target object and that of the background using a Gaussian mixture model.

The results it gives look pretty rough. There are other/better methods but I quite like that rough aesthetic.

I’ve stumbled upon a 2006 academic paper that says it’s made a GIMP plugin https://dl.acm.org/citation.cfm?id=1108618 However, I can’t find this plugin. Does anyone know where I can find it or another plugin that implements Grabcut in GIMP?

Hi @hellocatfood,

Not really the same, but I wonder if you have checked the Foreground Select Tool in Gimp?

Have fun!
Claes in Lund, Sweden

Yes, I’ve used the Forground Select tool before. However, it works differently in that you have to draw around your area and then mark pixels. Grabcut allows you to just draw a box around your selection and it attempts to extract it.

GIMP uses the SIOX method, which has been implemented in many FLOSS apps. It can actually be done on a rectangular area as well but labelling components within the area makes it even more accurate. You can do the same with Grabcut, so it comes down to SIOX vs Grabcut. Actually SIOX has advantages over Grabcut; in particular, noise and video.

In the end I made my own standalone grabcut implementation GitHub - hellocatfood/grabcut-gui: Use grabcut on an image with basic UI and basic alpha masking

Unlike the other implementations that I’ve seen it gives you a GUI to do the grabcut-ing and doesn’t resize the input in order to fit it on screen.

cat(64%2C%2022%2C%20128%2C%20100)

It also attempts to apply an alpha mask, although this can be improved.

3 Likes

Seems like you are quite capable. Would you mind writing the plugin for GIMP? I believe the site admins could store it for you if it goes well.

Nope, I can’t write a GIMP plugin.

Write a plugin of gimp is not so very difficult.
But this can do it foreground extraction:

1 Like

@bazza The G’MIC filter still requires labelling. @hellocatfood only wants to mark the ROI with a rectangle, which GrabCut and SIOX can both do. However, as I said above, labelling refines the selection and gives one a better extraction.

@afre It would be interesting a method “extract foreground [with colormap]”

@bazza if it’s not difficult then you’re welcome to do it yourself.

@afre as I mentioned in my first post I like the rough cut aesthetic of grab cut. I’m aware of the foreground selection tool (and other similar tools) and how much more precise it is.

I am not disputing your claim. I am merely saying that, depending on the implementation, GrabCut can have labelling. Same with SIOX: it could be standalone, or with labelling, as it is in GIMP.

If you are comfortable with OpenCV, by all means, use it. It is a powerful package. :+1:

1 Like