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. |
Resizes an image and squares it up either by padding or cropping |
last modified: December 15, 2018
USAGE: squareup [-s size] [-m mode] [-c color] [-g gravity] [-f filter] infile outfile
-s .... size ......... desired size; value in pixels or value% as scale factor; PURPOSE: To resize an image and square it up either by padding or cropping. DESCRIPTION: SQUAREUP resizes an image and squares it up either by padding it with a constant background color or transparent background or crops it. If padded, the larger dimension will be resized and the smaller dimension will be padded. If cropped, the smaller dimension will be resized and the larger dimension will be cropped. The result will be a square image, i.e. the width and height will be identical. ARGUMENTS: -s size ... SIZE specifies the desired output size. The value may be specified as an integer either in pixels or as floating point scale factor in percent (including the % symbol). The default, if left off, is to keep the image the same size. -m mode ... MODE specifies to either pad or crop the image to square it off. The default is pad. -c color ... COLOR specifies the background color to use when mode=pad. Any valid IM color specification may be used. To make the background transparent, set the color either to none or trans. The default is black. -g gravity ... GRAVITY is the region of the image to use when mode=crop. Values may be North, East, South, West or Center. The default is Center. -s sat ... SAT specifies a gain in saturation. Values for sat must be non-negative integers. A value of 100 indicates no saturation change. Larger/smaller values indicate more/less saturation. -f filter ... FILTER is any valid IM resize filter. The default is Lanczos. 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. |
Taller Than Wide Image -- Variations Of Parameters | |||
Original Image |
|||
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Wider Than Tall Image -- Variations Of Parameters | ||
Original Image |
||
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
Arguments: |
What the script does is as follows:
This is equivalent to the following IM commands for
|