MJW

Unselected Rectangle Keeper

Recommended Posts

This is a plugin I wrote a while ago, which I posted to a thread titled crop black and white images down to the smallest rectangular size that contains the black part.  Apparently inspired by the thread's title, I chose the rather awkward name Unselected Rectangle Keeper. It's in the Selection submenu.  It has no user interface.

 

This is the plugin: UnselectedRectangleKeeper.zip

 

The icon: UnselectedRectangleKeeper.png

 

What it does sounds kind of strange, but is useful for cropping images to the smallest region that doesn't match the surrounding color.

 

If you have a rectangular selection which contains a non-selected region, it erases everything in the selection that's outside the bounding rectangle of the non-selected region:

 

To crop to the smallest rectangle containing something not matching the color of the background:

Use the Magic Wand with a low tolerance to select the outside color.

Run Unselected Rectangle Keeper.

Deselect.

Use the Magic Wand to select the transparent region.

Invert the selection.

Crop to the selection.

 

Example:

 

Before (white region is selected).

UnselectedRectangeKeeperBefore_zpsdihyid

 

After.

UnselectedRectangeKeeperAfter_zpsanywvxn

 

 

EDIT: Added link to plugin (which I completely forgot to do). Thanks for the reminder, lynxster4!

 

  • Upvote 4

Share this post


Link to post
Share on other sites

@MJW....maybe you should post the zip file above, so everyone doesn't have to go the link you provided?

They can go to the link for more information.  :)

  • Upvote 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.