ddd
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. |
Positions (aligns) one image relative to another image. |
last modified: February 25, 2022
USAGE: position [-m method] [-d direction] [-o offset] [-l leftpt]
[-r rightpt] [-b bcolor] [-f format] [-T trim] infile1 infile2 outfile
-m ... method ...... positioning method; choices are: offset or cpoints; PURPOSE: To position one image relative to another image. DESCRIPTION: POSITION aligns or offsets one image relative to a another image. The second image is positioned relative to the first image either horizontally or vertically. Positioning can be done using X and Y offsets or by specifying one controll point for each image. ARGUMENTS: -m method ... positioning METHOD. The choices are: offset (o) or cpoints (c). The default=offset. -d direction ... positioning DIRECTION. The choices are: horizontal (h) or vertical (v). The default=horizontal. -o offset ... OFFSET +X+Y values for left/top edge of second image relative to right/bottom edge of first image. This is used when method=offset. Position X and Y offsets may be either positive or negative. The default=+0+0 -l leftpt ... LEFT (first) image control x,y POINT. Values are integers>0. The default=0,0 -r rightpt ... RIGHT (second) image control x,y POINT. Values are integers>0. The default=0,0 -b bcolor ... BGCOLOR is the background color to fill empty spaces. Any Imagemagick color is allowed. The default=none (transparent) -f format ... output color FORMAT; The choices are: RG, GB, BR or RGB. RGB is the normal color image. RG, for example, is first image in Red and second image in Green and any overlay will show in yellow (mix of Red and Green). The default=RGB. -T trim ... TRIM output to remove any background fill areas. Choices are: yes (y) or no (n). The default=no. Background color must be unique in the image for the trim to work properly. LIMITATIONS: TRIM option only works for Imagemagick 7.0.9-0 or higher. 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 - method=offset and format=RGB |
|
Image 1 |
Image 2 |
![]() |
![]() |
Arguments: |
|
![]() |
|
Arguments: |
|
![]() |
|
Arguments: |
|
![]() |
Example 2 - method=cpoints |
|
Image 1 |
Image 2 |
![]() |
![]() |
Arguments: |
|
![]() |
|
Arguments: |
|
![]() |
|
Arguments: |
|
![]() |
|
Arguments: |
|
![]() |
Example 3 - method=cpoints and trim |
|
Image 1 |
Image 2 |
![]() |
![]() |
Arguments: |
|
![]() |
|
Arguments: |
|
![]() |
What the script does is as follows:
|