The workshop · printables

Color by Number

Drop in a photo and get a sheet to color. It's split into regions that follow the picture's edges, or laid out as a grid of dots for dot markers. Every color comes from the box of markers you actually own. Color it here, or print it.

Choose a photo to begin.
How it works
  1. Superpixels. The photo is cut into a few thousand small patches with SLIC. Each patch hugs nearby pixels of similar color, so its edges follow the picture's real edges instead of a square grid.
  2. Your markers. Each patch takes the closest marker in the box (measured in CIELAB, which tracks how different colors look to the eye). If that uses more colors than you allowed, the least-used marker is dropped and its patches move to the next closest, until it fits.
  3. Regions. Touching patches with the same marker join into one region. Regions too small or too thin to hold a number are merged into the neighbor they share the longest border with.
  4. Numbers. A distance transform finds the point in each region farthest from its edges, and the number goes there, sized to fit.
  5. Dots. Each dot takes the color most of the region underneath it has, so a dot sheet and a region sheet of the same photo agree.

The optional background removal runs MODNet in your browser with transformers.js. Nothing is uploaded.

● The Workshop · weekly

Everything I build, in one email a week.

Torah tools, daf games and AI experiments, with the story behind each one. Sign up and this week’s issue arrives within the hour.