You are here

Image Tiler -- tile single or multiple images into n*m grid with options

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
Rate this item!

tileimages.scm -- Put n*m same sized images onto one image in n columns & m rows with optional padding, grid lines, bounding box, rounded corners and feathered edge.

If there aren't n*m images passed, the last image is repeated until n*m positions are filled.
This is useful for just passing one image, which will be tiled for all n*m positions.
If there are more images passed, only the first n*m are used.

I use this script for two main purposes: one is for putting six photos onto one with padding and grid, which I then print and cut into wallet sized photos with white border or doing the same with one image w/o padding to make passport photos. The second is for producing sheets of playing cards with rounded corners for printing and cutting for print-n-play game production, examples of which can be seen here: example output and the physical results (indeed I wrote this script to produce those cards).

Options include:
padding size
adding grid lines and/or bounding box (e.g. as cutting guides)
rounding image corners (e.g. for making playing cards whose physical corners will also be rounded)
feathering the transition between image and padding

usage & syntax

This script is designed to be used in non-interactive batch mode. The syntax for calling as a gimp batch command is:

gimp -f -i -b '(batch-tileimages "'$fileout'" '$n' '$m' '$padding' '$gimpfilltype' '$roundedcornerradius' '$featherselectionradius' '$drawbox' '$drawgrid' '$gridlinewidth' '$dpi' '$jpgqual' "'$fileglobpattern'")' -b '(gimp-quit 0)'

Where '$xxxxx' must be replaced with an appropriate parameter, e.g.

~$ gimp -i -b '(batch-tileimages "/tmp/new.jpg" 3 4 48 1 10 10 0 1 1 600 0.98 "*.jpg")' -b '(gimp-quit 0)'

note that '*.jpg' is a file-glob of possibly many file names.

I simplify this by using a bash wrapper script tileimages (attached in zip format since files w/o extension aren't allowed). The command syntax is:

~$ tileimages fileout n m padding[px] gimp-fill-type[0(black)|1(white)] roundedcornerradius[px] featherselectionradius[px] drawbox[1|0] drawgrid[1|0] gridlinewidth[px] dpi jpeg-quality[(0..1)] image-names-glob-in-quot-marks-or-one-filename

e.g.

~$ tileimages /tmp/Player_cards_hi_res 3 4 48 0 0 0 0 0 4 600 0.98 "*.jpg"

Pass 0 as a parameter for any feature you don't want, e.g. featherradius or roundedcorners.

GIMP Version: 
Scripting Engine: 
Subscribe to Comments for "Image Tiler -- tile single or multiple images into n*m grid with options"