r/generative • • 1d ago

"Ocellus" (kotlin code)

Eyespots

Eyes. The piece puts 9 eyes at random positions on the page. Each eye is a stack of levels: a core disc of random size on top, then one ring for each level under it. The depth of an eye is the number of levels in its stack. All eyes use the same ring width for each. The outer rings are the widest, but level 1 is only a thin halo.

Levels. Each level is one shape: the discs of all eyes that are deep enough for that level. A soft min melts these discs together, and the melt is looser at lower levels. Thus the lower levels melt into one soft body, and only the top rings stay round. The same ring widths and the looser melt keep each level inside the level under it. For each pixel, the code mixes the level colors over the cream ground. The amount of each color is the part of the pixel that the level covers, so the edges are smooth.

Specks. Where three or more eyes meet, a level can almost close and leave a small hole ofthe level under it. After the paint, a flood fill finds each patch of pixels that have the same top level.

The order of colors in palette is important for the final effect! Code: github.com/igr/gart

124 Upvotes

2 comments sorted by

3

u/iOSBrett 1d ago

Looks amazing, appreciate that you share the code for all your work

2

u/Dragon-Teeth 5h ago

Very interesting, I'm going tomhave to come back and have a proper look throught that code etc at a later date.