Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial (non-profit) use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. My email address is fmw at alink dot net. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. It is also subject, in a subordinate manner, to the ImageMagick license, which can be found at: http://www.imagemagick.org/script/license.php Please read the Pointers For Use on my home page to properly install and customize my scripts. |
Crops an image to a specified aspect ratio. |
last modified: December 15, 2018
USAGE: aspectcrop [-a aspect] [-g gravity] infile outfile
-a ... aspect .... aspect ratio value desired; width to height ratio; values PURPOSE: To crop an image to a specified aspect ratio. DESCRIPTION: ASPECTPAD crops an image to a specified aspect ratio. ARGUMENTS: -a aspect ... ASPECT is the desired width to height aspect ratio. Values are either floats>0, such as 2 (landscape) or 0.5 (portrait), or two floats separate by a colon (and no spaces), such a 2:1 (landscale) or 1:2 (portrait). The default is input aspect ratio (no change). -g gravity ... GRAVITY alignment for cropping; Any IM -gravity setting is allowed. Options are: center (c), north (n), south (s), east (e), west (w), northwest (nw), northeast (ne), southwest, (sw) or southeast (se). The default=center. CAVEAT: No guarantee that this script will work on all platforms, nor that trapping of inconsistent parameters is complete and foolproof. Use At Your Own Risk. |
Example 1 |
||
Original |
Arguments: |
Arguments: |
size 265x333 |
size 265x265 |
size 167x333 |
Example 2 |
||
Original |
||
Arguments: |
||
Arguments: |
||
Arguments: |
What the script does is as follows:
This is equivalent to the following IM commands for the case of automatic mode
|