Mobile app version of vmapp.org
Login or Join
Si6392903

: How can I select the convex hull of an existing selection? I'm trying to remove blue skies with clouds quickly from many images. I've used gimp's Color Selection Tool, which selects the sky

@Si6392903

Posted in: #Gimp #Selections

I'm trying to remove blue skies with clouds quickly from many images. I've used gimp's Color Selection Tool, which selects the sky but not the clouds. Since all clouds are in the sky, if I could expand the selection to encompass everything within the area, I'd be done. Does gimp have a tool for this?

Additionally, it would be great if someone can recommend a way to automate this process, possibly using python scripting for gimp, because I need to do it for a couple of hundred images.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Si6392903

2 Comments

Sorted by latest first Latest Oldest Best

 

@BetL875

Gimp script: Remove holes from selection

There is an external script for Gimp which removes holes from a selection. We can download the script from the Gimp Plugin Registry and unzip it to our scripts directory we had defined in our Gimp preferences.

After restarting Gimp we can access the script from Selection > Remove holes... menu.




Selection with holes


Holes removed

10% popularity Vote Up Vote Down


 

@Dunderdale640

If you have a clearly defined border, the "intelligent scissors" tool can usually follow it neatly; unlike the colour select, all the content inside the edge line will be fully selected. The one limitation of the tool is that you can't force it to draw straight lines. To get the selection neatly to the straight sides of the image, you'll need to use rectangle or free select in "additive" mode on top of the edge-detection selection from the scissors.

If your edge is not strongly enough defined for the scissors on their own, you could use the colour select and then switch to quick mask mode. The area you of the active selection will show up as a red mask, and you can paint (or erase) any parts to change that selection. So painting over an unselected area in black (shown as red) will make that area part of the selection when you go back to normal mode.

What may be hard to get your head around is that you can select areas while in quick-mask mode in order to quickly fill them with a solid colour. When you turn off quick mask, the temporary selection is discarded and only the final value of the mask (i.e., the coloured area) is used as your new selection.

So for your image, you could take the selection you had of the blue sky, and then switch to quick mask mode. Using the "magic wand" tool (which selects a continuous area of the same colour) you could select the clouds, which will be a continuous transparent region in quick mask mode. If the gaps in your selection caused by the clouds are safely away from the edges of the masked-out area (sky), you could even just use the basic (rectangle/free) select tools to grab them without worrying about overlapping the already-masked parts. Either way, once selected, use the paint can tool to fill those sections in black, until the entire area you want selected is masked out.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme