STENCIL/BENCHOpen bench
Home › Methodology

Methodology: photo to printable stencil

Last verified 2026-11-02 · Sources: the sources table on this page · Report an error

What happens between the upload and the PDF, which numbers are fixed and which are yours to set, what the tool will not do, and where every non-obvious claim comes from.

The pipeline, step by step

Nine steps, in the order they run. Steps 2 and 8 are the only ones that leave your browser; the rest are plain canvas code you can read in /js/bench.js and /js/sheet.js.

  1. Load the photo (browser). js/bench.js reads the file into a data URL and shows it. File input accepts PNG and JPG up to 10 MB; the four sample buttons load /img/gallery/src-*.jpg instead, and the matching out-*.jpg is used as a ready example.
  2. Remove the background and trace the lines (server). POST /api/stencil with {image, detail, thickness, token}. The detail presets send 85 (Bold), 92 (Balanced) or 96 (Fine); the server returns a line image, which becomes the source for every export below.
  3. Build the ink mask (browser). mask() downsamples to 900 px for the preview or 2400 px for an export, converts each pixel to luminance with 0.299 R + 0.587 G + 0.114 B, and marks it as ink when that value is below 140. Everything else is paper.
  4. Change the line weight (browser). morph() dilates the mask for a positive weight and erodes it for a negative one — a 3×3 cross, horizontal pass then vertical, repeated |weight| times. The slider's whole range is −2 to +3 px, so weight is a whole-pixel decision, not a blur.
  5. Convert width to pixels (browser). pxFor(cm) = Math.round(cm / 2.54 × 300). Width is typed in cm or inches with placement presets (finger 2, wrist 5, forearm 10, back 25); the readout shows the exact pixel size at 300 DPI.
  6. Scale, mirror, re-threshold (browser). paint() draws the mask at the export pixel size, flips it horizontally when “Mirror for transfer” is ticked (on by default), then re-thresholds every pixel at 150 so the file contains only 0 and 255. Rescaling a stencil normally produces grey edges; this is the step that removes them.
  7. Write the DPI tag (browser). The PNG is re-encoded with a pHYs chunk of 11,811 pixels per metre, which is 300 DPI. Without it a print dialog assumes 72 DPI and prints the stencil roughly four times too large.
  8. Build the PDF (server). POST /api/stencil.pdf with {stencil, page, mirror, size_mm, marks: true}. The page is A4 or Letter, the design is centred at true millimetre size, and corner crop marks plus a print-at-100% note are added.
  9. Gang several designs (browser). js/sheet.js shelf-packs designs tallest-first inside the page area left after 0.5 in (12.7 mm) margins on each side, with 4 mm gaps: A4 210 × 297 mm, Letter 215.9 × 279.4 mm. Up to 12 designs queue in localStorage between the bench and the sheet builder.

No step is manual and no step is editorial: the same code runs for every photo, so two people who upload the same file with the same detail, weight, width and paper get the same bytes.

What the tool refuses to do

Sources

Every row is a page this site already cites, re-checked on 2026-11-02. Two are product sites used only for a feature comparison on /vs-stencil-ai-and-procreate, one is an encyclopaedia entry used for a card dimension, and the rest are manufacturer, vendor or artist-education pages.

SourceURLUsed forLast checked
AI Tattoo Lab — stencil outline guideaitattoolab.com/stencils/outlineThe 0.3–0.5 mm printable stencil line width, and the outer limit above which a line starts reading as a shape2026-11-02
TattooBase — needle groupings cheat sheettattoobase.co.uk/blog/tattoo-needle-groupings-cheat-sheetNeedle codes #08 / #10 / #12, and RL / RS / M1 / RM configurations2026-11-02
TattooBase — needle sizes and configurationstattoobase.co.uk/guides/tattoo-needle-sizesHow a cartridge label is read: pin diameter, pin count, configuration2026-11-02
Tattooing 101 — tattoo needlestattooing101.com/learn/tattoo-equipment/needlesTaper naming (ST / LT / DLT / ELT / ESLT) and why naming is not standardised2026-11-02
Tattoo Style Guide — fine line needles, longevity, placementtattoostyleguide.com/fine-line-tattoo-needles-longevityHow long thin lines stay readable by placement, and the 1–3 year fade on fingers and hands2026-11-02
Nova Cartridge — round liner guidenovacartridge.com/pages/round-liner-rl-tattoo-needles-guideWhich RL grouping is used for which line weight2026-11-02
Wikipedia — ISO/IEC 7810en.wikipedia.org/wiki/ISO/IEC_7810The ID-1 card dimensions (85.60 × 53.98 mm) used for the scale check on /print-calibration2026-11-02
Canon support — printing at 100%id.canon/id/support/8200187200“Fit to page” versus 100% scale in a print dialog, cited on /print-calibration2026-11-02
Procreateprocreate.com/procreateFeature comparison on /vs-stencil-ai-and-procreate: what the app does and does not mirror or export2026-11-02
Stencil AIstencilai.appFeature comparison on /vs-stencil-ai-and-procreate, present/absent only2026-11-02

Pages that cite no external publication — every guide except /line-weight-guide, /print-calibration and /vs-stencil-ai-and-procreate — name the Stencil Bench export specification as their “Sources” line. That is deliberate: 300 DPI, mirroring, A4/Letter, the 3–30 cm width range and the −2/+3 px line weight are defined by js/bench.js and the export table on the homepage, not by a publisher, so a citation to anyone else would be theatre.

How the site is checked

scripts/ci.sh runs on the local tree before any change goes out. It asserts that every URL in sitemap.xml resolves to a real file, that each HTML page has exactly one H1, a canonical link and a title, that all JSON-LD parses, that no internal link is broken, and that favicon.ico is a real ICO. scripts/eat.mjs is the wrapper that writes the “Last verified” bar, the byline and the six-link footer; node scripts/eat.mjs --check fails if any page is missing them.

Known limitations

Last updated: 2026-11-02