Jump to content

Crop to smallest enclosing rectangle?


Go to solution Solved by BoltBait,

Recommended Posts

Upon using the Crop to Selection action on selections created with the magic wand tool, anything not in the original selection outline but otherwise in the resulting canvas is deleted. Is there a way to crop to the selection without deleting any of the content in the resulting canvas?

Link to comment
Share on other sites

53 minutes ago, personage said:

Is there a way to crop to the selection without deleting any of the content in the resulting canvas?


I'm puzzled as to why do you need to use the Magic Wand then?  Why not simply make a Rectangular selection that encloses the area you want and crop to that?

Link to comment
Share on other sites

3 hours ago, Tactilis said:


I'm puzzled as to why do you need to use the Magic Wand then?  Why not simply make a Rectangular selection that encloses the area you want and crop to that?

In Photoshop, it's handy for cropping out panels of comics and elements of webpages. If I want to approach pixel-perfect accuracy with paint.net's toolset, I need to zoom in with the rectangular selection tool and manually drag out the corners, which takes longer.

Link to comment
Share on other sites

  • Solution

Let's say you start with an image.  You select something with the magic wand:

image.png

Next, press the Crop button :ImageCrop: and are left with something like this...

 

image.png

 

Finally, use Adjustments > Transparency and make the image full opaque:

 

image.png

 

Problem solved.

 

 

  • Upvote 2
Link to comment
Share on other sites

6 hours ago, BoltBait said:

Let's say you start with an image.  You select something with the magic wand:

image.png

Next, press the Crop button :ImageCrop: and are left with something like this...

 

image.png

 

Finally, use Adjustments > Transparency and make the image full opaque:

 

image.png

 

Problem solved.

 

 

That works well. Thank you.

Link to comment
Share on other sites

8 hours ago, MJW said:

Though I'm not completely sure what you want to do, I made a plugin with the mellifluous name "Unselected Rectangle Keeper" that may perhaps help.

 

 

I had tried using your plugin, but it doesn't seem to work in my version of paint.net (5.0.13).

Link to comment
Share on other sites

4 hours ago, personage said:

I had tried using your plugin, but it doesn't seem to work in my version of paint.net (5.0.13).

 

Hmm. I just tried it in 5.0.13, and it worked for me. Are you sure you used it correctly? It's not the most intuitive plugin. You need to select the background with the Magic Wand, then run the plugin. It only erases the area outside the bounding box of foreground object, it doesn't crop to it, since at least at the time it was written, plugins couldn't crop (I think that's still the case).

Link to comment
Share on other sites

On 8/15/2024 at 11:06 AM, MJW said:

 

Hmm. I just tried it in 5.0.13, and it worked for me. Are you sure you used it correctly? It's not the most intuitive plugin. You need to select the background with the Magic Wand, then run the plugin. It only erases the area outside the bounding box of foreground object, it doesn't crop to it, since at least at the time it was written, plugins couldn't crop (I think that's still the case).

I was able to get it to work after some experimenting. Thank you for the plugin.

Link to comment
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.

×
×
  • Create New...