Recommended Posts

The DLL: Object Pruner.zip

Object Pruner is in the Object submenu.

========================================

 

Object Pruner conditionally erases objects based on their sizes.

Objects are connected regions of non-transparent pixels. The size of each object is compared to the size of the largest object. Objects that fall outside the minimum and maximum bounds are erased. The size of each object is the number of pixels in the object.

With the default settings, all objects except the largest object will be erased.

The controls are:

Minimum Size of Objects to Keep (Relative to Largest Object): Specifies the minimum size for objects that should be kept, relative to size of the largest object.

 

Maximum Size of Objects to Keep (Relative to Largest Object): Specifies the maximum size for objects that should be kept, relative to size of the largest object. (If this value is less than one, the largest object will be erased.)

 

Transparent Color for Erased Objects: Specifies the transparent color that replaces the pixel color for erased objects. The choices are Transparent White, Transparent Black, or the original pixel color with the alpha value set to zero.

 

Show Objects as Colors (Green = Keep; Red = Erase): Specifies that objects which will be kept should be shown as green, objects which will be erased should be shown as red, and originally-transparent background pixels should be shown as white. This is a debug feature that should normally be disabled before exiting. Because all pixels are shown as opaque, this option can be useful for discovering low-opacity pixels that connect what appear to be separate objects.

 

 

The user Interface:

 

Object-Pruner-UI.png

 

 

========================================

 

I'm not sure how useful it is. The main purpose is to handle a situation I've encountered when trying to remove a non-uniform background color with the Magic Wand. I select the background color, but there are small scattered regions of the background that don't get selected. Increasing the Magic Wand tolerance results in parts the foreground being selected. If I erase the selected background, I'm left with unerased areas.

 

Ideally, after erasing most of the background, I could just select the foreground with a low-tolerance Magic Wand, invert the selection, and erase the background completely. However, I'm often unable to find a tolerance that completely selects the foreground without selecting the entire image.

 

The Object Pruner is intended to help erase all the scattered regions remaining after erasing most of the background.

 

Since I wrote it, naturally it has more options than it probably needs.

  • Like 3
  • Upvote 1

Share this post


Link to post
Share on other sites

Thank you!
I just added it now. I hope it will quickly eliminate the tiny artifacts that are left after using the Wand Tool. Often they are revealed only after I add a drop shadow or a glow.

I will try it sometime this weekend!

Share this post


Link to post
Share on other sites

Downloaded!  I only wish I could have had a pruner like this when I had a garden 🌼

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.