Demote Earth | The Kookometer | Line Fan Moiré Patterns | The Pyrotechnic Stoichiometry Calculator | Readily Available Chemicals | The Spaceman Emulator | E-mail | Home
When a set of lines are closely drawn on a raster, with a spacing which is similar (but not identical) to the pixel size, a Moiré pattern will occur. This is a form of aliasing which results from the raster lacking the resolution to display the lines individually. This causes some lines to merge, and so creates a false alias of the original pattern. A Moiré pattern can also be thought of as an interference effect occurring between the original pattern and the raster.
When diagonal lines are drawn on a raster, they cannot be rendered perfectly, as the ideal line shape will fractionally cover individual pixels. If many colours are available, this problem can be mitigated by using anti-aliasing: In other words, each pixel is assigned a colour depending on the fraction covered by the ideal line shape. (As its name suggests, this technique also helps to reduce aliasing.) However, if only two colours are used (i.e. the line colour and the background colour), the line must be drawn in the form of horizontal (or vertical) segments which jump to the next row (or column) of the raster at various intervals.
A Line Fan Moiré Pattern occurs when these two effects are combined. A fan of single-pixel-width lines, all radiating from a single point are drawn closely together, thus allowing them to interfere. They are rendered without anti-aliasing, and so the line spacing increases at discrete intervals. The resulting Moiré pattern occurs in the form of beautiful swirls of colour.
Line Fan Moiré Patterns are an example of a Graphical Hack. In otherwords, they take an unintentional (and in this case undesirable) property of a system, and exploit it to produce a novel effect.
The following script allows you to create your own Line Fan Moiré Pattern. The preexisting settings give an example of what is possible. Bear in mind that that the effect requires a well chosen line density: If the lines are too far apart, they will just be rendered normally, without any aliasing effects. If they are too close, they will fill all available pixels and result in a solid block of colour.
pixels to the left right of the left edge centre right edge of the image.
pixels above below the bottom edge middle top edge of the image.
Draw lines along the top of the image.
Draw lines along the bottom of the image.
Draw lines along the left of the image.
Draw lines along the right of the image.
Width: pixels. Height: pixels.
© Chris Benton 2002–2008 (Except as otherwise indicated).