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. |
Creates a sequence of cropped subsections permitting optional overlap of the subsections. |
last modified: April 08, 2022
USAGE: overlapcrop [-s size] [-o overlap] [-m mode] [-u]
[-i initnum] [-z zeropad] [-d delay] [-l loop] [-c canvas]
[-M] [-L] [-F frame] [-S spacing] [-R] infile outfile
-s ... size ........ crop subsection dimensions in pixels; one or two PURPOSE: To create a sequence of cropped subsections permitting optional overlap of the subsections. DESCRIPTION: OVERLAPCROP creates a sequence of cropped subsections permitting optional overlap of the subsections. The output images may be numbered either sequentially or in matrix mode (column and row). The images may also be output to a single file with multiple frames, to an animation or to a montage. ARGUMENTS: -s size ... SIZE is the crop subsection WidthxHeight dimensions in pixels. Either one or two non-negative integers may be used with "x" separator if two. If only one is provided (with no separator), then it will be used for both width and height. The default="128x128". -o overlap ... OVERLAP is the amount of overlap of subsections. Overlap may be specified as pixels or percent of subsection size. Values are either one or two non-negative integers with "x" separator. If a percent sign is included, then the overlap will be converted to pixels. Values must be specified (or convert) in the range of zero to the subsection size. The default="50%x50%". -m mode ... MODE of the output. Choices are matrix (numbered) or m, sequential (numbered) or s, frames (mode) or f and animation (mode) or a. The default=matrix. -u (uniform) ... Flag to keep only same size crop sections and discard smaller pieces on the right and bottom. The default is to keep all pieces. -i initnum ... INITNUM is the initial (starting) number for output naming. Values are non-negative integers. The default=1. -z zeropad ... ZEROPAD is the number of digits with zero padding for numbering the output images in sequential mode. Values are non-negative integers. The default=0 (no zero padding). -d delay ... DELAY for animation mode. Values are non-negative integers. The default=50. -l loop ... LOOP is the number of times to loop the animation. Values are non-negative integers. The default=0 (endless looping). -c (canvas) ... Flag to leave the virtual canvas in the meta data for the images. This is useful when making an animation so that the subsections keep their position relative to the original image. The default is to remove the virtual canvas, which then just has each frame of the animation replacing the previous one. -M (montage) ... Flag to create a single montage image for matrix or sequential modes only. The default is no montage. -L (label) ... Flag to add filename labels to each image in the montage. The default is no filename labels. -F frame ... FRAME is the size of the frame-like border in pixels placed around each image in the montage. Values are non-negative integers. The default=5. -S spacing ... SPACING is the amount of space in pixels to put between each images in the montage. Values are non-negative integers. The default=0. -R (remove) ... Flag to remove/delete all individual images generated prior to creating the montage. Th default is to leave all individual images, i.e, no deletion. 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. |
Matrix Mode Montage |
Original Image |
Arguments: |
Sequential Mode Montage -- Uniform Size Subsections |
Original Image |
Arguments: |
Sequential Mode Montage -- All Subsections |
Original Image |
Arguments: |
Animation Mode -- Canvas Off |
Original Image |
Arguments: |
Animation Mode -- Canvas On |
Original Image |
Arguments: |
What the script does is as follows for matrix output:
This is equivalent to the following IM commands:
|