This program lets you transform an image in to an image with symmetrical pattern. Just supply a base image and a formula to get started.
I assume you're comfortable with Go, YAML and a command line. You'll install this in go, write the formulas in YAML, and run make run on a command line to generate pretty patterns.
This program is written in Go, so download that first.
Once that is done, you can check out this repository, open a terminal and navigate to this codebase.
Run go install and it will download the other required libraries:
- yaml
- ginkgo
- gomega
- check
You will need a source image. A rainbow stripe pattern is included in this repository and used throughout these docs.
Open your command line and type:
make run
This will look for the file data/formula.yml to find the required settings:
- The name of the source image
- The name and size of the output image
- The formula that transforms the source into the output
- Numerical ranges used with the formula
All options (except the formula) are described here.
If you learn better by example, try renaming data/formula.yml.example to data/formula.yml.
When you run make run, it will generate the orange and red pattern you see below.
Rosette patterns surround the center of the image, expanding outward. They can be rotated around the center without visually changing the look.
Click here to learn more about rosette-based patterns and design your own.
Frieze patterns expand horizontally forever but usually have a finite height.
Reflective symmetry across the x-axis
Glide symmetry: move the pattern horizontally a bit and then flip it over the x-axis
Click here to learn more about frieze-based patterns and how to build your own.
Lattice patterns transform using a 4 sided shape called a lattice. They expand horizontally and vertically forever. Sometimes these are called wallpaper patterns.
Rectangular lattice. The lattice connects the 4 centers of the green and orange ovals. Then the lattice is repeated to create the image.
Hexagonal lattice Creates 3 way rotational symmetry. This lattice can be stacked 7 times to create a hexagonal pattern. Count the solid blue dots to see the corners of the lattices.
Rhombic lattice The lattice is based on a rhombus, where all sides are the same length but not at a square. All red blobs should look the same, but due to the low resolution rounding errors appear.
Click here to learn more about lattice-based patterns. (Still a Work In Progress!)
If you plan to mess around with the code itself, here are 2 more make commands that will come in handy:
make testRuns the unit tests.make lintRuns the linter.
Creating Symmetry by Frank Farris merges math and art to create beautiful patterns and is worth the read. Prepare for Group Theory and Complex Numbers!









