12

This seems like a basic feature, but I'm missing it somehow. I have the the outline of a state with a discrete colorful border.

Original

I'd like to select the border AND the inner contents so I can produce something like this (sloppily done here with the Lasso)

Final Product

I've tried selecting the entire border using the fuzzy select (magic wand) or select by color but this only gives me the border itself.

Border Select

In the Selection menu, I can invert the selection, but that grabs everything.

Inverted Border

How can I select all the contents inside a selected region?

1
  • 1
    Given the simple shape, you can reproduce it very easily in a few clicks (15 or so) using the freehand selector in "polygon" mode or the Path tool.
    – xenoid
    Commented Aug 25, 2016 at 13:10

6 Answers 6

10

This is a job for the quick mask feature. I allows you to paint on the selection itself as if it were the image -

So, after selecting the border itself with the magic wand as you did above, click on the small "hidden" button to the left of the horizontal scroll bar. That shows a red tinted translucent representation of your selection itself, and all painting you do will affect it - it is a grayscale drawable, so full white (255) means "fully selected" and black (0) means "unselected" (although the representation on this view is inverted: selected areas are shown as transparent, unselected as opaque). Then, just use the bucket-fill tool to fill u the outside (or inside) of your selection with "White" (Which will render the trnaslucent tint transparent), revert back to normal editing by clicking on the quickmask again - and you are done.

It certainly does take much fewer steps than Kylemit's answer.

4

Here's a simple way to let the fuzzy select drive the entire process.

TLDR: grab the border and invert the selection, then fill the outside and paste over the original image.

Steps By Step:

  1. Original
    enter image description here
  2. Fuzzy Select Border
    enter image description here
  3. Select > Invert + Cut
    enter image description here
  4. Bucket Fill Tool Outside
    enter image description here
  5. Select All + Copy
    enter image description here
  6. Undo until Original Image + Paste
    enter image description here
  7. Layer > Anchor Layer
    enter image description here
  8. Fuzzy Select Outside + Cut
    enter image description here
1
  • 2
    That is nice - but it is much easier just to use the quickmask with bucket fill.
    – jsbueno
    Commented Aug 25, 2016 at 8:22
2

You can utilize multiple selection tools for a single selection. Try color selecting the stroke with the Magic Wand (adjust the tolerance at the top to refine the selection) then using any of the other selection tools like the Rectangle Marquee tool for example, hold shift and select the area within.

Holding Shift (while dragging a selection) with a selection tool adds the new selection to the current selection. Holding Alt subtracts from the current selection.

2

Assuming that you don't have the border on a separate layer:

  1. Use the fuzzy select (magic wand tool) to select the interior. Click and hold on any white/grey point inside, then drag until most of the inside is selected.

You won't have the thin text selected but that's okay.  You can change the "Select by" mode to "Saturation" if you really want to be thorough (the red is super saturated so it won't get selected).

  1. Use Select>Grow set to 4px or so. This will partially select the red border and also consume the small unselected areas in the middle.

  2. With the magic wand still active, shift+click on the red border.

Hope that helps!

2

On selecting the red line we will end up with an outer and an inner selection of the area enclosed.

This big "hole" can be removed using an external script Remove Holes (from Selection) designed to just do that.

Also see How can I select the convex hull of an existing selection? for an example.

0

Can't comment yet so I'll make a new answer combining Takkat and sojmoore. I had an outline in an image which i wanted to select, followed by the entire interior as described in this question. The outline had been created in the original image by some overlay arithmetic, so the outline color was modulated slightly by the varying color of the pixels beneath it (there's probably a single word for that in graphics processing but I don't know it). As a result, I could select much of the outline by Shift clicking with the select by Color, on different pixels of the outline... up to a point. Eventually it was not possible to tell in the selection editor if i was adding anything or not. At this point, The Remove Holes script did not work. In order for it to work, I first had to add some Fuzzy Selection of contiguous regions by color, inside the outline selection. Only then did the remove holes script work (perfectly I might add).

3
  • This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
    – lmlmlm
    Commented Oct 19, 2022 at 20:14
  • I'll admit I do get this a lot, across the various stack overflow/exchange web sites. I'm not a natural, nor a trained, software user and it seems that SO is rather good at detecting this! Nevertheless it has been such a huge help to me over the years my impulse is to contribute back where and when I can.
    – J B
    Commented Oct 20, 2022 at 14:47
  • Reading your answer is tough without seeing some images. If you really want to help long-term visitors to this question (which is the actual purpose of these answers), you should edit and add images and show what worked for you. Otherwise it sounds like a hard to read comment with little value for future visitors. Comment-answers are not encouraged on stack websites, which are answer-based, and the answers need to provide long-term value.
    – lmlmlm
    Commented Oct 20, 2022 at 16:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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