User:Thijshijsijsjss/Pen Plotting Panache/Plotillism Experiments: Difference between revisions
m (Add link aliases) |
(Add outline writeup on weighted voronoi stippling) |
||
Line 34: | Line 34: | ||
====Streategy==== | ====Streategy==== | ||
# Randomly place N seed points on your canvas | |||
# Create the [https://en.wikipedia.org/wiki/Delaunay_triangulation Delaunay diagram] for these seed points: the unique triangulation such that the no triangles circumcircle contains any points) | |||
# Create the [https://en.wikipedia.org/wiki/Voronoi_diagram Voronoi diagram] for these seed points: polygons that represent the areas that contain all coordinates that share the seed point they're closest to. This is the [https://en.wikipedia.org/wiki/Dual_graph dual graph] of the Delaunay diagram (i.e. the vertices in the Voronoi diagram are the centers of the Delaunay circumcircles). | |||
# Apply [https://en.wikipedia.org/wiki/Lloyd%27s_algorithm Lloyd's Algorithm (Voronoi iteration)] by iteratively moving the seed points to the centers of the Voronoi polygons. This can be approximated by the average of the polygon vertices, or better yet be calculated ([https://paulbourke.net/geometry/polygonmesh/ see Paul Burke's reference]). | |||
# Use these relaxed points for 'pointillism' | |||
Note: for our purposes, we don't simply want to relax all points. This would ultimately lead to a uniform distribution. Instead, we want to base the relaxation on the brightness values of the image we feed in. | |||
====Resources==== | ====Resources==== | ||
* [https://www.cs.ubc.ca/labs/imager/tr/2002/secord2002b/secord.2002b.pdf Paper introducing Weighted Voronoi Stippling] | * [https://www.cs.ubc.ca/labs/imager/tr/2002/secord2002b/secord.2002b.pdf Paper introducing Weighted Voronoi Stippling] | ||
* [https://thecodingtrain.com/challenges/181-image-stippling Coding Train tutorial and reference code (p5.js using D3)] | * [https://thecodingtrain.com/challenges/181-image-stippling Coding Train tutorial and reference code (p5.js using D3)] |
Revision as of 11:26, 30 April 2024
For a while now, Victor and I have been talking about pen plotted pointillism. Last week, Manetta shared an open call on Zulip that displays some nice pointillism examples: https://ligne.page/en/les-ressources/long-distance-drawing. Seeing this, I was prompted again to develop this idea further.
This wikipage will be somewhat of an experiment itself. Instead of the 'postmortem' style where I document a final working script (e.g. Plothatching), I will instead try to document the steps of experimentation and exploration while forming this project.
Initial idea: adapt crosshatching technique
We have made many plots using a crosshatching technique (see for example here). This techniques works as follows:
- decide on a number of layers L
- divide the image into L different areas based on the brightness levels of the pixels
- create L layers with lines, each with its own rotation, and mask each one with one of the areas above
Instead of lines, we could use points as well. In its most basic format, this is a simplification of the crosshatching technique: instead of drawing lines, we could draw points. It is a simplification, because we would not necessarily need to rotate these layers. In fact: everything could be one layer.
Moreover, using points we can easily generate the HPGL code through the script, so that we don't have to resort to other programs for conversion steps.
Different pointillism strategies
Converting the crosshatching script to use points instead of lines would be relatively easy. However, the longer I thought about this project, the more I felt like this should really be stochastic pointillism:
Pixel loop
tl;dr: loop over pixels and compare brightness value to a random nr to determine if there should be a point there Too gridlike
Dart Throwing
tl;dr throw D darts and compare brightness value to a random br to determine if there should be a point there still to gridlike
ChatGPT inquiries
Screentone
tl;dr deterministic; similar to crosshatching; offset layers of points
Weighted Voronoi Stippling
tl;dr stippling technique based on involved mathematical operations, that results in a nicely weighted distribution of points.
Streategy
- Randomly place N seed points on your canvas
- Create the Delaunay diagram for these seed points: the unique triangulation such that the no triangles circumcircle contains any points)
- Create the Voronoi diagram for these seed points: polygons that represent the areas that contain all coordinates that share the seed point they're closest to. This is the dual graph of the Delaunay diagram (i.e. the vertices in the Voronoi diagram are the centers of the Delaunay circumcircles).
- Apply Lloyd's Algorithm (Voronoi iteration) by iteratively moving the seed points to the centers of the Voronoi polygons. This can be approximated by the average of the polygon vertices, or better yet be calculated (see Paul Burke's reference).
- Use these relaxed points for 'pointillism'
Note: for our purposes, we don't simply want to relax all points. This would ultimately lead to a uniform distribution. Instead, we want to base the relaxation on the brightness values of the image we feed in.