Fred's ImageMagick Scripts



    Licensing:

    Copyright © Fred Weinhaus

    My scripts are available free of charge for non-commercial 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

TILEIMAGE


Tiles an image to a given size with various tile arrangements.

Download Script

last modified: August 10, 2015



USAGE: tileimage [-a arrangement] [-o orientation ] [-r repeats] [-w width ] [-h height] [-b bgcolor] infile outfile
USAGE: tileimage [-help]

-a ... arrangement ... tiling arrangement; choices are: repeat, halfdrop,
...................... brick, verticalmirror, horizontalmirror or rotate;
...................... default=repeat
-o ... orientation ... orientation mode for image repeats; choices are: 0,
...................... 90, 180, 270, flip, flop, transpose, transverse;
...................... default=0
-r ... repeats ....... number of horizontal repeats; integer>0; default=4
-w ... width ......... width of canvas in pixels; integer>0; default=512
-h ... height ........ height of canvas in pixels; integer>0; default=512
-b ... bgcolor ....... background color for canvas, if image is transparent;
...................... any valid IM color; default="white"

PURPOSE: To tile an image to a given size with various tile arrangements.

DESCRIPTION: TILEIMAGE tiles an image to a given size. Several arrangements are possible as well as several orientations. The user can also specify the number of repeats across the width of the image. This script is typically used to tile objects on a constant color background.

ARGUMENTS:

-a arrangement ... tiling ARRANGEMENT. The choices are: repeat (r), halfdrop (h), brick (b), verticalmirror (vm), horizontalmirror (hm), or . rotate (ro). The default=repeat.

-o orientation ... ORIENTATION mode for the image repeats. The choices are: 0 (degree rotation), 90 (degree rotation), 180 (degree rotation), 270 (degree rotation), flip, flop, transpose, transverse. The default=0.

-r repeats ... REPEATS is the number of horizontal repeats across the image. Values are integers>0. The default=4.

-w width ... WIDTH of output image in pixels. Values are integers>0. The default=512.

-h height ... HEIGHT of output image in pixels. Values are integers>0. The default=512.

-b bgcolor ... BGCOLOR is the desired background color for the output image, if the input image is transparent. Any valid IM color. The default="white".

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.


EXAMPLES

Original
(source)

Arguments:
-a repeat -o 0 -b white

 

Arguments:
-a brick -o 0 -b white

 

Arguments:
-a brick -o flip -b white

 

Arguments:
-a brick -o flop -b white

 

Arguments:
-a halfdrop -o 0 -b white

 

Arguments:
-a halfdrop -o 90 -b white

 

Arguments:
-a halfdrop -o 180 -b white

 

Arguments:
-a horizontalmirror -o 0 -b white

 

Arguments:
-a verticalmirror -o 0 -b white

 

Arguments:
-a rotate -o 0 -b white



What the script does is as follows:

  • Resizes the image according to the number of repeats
    and the desired dimensions
  • Clones the resized image and reorients it
  • Appends the two images
  • Tiles the combined image to the desired size
  • If the image had transparency, flattens to the desired color

See the script for details