Drawing With Machines: Colors

2025

Tools: Python, P5.js, vpype, AxiDraw

Creative coding, Generative Art, Pen Plotting

Overview

A drawing system designed to translate images into layered, hatched SVGs for pen plotting with colored markers. The project combines color segmentation with physical ink layering to produce plotted paintings that negotiate between mechanical precision and painterly abstraction.

Pen plotters are designed for precision. This project explores how to make them behave otherwise. I wanted to explore working with less controlled materials that bleed, layer, and has more texture. Over the course of this project I experimented with watercolor, acrylic, and alcohol markers on yupo, printmaking, watercolor, and Xuan paper. These led to the development of a custom pipeline that converts photographs into multi-color hatched drawings that read more like paintings than prints.


Key challenge - Colors!


A photograph contains way more values than a set of markers. The algorithm identifies a small palette of foundation colors that span the perceptual range of the original input. It then assigns regions of the image to those inks and generates hatching at different angles for each layer, so overlapping strokes optically mix the way inks do on paper.

The layering logic is similar to painting, light colors first as a base layer, and darker tones build on top. Colors in the same hue family share territory and contrasting colors stay strictly separate.


Paper absorbency, marker pressure, and ink bleed introduce variation that the artist nor the algorithm can fully control.

How it works

input photo → SLIC superpixels → hue clustering → SDF inflation → hatching → SVG → vpype → Axidraw

Process

Iteration 1

P5.js k-means color separation + PEmbroider hatching by bitmaps

Problems:

  • color slots wasted on value variation

  • noisy, less organic color patches

  • limitation/inflexibility for hatching in PEmbroider

  • data moving across two different work stations (P5.js and Processing)

Iteration 2

Moved entire pipeline to python

  • SLIC superpixels for perceptually coherent regions

  • SDF region inflation for smoothing

  • Hue based clustering

→ Organic edges, more effective color separation

Problems:

  • Every ink is independent, only covers their own regions, no overlap

  • color selection by clustering hues separately from grays, resulting in over-represented mid tones

Iteration 3

Minor adjustments:

  • Color layering: inks in the same color family share territory, colors build up from light to dark

  • Underpainting

→ Palette now spans a greater perceptual range & more nuanced colors