How the Cross Stitch Pattern Maker Works
This page explains exactly what the tools on this site do, the formulas behind every estimate, and where our data and fonts come from. Everything described here runs inside your browser. Your photo never leaves your device.
From photo to pattern
- Read the image on your device. The browser decodes your file. Large photos are scaled to a working copy of at most 1600 pixels on the long side, then averaged down to one pixel per stitch at the size you choose. Transparent pixels become blank (unstitched) cells.
- Work in a perceptual color space. Colors are converted from sRGB to CIELAB, a color space designed so that equal distances look roughly equally different to the human eye. Averaging and matching in Lab avoids the muddy results you get from averaging raw RGB values.
- Pick the colors (k-means++). We group the stitch colors into the number of colors you asked for using k-means clustering with k-means++ seeding, weighted by how many stitches share each color. Clustering runs in a background worker so the page stays responsive.
- Match to real threads (CIEDE2000). Each cluster center is matched to the closest thread in the selected palette using the CIEDE2000 color difference formula, the current international standard for small color differences. If two clusters land on the same thread, they are merged so every symbol is a different thread. Choosing a grayscale or custom palette simply restricts the list of candidates.
- Optional dithering (Floyd–Steinberg). With dithering on, the rounding error of each stitch is spread to its unstitched neighbors (7/16 right, 3/16 below-left, 5/16 below, 1/16 below-right), which gives smoother gradients at the cost of more scattered stitches.
- Confetti cleanup. A "confetti" stitch is an isolated single stitch with no same-colored neighbor among its eight neighbors. Each cleanup level repeatedly replaces such stitches with the most common neighboring color (ties go to the closest color in Lab). We report how many isolated stitches remain before and after cleanup.
- Symbols and chart. Each thread gets one of 60 original symbols, ordered so neighbors in the legend look different (solid, outline and line shapes alternate). The PDF embeds our own symbol font, so the symbols can be read and searched as text by apps that support embedded symbol fonts. Pages overlap by a few rows so you can line them up, and every page shows grid numbers.
Colors are approximate
Screen colors and printed colors are only approximations of real thread. Each screen, printer and dye lot is different, and thread looks different on fabric than in a picture. The thread values we use are sRGB approximations published by the community. Always check real skeins or a physical color card before buying.
Name and text patterns
Text patterns use 8 pixel fonts drawn by hand for this site. No third-party font files are used. Letters are placed one stitch apart, with an optional border, and the stitch count is exact: what you see in the preview is what you stitch.
Formulas used by the calculators
Finished size
stitches per inch = fabric count ÷ stitches over (for example 28-count evenweave stitched over 2 threads = 14 stitches per inch).finished size (in) = stitches ÷ stitches per inch; centimeters = inches × 2.54.fabric to cut = finished size + 2 × margin (default margin 3 in on each side for framing). See the Cross Stitch Size Calculator.
Will it fit a hoop?
A round hoop of inside diameter D, keeping a margin m on every side, has a usable circle of diameter D − 2m. The largest design that fits across the middle is (D − 2m) × stitches per inch stitches. The largest square design is the square inscribed in that circle, (D − 2m) ÷ √2 inches on each side. Rectangular designs are checked against the circle at their corners. See the Cross Stitch Hoop Size Calculator.
Thread (skeins)
One full cross on a square of width c uses about c × (2√2 + 2) ≈ 4.83 c of each strand: two diagonals on the front and the travel on the back. strand length = stitches × c × 4.83 × strands × (1 + waste), with a default waste of 15%. A standard skein is 8 m of six-strand thread, i.e. 48 m of single strand, so skeins = strand length ÷ 48 m, rounded up for buying. Every input can be changed in the Cross Stitch Floss Calculator.
Time
hours = stitches ÷ stitches per hour (plus any minutes you add for thread changes). days = hours ÷ hours per day, rounded up, counting the start date as day 1 and skipping days off if you stitch only some days a week. See the Cross Stitch Time Calculator.
Graph paper
One square = 1 ÷ count inches = 72 ÷ count PDF points, so 14-count paper has squares of 0.0714 in (1.81 mm). Print at 100% / actual size to keep the scale. See the Cross Stitch Graph Paper.
Data sources and licenses
- Thread colors (454 colors): number, name and approximate sRGB values from the open-source
dmcR package by Sharla Gelfand, released under the MIT License. Thread numbers are used only to identify colors. We are not affiliated with any thread manufacturer. - Symbol font and pixel fonts: drawn for this site. The symbol font is built with the open-source fontTools library (MIT) at build time.
- PDF creation: pdf-lib and @pdf-lib/fontkit (MIT), running in your browser.
- Color science: CIELAB and CIEDE2000 follow the published CIE formulas; k-means++ and Floyd–Steinberg are standard published algorithms implemented from scratch.
What we measure
We count anonymous events such as "pattern generated" or "PDF downloaded" with rough size ranges, so we know which features matter. We never send images, text or file names. Details are in the privacy policy.
Last updated October 24, 2026.