Skip to main content
Participant
April 21, 2023
Answered

Script to remove areas surrounded by transparency

  • April 21, 2023
  • 1 reply
  • 677 views

I am looking for scripting ideas to identify and remove any areas of an image that are surrounded by transparency.  

 

 

This topic has been closed for replies.
Correct answer Jason21999592z077

Thanks for the info I was able to utilize the script in this post  with modifying

 

// creae new array;  
				for (var m = 0; m < theArray.length; m++) {  

 

to:

                    // create new array;  
                    for (var m = 0; m < 1; m++) {
 
So it only gives me the largest subpath.
 
Cheers!
 
Jason

1 reply

Legend
April 22, 2023

It's not entirely clear what you want. If you want to remove "internal" holes in a selection (or mask), you can convert the selection to a path. Then, based on the current path, create a new one, only put all subpaths into add mode. Convert the new path to a selection.

Jason21999592z077AuthorCorrect answer
Participant
April 23, 2023

Thanks for the info I was able to utilize the script in this post  with modifying

 

// creae new array;  
				for (var m = 0; m < theArray.length; m++) {  

 

to:

                    // create new array;  
                    for (var m = 0; m < 1; m++) {
 
So it only gives me the largest subpath.
 
Cheers!
 
Jason