Skip to content
Stitch Toolbox

Digitising

How an image becomes an embroidery file: the digitising pipeline, step by step

From pixels to stitches: background removal, colour reduction, stitch type by measured width, underlay, pull compensation, underlap, sequencing and trims, with the values.

7 min read · Published September 21, 2026

People search for a way to convert a PNG to DST or a JPG to PES, and the first thing to know is that there is no conversion to do. A stitch file is a list of needle positions: move 1.2 mm right, 0.3 mm down, stitch; trim; change colour. A picture contains none of that. Something has to decide where the needle goes, and that deciding is called digitising. This guide walks through how the image to embroidery tool makes those decisions, in order, with the values it uses, so that nothing about the file it gives you is a mystery.

1. Scale to the finished size

You give the longest side in millimetres, and the artwork is resampled so that one pixel is 0.1 mm of embroidery, up to 1,400 pixels. Stitch formats store positions on a 0.1 mm grid, so this is as fine as the output can use. An SVG is drawn by the browser at that resolution straight from the vector, which is why vector input gives the cleanest edges.

Size comes first because everything after it is a physical measurement. A line that is 2 mm wide at 120 mm is 1 mm wide at 60 mm, and those get different stitches.

2. Find the background

If the image has transparency, transparent pixels are the background. Otherwise the most common colour along the frame is taken as the background, provided it covers more than half of the frame, and it is flooded inwards from the edges through pixels within about 14 ΔE of it. Enclosed areas in that same colour, within a tighter 8 ΔE, are judged one by one: a convex blob (the inside of an O, the eye of an e) is a hole and stays open, as is anything walled in by a line thinner than a quarter of its size; a star, a white letter or any shape with corners and notches is part of the design and is stitched. One setting stitches every enclosed area for designs where that judgement is wrong, and another keeps the whole rectangle.

The requested size is then applied to what is left, the design itself, not to the page it sat on.

3. Reduce the colours to threads

Pixels are grouped into a histogram and clustered by weighted k-means in CIELAB, where distance corresponds to perceived difference. Clusters closer than about 11 ΔE are merged, then the closest pairs are merged until the count is within your limit (12 at most). A colour covering under 0.3 % of the design is dropped only if it is also tiny in area or close to another colour, so a small red nose on a mascot survives.

4. Clean the colour map

This step is the difference between a clean file and a fringe of junk stitches.

  • A 3 × 3 majority vote removes single-pixel noise.
  • Every connected region is measured. Regions smaller than the minimum detail (0.4 mm by default, adjustable from 0.3 to 1.5 mm) in width or area are dissolved: their pixels are handed to the nearest surviving neighbour. Anti-aliased rims, dust and scratches in a distressed logo all go this way, and so do specks of background inside a shape.
  • A colour that exists almost entirely as rims thinner than about 0.8 mm, and has a near twin within 38 ΔE, is JPEG ringing. Its rims are dissolved too, so a compressed three-colour logo yields three threads.

5. Decide the stitching order

Colours are ranked by area, largest first. Then layering is worked out from the picture: a shape surrounded by one solid colour and smaller than it sits on top, so that colour is sewn earlier; a shape larger than what surrounds it is a fill inside a border, and the border is sewn after it. Colours that are mostly thin detail, outlines and lettering, go last. Each colour is one block unless the picture demands otherwise: a dark ring around a cream disc with dark text on the disc is sewn as ring, disc, text, with the dark thread coming back once, which is how a digitiser would sequence it.

6. Extend each colour under the next

For every colour, the area is grown under the colours that will be sewn after it:

  • by the fabric's overlap, 0.30 to 0.50 mm, along every shared edge;
  • across slits up to 1.6 mm wide that a later colour will cover, so a whisker drawn over a face does not cut the face's fill in two;
  • under whole small shapes, up to 18 mm², that sit entirely inside it. Stars on a field and the pupil of an eye are stitched on top of an unbroken fill, the way a digitiser would do it, rather than into holes that pull open.

7. Choose a stitch type by measured width

Each connected shape is measured with a distance transform: its width is twice the largest distance from any inside point to the edge.

| Width | Shape | Stitch | |---|---|---| | under 0.9 mm | any | Triple running stitch on the centre line, 2.0 mm stitches | | 0.9 to 3.4 mm | elongated (area at least 2.2 × width²) | Satin column | | wider, or compact | | Tatami fill | | up to 7 mm, under 250 mm², strokes that meet, bend sharply or form a ring | lettering, badges | Fixed-angle satin: single-stitch rows straight across, over a centre run along the strokes | | wide body with thin tails | | Body filled; tails under 2.2 mm split off as satin or running lines |

You can override the choice per colour.

Satin. The shape is thinned to its medial axis, spurs shorter than 1.6 half-widths are pruned so square ends do not fork, and columns are laid across the axis every 0.2 mm (0.40 mm between penetrations on the same side). Free ends are squared off along the stroke's direction instead of fanning into the corners. A centre-run underlay goes out along the stroke and the satin comes back over it, so each branch is one continuous path. Pull compensation is half the fabric's value plus 2.5 % of the column width per side.

Fill. Parallel rows at the fabric's spacing (0.38 to 0.55 mm), with 3.6 mm stitches whose penetrations are staggered over four rows so they never line up into a visible ridge. Rows up to 6.5 mm are sewn as a single stitch, so a small round shape comes out with a smooth satin look. No penetration is placed within 0.9 mm of a row end, which avoids stub stitches. Each colour gets a different fill angle from the set 45°, 135°, 20°, 110°, 70°, 160°, so neighbouring areas catch the light differently.

8. Underlay and compensation for fills

Every fill over 10 mm² gets an edge walk, a running stitch 0.7 mm inside the outline that pins the edge down. Fills over 30 mm² also get a tatami underlay: sparse rows at right angles to the top stitching, 3 mm apart on stable fabrics and 2 mm on knits, fleece, towels and stretch fabrics, kept 0.9 mm inside the outline. Leather and vinyl get the edge walk only, because every hole is permanent. Top rows are lengthened at both ends by the fabric's pull compensation, from 0.10 mm on leather to 0.40 mm on towels and performance knits.

9. Join the parts without jumping

A fill around holes breaks into strips. Instead of a jump between strips, the tool finds a route through the inside of the shape on a 0.35 mm grid and sews it as 2.8 mm running stitches. Strips are taken in sweep order across the row direction, and the route costs less through areas that are not yet filled, so the travel is laid down first and the rows that follow cover it. Only a part that is genuinely disconnected costs a trim.

10. Tie off, trim, tidy

Every object starts and ends with two 0.7 mm lock stitches. Moving more than 1.5 mm to the next object writes a trim; shorter moves are sewn. Within a colour, fills go first, then satin, then running lines, each in nearest-neighbour order. Finally, penetrations closer than 0.3 mm are merged, any stitch over 12 mm is divided, and the design is centred on the origin.

11. Measure it

The last step is the production audit: coverage of the artwork by thread, stitches outside it, stitches under 0.3 mm and over 12.1 mm, the share of area with stacked layers, trims per thousand stitches, details dropped and colour count. The file you download is rebuilt on the server from the same colour map with the same engine, so it matches the preview stitch for stitch, and you can open it in the viewer or the pre-flight check like any other.

What this pipeline cannot know

It reads geometry. It does not know that a shape is a horse, that the stitches of a leaf should follow its veins, or that your customer's tagline matters more than the star above it. For artwork where those judgements decide the result, see when to use a human digitiser. For everything else, the fastest way to find out is to drop the image in, set the size, and read the audit.

Questions

Can you convert a PNG or JPG directly to PES or DST?

Not by conversion. An image holds coloured pixels and a stitch file holds needle positions, so the stitches have to be planned: that is digitising. Tools that claim to convert either digitise automatically or produce a file that will not sew.

What is underlay in embroidery?

Stitches sewn first and hidden by the top layer. They fix the fabric to the backing, flatten pile and give the top stitches something to sit on. Fills get a run just inside the edge and a sparse grid at right angles to the top rows; narrow satin gets a run down its centre.

What is pull compensation?

Stitches shorten the fabric along their length as they tighten. Pull compensation lengthens each row or widens each column slightly, 0.15 to 0.4 mm depending on the fabric, so the sewn shape matches the drawn one.

Why are my colours stitched in that order?

Large areas first, shapes that sit on top of another colour after it, and outlines and lettering last. Each colour is sewn once, so a single-needle machine stops as few times as possible.

Does the fabric choice change the file?

Yes. Row spacing, pull compensation, the underlay under fills and how far colours overlap all come from the fabric preset, so a towel file and a twill file of the same logo have different stitches.