Request: Crop/pad image to aspect ratio
Moderators: XnTriq, helmut, xnview, Dreamer
-
- Posts: 578
- Joined: Sat Sep 04, 2004 5:09 pm
Request: Crop/pad image to aspect ratio
Let's say we have a bunch of images with varying dimensions (w×h) and I want them all to fit into a 16:9 canvas, but I don't want to define a fixed size (like 1920×1080px). The wider side should stay the same, only the narrow side of the image should be padded with a given color or transparency until the desired aspect ration is met.
It seem like there's currently no way to achieve that, so I'm asking for a solution.
Related: https://newsgroup.xnview.com/viewtopic.php?f=79&t=38104
Basically what this script does: http://www.fmwconcepts.com/imagemagick/aspectpad/
It seem like there's currently no way to achieve that, so I'm asking for a solution.
Related: https://newsgroup.xnview.com/viewtopic.php?f=79&t=38104
Basically what this script does: http://www.fmwconcepts.com/imagemagick/aspectpad/
-
- Author of XnView
- Posts: 45526
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Posts: 578
- Joined: Sat Sep 04, 2004 5:09 pm
Re: Request: Crop/pad image to aspect ratio
In other words, yes. Don't scale the image content, just adjust the canvas size and fill the padded area outside with a color.
Sorry, I don't come here as often as I used to.
-
- Author of XnView
- Posts: 45526
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- Author of XnView
- Posts: 45526
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
Re: Request: Crop/pad image to aspect ratio
This problem is supposed to be fixed in XnView MP 1.3.1. Please check and confirm the bug fix here.
Pierre.
-
- XnThusiast
- Posts: 4295
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: ** English - English (=Master)
<Moderator's note: This post has been split from another topic>
AspectPad ??
I don't recognise this as a standard English term, a quick search seems to show it to be the name of one of the scripts in "Fred's ImageMagick Scripts" collection, possibly nothing more.
While I don't immediately understand the action performed, perhaps it could be represented by a general term based on "Fit" ?
AspectPad ??
I don't recognise this as a standard English term, a quick search seems to show it to be the name of one of the scripts in "Fred's ImageMagick Scripts" collection, possibly nothing more.
While I don't immediately understand the action performed, perhaps it could be represented by a general term based on "Fit" ?
-
- Posts: 8705
- Joined: Sun Oct 12, 2003 6:47 pm
- Location: Frankfurt, Germany
Re: Request: Crop/pad image to aspect ratio
Always good if new features make it into XnView. Basically, this new feature allows for resizing canvas of an image to a specific ratio is added.
ATM, this feature...
...is implemented in XnView as "AspectPad".
...is a completely new, stand-alone conversion.
"AspectPad" is difficult to understand and almost impossible to translate to other languaes. This would be a new, exotic terminology in XnView which makes things complicated. No good.
I wonder whether this little functionality could be included into XnView in a more intuitive way. Already, there is "Canvas resize" which allows for resizing the canvas of an image while not resizing the image itself. As original poster pointed out "Canvas resize" doesn't allow for resizing to a specific ratio. So I'd suggest: Add an option "Ratio" to "Canvas resize" which can be choosen as an alternative to "Size" and then we're done. A simple and intuitive solution without re-inventing the wheel.
What do other people think?
ATM, this feature...
...is implemented in XnView as "AspectPad".
...is a completely new, stand-alone conversion.
"AspectPad" is difficult to understand and almost impossible to translate to other languaes. This would be a new, exotic terminology in XnView which makes things complicated. No good.
I wonder whether this little functionality could be included into XnView in a more intuitive way. Already, there is "Canvas resize" which allows for resizing the canvas of an image while not resizing the image itself. As original poster pointed out "Canvas resize" doesn't allow for resizing to a specific ratio. So I'd suggest: Add an option "Ratio" to "Canvas resize" which can be choosen as an alternative to "Size" and then we're done. A simple and intuitive solution without re-inventing the wheel.
What do other people think?
-
- Posts: 8705
- Joined: Sun Oct 12, 2003 6:47 pm
- Location: Frankfurt, Germany
Re: ** English - English (=Master)
"AspectPad" is indeed pretty weird. I've started a discussion in topic "Request: Crop/pad image to aspect ratio"cday wrote: Mon Nov 28, 2022 9:47 pm AspectPad ??
I don't recognise this as a standard English term, a quick search seems to show it to be the name of one of the scripts in "Fred's ImageMagick Scripts" collection, possibly nothing more.
While I don't immediately understand the action performed, perhaps it could be represented by a general term based on "Fit" ?
-
- XnThusiast
- Posts: 2213
- Joined: Sat May 09, 2015 9:37 am
Re: Request: Crop/pad image to aspect ratio
Canvas resize dialog is the perfect place for this functionality.
btw, where can I check AspectPad in xnview?
ps. I will add some pictures from other software, just for reference. Since I already have them
btw, where can I check AspectPad in xnview?
ps. I will add some pictures from other software, just for reference. Since I already have them

-
- Author of XnView
- Posts: 45526
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France
-
- XnThusiast
- Posts: 2213
- Joined: Sat May 09, 2015 9:37 am
Re: Request: Crop/pad image to aspect ratio
got it, thanks. Yeah, I definetly would expect this feature in 'Canvas resize' not as standalong one
As far as I understand it only adds canvas space, never crop, so I suggest to add something like "crop/add" selector (maybe use anchor point to define where to crop more).
Also entering values in number x number format is slightly more convinient than just a single nimber, e.g. 16:9 easier to use than 1.78 imho (or use both, like in Irfanview).
Some examples:
1. have ratio in Canvas resize dialog
- ACDSee
- Irfanview
- FastStone
- Photoshop
- GIMP
You do not have the required permissions to view the files attached to this post.
-
- XnThusiast
- Posts: 4295
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Request: Crop/pad image to aspect ratio
Within the present Canvas resize menu design, a new option Mode -- Fit ratio could describe the new function if new canvas, with the set Background colour, is added as required?
But would that be compatible with the rest of the menu?
But would that be compatible with the rest of the menu?
-
- XnThusiast
- Posts: 2213
- Joined: Sat May 09, 2015 9:37 am
Re: Request: Crop/pad image to aspect ratio
quick mockup
- extend/crop mode is not that obvious though
- extend/crop mode is not that obvious though
You do not have the required permissions to view the files attached to this post.
-
- Posts: 8705
- Joined: Sun Oct 12, 2003 6:47 pm
- Location: Frankfurt, Germany
Re: Request: Crop/pad image to aspect ratio
Thank you, user0 and cday for your replies. Good to see various examples handling the same issue and even mockups.
From your feedback I read that adding "Ratio" or "Aspect ratio" in "Canvas resize" makes sense. I just had a look at "Canvas resize" in batch conversion and noticed that in batch conversion there's a mode available (Normal, Square - longest side, Square - Shortest side) available which aren't available in normal "Canvas resize". Again, that's no good.
From what I can see for canvas resize three modes are needed:
Please note that "Canvas resize" and "Cropping" are related actions which should be kept separate to keep dialogs simple.
From your feedback I read that adding "Ratio" or "Aspect ratio" in "Canvas resize" makes sense. I just had a look at "Canvas resize" in batch conversion and noticed that in batch conversion there's a mode available (Normal, Square - longest side, Square - Shortest side) available which aren't available in normal "Canvas resize". Again, that's no good.
From what I can see for canvas resize three modes are needed:
- Absolute size (= resize canvas to specified width & height [pixel or percent])
- Relative size (= increase canvas width & height by specified number of pixels or percent)
- Aspect ratio (= resize canvas to a specific aspect ratio)
Please note that "Canvas resize" and "Cropping" are related actions which should be kept separate to keep dialogs simple.