|
|
|
|
|
|
"white lotus"
| |
 |
 |
 |
 |
 |
 |
|
|
|
lotus blossoms
is an experiment born
from a simple algorithm for
filling shape outlines on a canvas.
The resulting feel of the algorithm
on a collection of outlines
is often that of anime
motion sequences.
Here is the basic algorithm,
of which many interesting
variations are possible:
* decide on colors for the foreground (FG)
and for the background (BG)
* draw shape outlines in FG on BG
* scan canvas pixels left-to-right, top-to-bottom
* if the current pixel is not FG-colored
then it is tested for fillability
* a pixel is fillable if the number of FG-colored
pixels to the left of the current pixel
in the current row is odd
* if a pixel is to be filled, the color
is chosen in the following order:
1) the color of the pixel directly
to the left (unless it is FG-colored)
2) the color of the pixel directly
above (unless it is FG- or BG-colored)
3) a new color using a defined palette
and color-selection algorithm
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
The two images above show
the algorithm as applied to a
collection of overlapping triangles,
and the image below
is taken mid-fill.
| |
|
|
|
|
|
|
|
|
I never fully completed this code
and as such it is littered with
bits-and-pieces of ideas.
This demo shows the algorithm
as applied to circles, although
an inspection of the code will
reveal the lotus rendering bit
as well as other goodies.
| |

|
|
|
gallery «
|
|
|
|
|
|
|
"midnight suns"
| |
|
|
|
|
|
|
|
|
|
|
"crystal city"
| |
|
|
|
|
|
|
|
|
|
|
"circles with anime fill"
| |
|
|
|
|
|
|
|
|
|
|
"circles with blue fill"
| |
|
|
|
|
|
|
|
|
|
|
"circles with red fill"
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|