Skip to main content
Inspiring
June 26, 2023
Question

Keep selections by width or height and deselect other selections

  • June 26, 2023
  • 1 reply
  • 785 views

I use color range tool in photoshop to select text or numbers in chart images like following: 

 

but in left side of text selections there are many annoying selections that must deselect like following: 

 

are there any way to keep areas selections by set min or max width or height and deselect other annoying areas? If you pay attention, the height of the texts is different from the height of the logo. or If you pay attention, the width of first image texts are bigger than logos. 

maybe i need a script that i set following in it and then it keep selections only have following info: 

Set Max width or Set Min width or Set both 

Set Max height or Set Min height or Set both 

 

I attach used samples to this post for test

This topic has been closed for replies.

1 reply

Inspiring
June 27, 2023

@c.pfaffenbichler  

if have any idea for this. please provide. tnq

c.pfaffenbichler
Community Expert
Community Expert
June 28, 2023

Create a Work Path from the Selection, then assess the subPathItems’ pathPoints against a clear criterion and proceed accordingly. 

 

But in the second example the logo »…im« the logo seems barely taller than the distance from the top of the numbers to the bottom of the comma. 

c.pfaffenbichler
Community Expert
Community Expert
June 28, 2023
quote

Have the script determine the bounds of the individual subathItems (the leftmost, topmost, righmost, bottommost pathPoints should suffice) and figure out if there actually is a criterion that provides a reliable distinction – but the example is problematic again; »United States« has two elements as does »27,35…«. 

So simply keeping the leftmost and rightmost element is not enough and you need to add additional checks. 


By @c.pfaffenbichler

I forgot to remove the left side of the chart bars. The left side of the chart bars does not need any changes. Only the right side is important. So the two parts of the United States don't matter! 

If it possible provice code for right side like following: 


If you want to use Scripts for your highly specific tasks you should delve into the matter so that you are able to create and edit them yourselves.