Note: This content is accessible to all versions of every browser. However, this browser does not seem to support current Web standards, preventing the display of our site's design details.

Synthetic Texture Examples

Click here to view cyclic version of this synthetic texture
161.jpg
Click here to view cyclic version of this synthetic texture
Synthetic 256x256 pixel Texture
Click here to view cyclic version of this synthetic texture
Rmosaic1_c.jpg
Click here to view cyclic version of this synthetic texture
Synthetic 256x256 pixel Texture
Click here to view cyclic version of this synthetic texture
rock_wall.jpg
Click here to view cyclic version of this synthetic texture
Synthetic 256x256 pixel Texture

Source Code

Download Source Code Copyright (C) 2002, by Rupert Paget, all rights reserved.

The source code requires ImageMagick to be preinstalled. To compile the code, run gmake in the parent directory. There are two makefiles, one in parent directory, and in the src directory. If the code does not compile, both makefiles will need to be edited. I have written one for a sun (default) and one for an sgi machine, but I give no guarantees that they will work.

The program is executed with the following command

nonparaMRF_fast_k [-l levels] [-n neighOrder] [-s] [-t treeMax] [-k kNearest] [-c] [-x cols] [-y rows] [-m maskfile] [-h] texturefile

where

levels =
number of gray levels the image will be compacted to. Reducing the number from 255, will probably not improve the synthesis, and will most likely increase the run time.
neighOrder =
number to signify neighbourhood size. See neighbourhoods for schematics of the neighbourhoods used in the texture synthesis algorithm.
s =
if set, the neighbourhood becomes a square neighbourhood.
treeMax =
maximum quadtree height. The algorithm will not allow the quadtree height to be set to a value that will allow either the input image or output image to be reduced to less than a 2x2 pixel image.
kNearest =
number of nearest neighbours used in pixel sampling search algorithm.
c =
if set, the output image is defined to be toroidal (ie cyclic) where each border matches with its opposite border.
cols =
number of columns in the output image. If undefined, number columns in the output image will equal number columns in the input image.
rows =
number of rows in the output image. If undefined, number rows in the output image will equal number rows in the input image.
maskfile =
is a mask image that must be the same size as the input texture image. Only where the mask image is non zero is the input image used.
h =
if set, will mean that just usage and default values will be displayed. This will also occur if no input values are given.
texturefile =
is the input texture image that is to be synthesised.

Default values are : levels = 256, neighOrder = 1, square = false, treeMax = 6, kNearest = 20, cyclic = false

Schematic of the neighbourhoods used in the texture synthesis algorithmSchematic of the neighbourhoods used in the texture synthesis algorithm