Algorithm:
- Generate Base (Average color of the image)
- generate n random shapes
- Create n new candidate states of the canvas
- Rank by fitness these candidates and choose the first (eucledian distance)
- Mutate the new state (only accept mutation if new image is better)
- Repeat until desired complexity is achieved
This algorithm is ran 3 times, each with a sligtht variation.
- Stage 1: use a faster fitness function that levreages the Monte Carlo technique
- Stage 2: use the standard fitnes function
- Stage 3: add semi-transparent shapes for added smoothness
- decide on the language/platform: js. react native + expo
- implement sketch of algorithm
- make a demo UI
Functions:
- Fitness function, maybe delta-e or root mean square deviation
- Average color
Structures:
- Shapes (representation of triangles, rectangles, ellipses, etc)
- Canvas with state. (The actual canvas to draw. To be able to resume from a state, or undo actions on the canvas.)
Functions:
- Generate random shape
- Append shape to canvas
- Export canvas to Image (SVG?)
This hypothetical variation borrows certain things from the genetic algorithms such as a fitness function and mutations. Hill Climbing was chosen due to it's simplicity and efficiency1
Functions:
- Mutation (Vertex change of a triangle / radius change of an ellipse)
The React Native app was replaced by a webpage.
The website receives svg shapes via a websocked and renders them in real time.