Multimatic: An image compositing tool
This page is the manual for Multimatic. The main page is here. The examples page is here. The downloads page is here.
What is Multimatic?
Multimatic is a software tool for compositing digital images. It is designed to produce the same effects as multi-lens cameras, such as the Lomographic Super Sampler, Action Sampler, Pop9 or Oktomat. It works with digital image sources, and as a result is much more flexible in what it can do.
Multimatic is a post-processing tool: it does not run on your camera, and does not require any specific camera or device to be used. You can use it with images from any source.
Multimatic does not "fake a Lomo". You can use it to get similar effects as some of their multi-lens cameras, but the final result is highly dependant upon what images you use. Lomos generally have very wide lenses and very eccentric contrast and colour, which is a major component of the distinctive style. Multimatic does not make your photos look like Lomo photos.
Multimatic was written by Casey in March 2005. You can contact Casey by emailing casey at caseyporn dot com.
License and Disclaimer
This script is freely distributable. Please credit me as the original author. All comments and feedback welcome. All care and no responsibility taken: I am NOT responsible for any loss or damage incurred from using this script.
Everything to do with Lomo cameras is probably copyright and trademarked by them. I'm not trying to infringe on anything. This is just an experiment, partly to try and dissect the technology behind the philosophy, so to speak.
If you would like to use a script like this for commercial purposes, I would appreciate at least knowing about it.
Requirements
The script runs on Python and uses the Python Imaging Library. It has been tested on Python 2.3 for Mac OS X, and Python 2.4 for Windows XP. No platform-specific modules are used; it should be cross-platform, but as always your mileage may vary.
Using Multimatic
Multimatic is driven by a set of options. You can provide these options in one or more options files, or on the command line, or both. Command line usage is:
python multimatic.py options_file1 optionsfile2 att=val att=val att=val...
Options and files are read left-to-right; later options overwrite earlier ones. This can be used to your advantage by setting up some basic options in files, and overwriting just one or two options on the command line.
Options files are written with one option per line, with name and value separated by a colon (:). Comment lines begin with a hash (#). For example:
# comment line
dir: images/
rotate: each 20
On the command line, options can be specified as name=value pairs. Values with spaces in them can be quoted, such as:
python multimatic.py dir=images/ rotate="each 20"
There is a number of options, explained below.
Configuration Options
Options are arranged below in the order that they are applied in the program. All options are case sensitive.
- Image sources.
- files: load all the listed files (one or more, separated by commas)
- dir: load all the images in the directory
Note: It is highly reccommended that all source images are the same size.
- Choosing images.
- choose: [ number | "random" number ] choose the number of source images to use.
Notes: Images are re-used or discarded as necessary.
Images are chosen in order, unless "random" is used, in which case they are shuffled.
By default, all images from the image source are used once.
- Processing images
- resize: amount [, amount]
If a single value is given, it is used for both height and width.
If two values are given, they are used for width and height respectively.
Values may be absolute values (pixels) or percentages (percentage of *each* image's size).
Examples:
resize: 50% # shrink by half
resize: 200 # 200 pixels
resize: 400, 200 # to (400, 200) pixels (width, height)
resize: 200, 40%
- rotate: ( each amount | random amount), (each amount | random amount), ...
"each" applies rotation in sequence: each successive image is rotated by (amount) more than the last. Amount is given in degrees counter-clockwise.
"random" applies a random rotation of (+/- amount) to each image, individually.
Rotation will leave black areas in the image, which can be dealt with using the "crop" option.
Examples:
rotate: each 20, random 5 # counter-clockwise, 20-degrees each image, with 5-degree wiggle
rotate: random 180 # spin it
rotate: each -40 # 40-degrees clockwise each image
- Taking slices.
- slice: ( horizontal | vertical )
Take a horizontal (wide) or vertical (tall) slice from each image
By default, the whole image is used.
- slice-size: amount
The width of the slice. Can be absolute or relative, eg. slice-size: 20% or slice-size: 100
- slice-location: ( position | random from position to position | move from position to position | centre ) [, random amount]
There are three ways to specify where the slice comes from in each image.
- an absolute or relative position, the same for every slice (eg. slice-location: 200 or slice-location: 40%)
- a random choice from within an area (eg. slice-location: random from 50% to 100%)
- a sequence across an area (eg. slice-location: move from 20% to 60%)
Additionally, this base position can be adjusted by a random amount by using eg. "random 10". slice-location options are separated by a comma.
Location defaults to the absolute center of the image.
Examples:
slice-location: 200 # always start at pixel number 200 (across/down)
slice-location: 40% # start at forty percent (across/down) the image
slice-location: random from 40% to 80% # choose a slice somewhere in this area
slice-location: random from 100 to 500 # as above but absolute, not relative
slice-location: move from 0% to 100% # move across the whole image
slice-location: move from 80% to 20%, random 10 # move backwards across/up the image, plus add a random variation of +/- ten pixels
- Compositing the image
- layout: ( horizontal | vertical | grid | (PRESETS) )
"horizontal" places the images side by side, left to right.
"vertical" stacks the images, top to bottom.
"grid" places them in a grid (use grid-width and grid-height to control it).
There are preset grid-layouts that correspond to real comeras (case sensitive):
- ActionSampler (2x2)
- Oktomat (2x2)
- Pop9 (3x3)
- SuperSampler (4x1)
- VSuperSampler (1x4) (a vertical version of the SuperSampler).
Other grid layouts can be specified with the following options:
- grid-width: number
- grid-height: number
Together, they specify the width and height of the composite image, in terms of number of images. The actual size is controlled by the input images.
- crop: yes.
After rotation, slices may include empty black parts of a picture. If the "crop" option is set, the slice is enlarged until the black is no longer visible. This is not an optimal way of finding a decent crop, but works in practise. Since the image will be zoomed, the result will be of lower true resolution.
- vignette: width
Vignetting places a darker border around each slice. The number controls the width of the border in pixels. It's a very simplistic vignetting at the moment, and may change.
- Developing a set of images
- shots: number
The number of images to produce in the development run. Since there are many steps in which randomness can be introduced, the same settings can produce many different final images. Multiple shots can be produced in one run - all steps are repeated. If this option is omitted, it defaults to one image.
- output: filename
Specifies the base filename for output images. Files are never overwritten on output: a number is added to the end of the filename, and incremented until a new filename is found each time. If a filename "flowers" is specified, images such as "flowers0.jpg", "flowers1.jpg" etc will be produced. If this is omitted, it defaults to "multimatic_output"
- output-type: extension [ quality ]
Specify the type of image to be produced. Examples include "jpg" or "gif" and are limited to the extensions that PIL understands. The optional "quality" parameter, for JPEG only, specifies the image quality.
Examples:
shots: 2
output: funky
output-type: jpg, 80 # high quality JPG
Hints and Tips
Being able to use multiple configuration files is nice. You might like to set up files that correspond to image-sets (that specify the files to use, resizing, and output file names), and others that correspond to particular transformations that you like. That way you can easily do, for example:
python multimatic.py StreetSigns Swirly crop=yes
python multimatic.py Inside Swirly vignette=2
python multimatic.py Inside SuperSampler slice-location=60%
So once you've set up the image sets (StreetSigns and Inside, in this example), and the transformation sets (Swirly and SuperSampler, here), you can combine them (plus whatever specific options you'd like) any way you choose.
Real multi-lens cameras are limited to either taking all the photos at once, or in quick succession. With Multimatic, you can start with even just one photo, and re-use it to make interesting composites. Explore and experiment with effects you like.