Jump to content

plugin that crops selection then resizes it


Recommended Posts

Here is what I need to do:


1. Open jpg picture

2. Select a square region

3. Crop to selection

4. Resize image to 100px X 100px

5. Save jpg


I would like to create a plugin that will take care of steps 3 and 4 with one click


I know c# very well and have downloaded and configured the plugin template for Visual Studios via this post:



I'm not sure where to go from here.


The pseudocode would look something like this:


Get selection bounds

Save pixels inside selection bounds to temp image

Resize temp image to 100px X 100px

return temp image


If this can be done without creating a plugin that would be fine also.


P.S. Is there documentation on the methods from the paint.net dlls?

Link to comment
Share on other sites

Plugins may not manipulate the selection region itself, and they operate entirely within any selection when manipulating pixels.  Therefore a plugin may not 'crop to selection' as, by definition, the plugin cannot remove the pixels outside the selection.


More >> http://forums.getpaint.net/index.php?/topic/14566-what-is-and-isnt-possible-when-writing-plugins/

Link to comment
Share on other sites

Paint.NET doesn't do macros, but there are a handful of shortcuts you can use...


1. Make your selection using Rectangle Select + Shift to force the selection square.


2. Ctrl + C (Copy to clipboard)


3. Ctrl + Alt + V (Paste clipboard into new image)


4. Ctrl + R (Image > Resize)


5. Ctrl + S (Save) 

Link to comment
Share on other sites

That's pretty much what I have been doing. I was just hoping to make it a little bit easier.


Is there a reason Paint.net doesn't do macros or has that feature just not been added yet?


From what I've been reading a lot of people could use that feature.


I love Paint.net but it looks like I will need to find another program to do this.

Link to comment
Share on other sites


1. Make your selection using Rectangle Select + Shift to force the selection square.

2. Ctrl+Shift+X (crop to selection)

3. Ctrl+R (resize)

4. Ctrl+Shift+S (save as...)

I think the bottleneck above is step 3 where you have to type in the size you want. If there was a way to customize presets kinda like sand33p's suggestion here (but in the resize window), that could streamline the process a bit.

A one-click solution for this issue would be too specific to be beneficial to most people.

No, Paint.NET is not spyware...but, installing it is an IQ test. ~BoltBait

Blend modes are like the filling in your sandwich. It's the filling that can change your experience of the sandwich. ~Ego Eram Reputo

Link to comment
Share on other sites

This feature would be great as standard part of Paint.net.

I have lot of images which I have to crop and resize to same size.


Selection => Fixed Ratio => Saved Preset (eg. 700x300) => Crop&Resize (which would crop and downscale or upscale image to targeted size).

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.

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