Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
4

Selecting all instances of a color 'A' touching color 'B'?

Explorer ,
Sep 28, 2023 Sep 28, 2023

Copy link to clipboard

Copied

Howdy Folks,

Does anyone know if it is possible to select all instances of one color where it touches another color? I don't really know how to explain with words so that's where my images of a simplified example come in:

red splotch.jpg

In this case I want to select all the green that is touching white while leaving all of the green that isn't alone so I can delete the selected ones.

 red splotch desired outcome.jpg

So far I have been using the magic wand tool on contiguous and selecting them one at a time which is inconvienient because my actual use case has over 50 selections I have to select and then delete. The inverse, using whe magic wand tool without contiguous, is even worse because there are 100s of internal patches I have to then deselect. Is there a way to select all the green touching white all at once without selecting all the green?

As always so greatful for any help anyone can offer!

 

TOPICS
Windows

Views

457
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Apr 03, 2024 Apr 03, 2024

I figured out a way to do it! not the most sophisticated answer but it works so I thought I'd follow up. Fill the background with the green and then reselect it with the magic wand, contiguous on, and delete.

ex1.pngex2.png

Votes

Translate
Adobe
Community Expert ,
Sep 28, 2023 Sep 28, 2023

Copy link to clipboard

Copied

I would recommend using Select > Color Range... to select all the green spots to make the initial selection. It will include all the green spots. Then use the Lasso in Subtract from selection in the Options bar or while holding the Option (macOS) / Alt (Windows) modifier key to temporily invoke subtracting from the selection and draw around the selected green spots in the middle that you don't want to remove. Then delete or make a layer mask from the selection to hide the ones that are selected on the edges.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 28, 2023 Sep 28, 2023

Copy link to clipboard

Copied

Hi Myra, I find that the magic wand tool with contiguous off consistently selects all the green for me and is less steps than the Select>Color Range Method. This advice of mass deselecting the middle green spots works for the example image but for my use case it's not so easy to do.

 example3.png

In this case I would be deleting all the Black that touches Blue and it wouldn't work so well. I was mostly wondering if there was a way to select them in one go, willing to even look into scripting something if that would be possible.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Apr 03, 2024 Apr 03, 2024

Copy link to clipboard

Copied

LATEST

I figured out a way to do it! not the most sophisticated answer but it works so I thought I'd follow up. Fill the background with the green and then reselect it with the magic wand, contiguous on, and delete.

ex1.pngex2.png

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines