The Wallpaper Pattern Java application creates repeating patterns based on an image and the 17 mathematical plane symmetry groups.
For further assistance you can email rich@singsurf.org.
The package requires a Java JDK version 21 or newer to load. You can download one from either
To install the program first install the jdk and just unpack the zip file into a suitable directory. No other action should be needed.
The program can be run in a number of ways:
wallpaper.bat filename.jpg
- runs with the
selected filenamewallpaper.bat filename.jpg 800 600
- runs with
the selected filename and specified window sizejava -Xmx512m -jar wallpaper.jar image.jpg 800 600
runs the program with more memory allocated, useful for working with very large imagesThe program dispaly a window showing either an image or a tesselation created from part of the image.
A tessellation can be selected by choosing one of the buttons on the left hand side of the screen. These list the 17 wallpaper groups based around lattice structures. See mathematical description for details of these. Additional tessellations for the 7 frieze group and cyclic and dihedral groups can be pull down menus below. The basics pull down menu allows the basic transformations to be applied: translations, rotations, reflections, glide-reflections, uniform scaling, and general linear transformations to be applied.
The shape of the domain can be altered by dragging the red, green and blue points. For some groups only the red and green points are visible. It sometimes happens that the some of the points will be lost outside the screen. If that happens the Reset button can be used to load a default configuration.
Two sets lines are shown. The blue lines are the fundamental domain. The resulting image is constructed by taking the points inside this region and rotating, reflecting and translating them to fill the screen. The yellow lines give the shape of the lattice cells, which are either parallelograms or hexagons. These shapes tessellate the screen and each lattice cell contains exactly the same image, up to translation, as every others cell.
In the above image the fundamental domain is the blue rectangle four copies of it are used the fill the yellow rectangle. The Yellow rectangle is copies to tile the screen.
Further details like the symmetry lines can be shown by using the view menu. Cells and tiles can be outlined in black, the selection points and fundamental domain can be shown and hidden. Reflection lines in green, glide reflection lines in dashed red and rotation points in yellow can be shown. 180° degree rotation points are shown as a yellow circle 60° as yellow triangles and 90° as yellow squares and 120° as yellow hexagons.
Image files can be loaded and saved using the File menu. When saving the image file the the visible image is saved. This can be the original image or the tessellated image. Any overlaying points or lines are also saved. So ensure the correct parts are displayed using the View menu.
If a very large image is required, say 8000 by 6000, this can cause problems with memory as they can take 50MB memory or more. Some improvement can be made by increasing the size of heap space allocated when the program is used using
java -Xmx512m -jar wallpaper.jar image.jpg 800 600
to allocate 512 megabytes heap space. Swap space on your computer may also be a limiting factor.
To allow such large images to be saved the Save expanded menu item on the File menu can be used, this allows the desired output size to be set. This option only supports ppm and bmp format images.
Patterns, comprising a wallpaper group specifation and a set of verties of the fundamental domain, can be saved using the Save pattern option on the File menu.
Pattern files are formated like:
group: p3m1 vertices: - [471,257] - [343,257] - [279,146]
They can be loaded and saved using the Load pattern and Save pattern option on the File menu. Files have the ".pat" extension.
It is possible to save a script with a sequence of animations, as a set of frames where each frame specifies a different pattern, animation type and optionally a different image file. They are save in a file with the ".seq" extension. Each frame in the sequence is run in order and the sequence repeated until the stop button is pressed.
Sequence files are formatted like:
frame: group: P4m vertices: - [451,257] - [323,257] - [323,129] filename: C:\Users\rich\wallpaper\images\bark.jpg zoom: [1,1] anim: left repeat: 10 frame: group: P4 vertices: - [333,970] - [445,970] - [445,858] filename: images\lilly sml.jpg zoom: [3,2] anim: SE repeat: 4
The fields are:
[2, 3] (optional)
for a zoom factor of 2/3.up
, down
etc.The group can be any name of a group, such as P4m
,
P6
, D4
, F7
etc., or
it can be the name a collection of groups such as wall
or frieze
or kaleidoscopes
.
and the group is randomly selected from the collection. Additional collections
can be defined in the org/singsurf/wallpaper/messages.properties
file.
The filename can be any image file, such as a jpg or png file.
It can also be a filename pattern such as images/*.{jpg,png}
that selects a random image from the images
directory
matching the glob pattern.
The anim can be the name of an animation type:
up
, down
, left
, right
,
NE
, NW
, SE
, SW
, continualy move in one direction
using a tiled version of the underlying image.
bounce
, left-right
,up-down
animations constrain the domain
to lie within the boundary of the image, changing direction at the edges of the image.
smooth
constrains the the domain
to lie within the boundary of the image, has a smooth path base on a Lissajous figure.
It can be a little glitchy.
rotate
and rotate-centre
rotate the domain, either around a vertex of
the domain, or the centre of the image, which works better with full screen images.
grow
,grow-centre
grows and shrinks the domain, it can be glitchy at small sizes
none
a do nothing animation.
Or the name of a collection of animation types, the actual animation used is chosen at random:
all
, nice
or shifts
with just the shifting animations which are the best behaved.
Other types of collection can be specified in the properties file.
Sequence files can be loaded and saved using the Load sequence and constructed using the Append sequence options on the File menu. Sequences are constructed in multple steps, by appending multiples frames to the same file. At each step a dialog will be shown to allow the user to set the running time for the animation and The current pattern, filename and animation will be saved.
Some sample sequence files are included in the sequences directory. These are
See Geometry and the Imagination in Minneapolis (Conway, Doyle, Gilman, Thurston) for kalidoscopes/tropic/gyro/glide/rhombic classification
Rectangular tiles which can be used to tile a desktop background can be produced. However, not all patterns have the correct geometry to create such tiles: typically one edges of the domain need to be horizontal or vertical. To assist in creating such tiles select Constrain vertices from the options menu. This will restrict the possible domains only allowing display coordinates of the domain and whether rectangular tiles can be created. A green rectangle is also displayed when rectangular tiles can be created.
If possible the tileable region can be saved using the Save Tile option on the File menu.
The image menu allows some image manipulation to be carried out.
Finer cotrol can be obtained by using the Basic Transform to rotate by a precise amount, and then copying and pasting the image.
The view menu allows fine control over the display, allowing cells (each cell is a copy of the fundamental domain), tiles (tiles can be tesslelated to fill the plane), points of rotation or lines indicating reflections or glide-reflections.
There are other specalised views: isolate domain just shows the fundamental domain; isolate tile shows a single tesselatible tile, and split shows a split-screen view, the original image on the left and the tiled version of the right.
The Windows menu has a single option Full screen which displays the image in full screen mode. All controls are hidden and the image is expandes to fill the screen. Use the F11 toggle full screen mode and and ESC keys to return to the normal screen.
The shape of the domain can be altered using the keyboard. The following keys are used:
message.properties
file.Copyright R Morris 2025