← All projects

Python library · CLI · MIT License

Strokemap

Turn any image into a print-ready paint-by-numbers PDF, with a numbered template, clean outlines, a colorized preview, and a palette sheet.

Numbered paint-by-numbers template with outlined regions
Numbered template
Colorized preview of the finished painting
Colorized preview

What you get

One command produces a four-page PDF:

  • Numbered template to paint on
  • Clean outlines without numbers
  • Colorized preview of the finished result
  • Color palette sheet that maps each number to a color

How it works

  • Superpixel segmentation (SLIC) splits the image into coherent regions.
  • Color quantization reduces the image to a small, paintable palette.
  • Detail reduction and region merging remove areas too small to paint.
  • Outline extraction draws crisp region borders.
  • Optimal label placement puts each number where it fits inside its region.

Usage

Use the CLI with an input image and output PDF, and tune the result with --colors and --difficulty. From Python, use PaintByNumbersGenerator or generate_pdf.

At a glance

LanguagePython 3.10+
Built withNumPy, Pillow, OpenCV, scikit-learn, scikit-image, ReportLab
InterfacesCommand line and Python API
LicenseMIT