Premium apps Part of Threadsmith

Threadsmith Sequence Optimizer

Reorder the stitch segments of a DST, PES, JEF or EXP file for fewer trims, jumps and colour stops.

Tajima .dst, Brother .pes, Janome .jef or Melco .exp.

Same format as threadsmith-stitch-file.

More options

Optional #rrggbb per colour block. DST and EXP files store no colours, so blocks are only merged when you give their colours (PES/JEF colours are read from the file).

mm

Shorter gaps are jumped without a trim.

Only blocks whose stitches do not overlap anything sewn in between are moved together.

stitches/min

Try an example: Monogram badge DST: fewer trims, same stitches · Name tag EXP → optimised DST · Stitch list: two red squares around a blue one (red blocks merged)

More about this tool

How it works

Reads an embroidery machine file (or a stitch list), splits it into the segments that are sewn without a jump or trim, and finds a sewing order with fewer trims, jumps and colour changes: segments may be sewn backwards, colour blocks with the same thread are merged, and segments whose stitches overlap keep their original order so the layering does not change. Every stitch is kept. You get the before/after counts, the sewing time saved and the optimised file in the same or another format, decoded again to prove that every penetration is still there.

  • The file is decoded (DST balanced ternary, EXP bytes, PES via its PEC block, JEF) into stitches, jumps, trims and colour changes; a segment is a run of stitches between two jumps, trims or colour changes.
  • Layering: segments whose stitches touch a common 1 mm cell keep their original order. All other segments may move, and within a thread they may be sewn backwards (jump to the last stitch, sew the same penetrations in reverse).
  • Order: stay in the current thread while a segment of it is free, otherwise switch to a thread that can be finished completely (or has most free segments); the next segment is the cheapest connection — jump for gaps under the trim distance, trim + jump otherwise. A relocate pass moves single segments inside a thread run when that is cheaper.
  • The file is rebuilt with one jump per gap (the writer splits long moves into format-legal records), trim + colour change between threads and END. The new order is only used when colour changes, trims and jumps are all no higher than in the input and at least one is lower.
  • Jumps are counted as moves: several jump records that a format needs for one long move count once. Sewing time = stitches ÷ speed + 4 s per trim + 20 s per colour change + 0.15 s per jump.

Moving segments changes where the machine trims and ties off; check the new order in a viewer and test-stitch before production. Tie-in/tie-off stitches inside the file are kept as they are.

Sources

Part of Threadsmith

Related tools

  • Threadsmith Design Stats – Stitch count, colours, trims, thread, sewing time and density of a DST, PES, JEF or EXP file.
  • Threadsmith Stitch File Writer – Write DST, PES, JEF or EXP embroidery machine files from a stitch list or a Threadsmith project.
  • Threadsmith Digitizer – Turn shapes, SVG paths, text or a whole project into embroidery stitches with stats and preview.

How to use the Threadsmith Sequence Optimizer

Reorder the stitch segments of a DST, PES, JEF or EXP embroidery file for fewer trims, jumps and colour stops without losing a single stitch.

What it is for

Many embroidery files are sewn in an order that wastes time: the machine trims, jumps across the hoop, sews a small piece, trims again and comes back. Every trim costs a few seconds and leaves two thread tails; every colour stop waits for you. On a 200-piece order that adds up to hours.

This tool reads a Tajima DST, Brother PES, Janome JEF or Melco EXP file (or a stitch list), cuts it into the segments that are sewn without a jump or trim, and looks for a better order. A segment may be sewn backwards when that brings its start closer, and colour blocks that use the same thread can be merged into one stop. Segments whose stitches overlap keep their original order, so nothing that was on top ends up underneath. Every stitch is kept: the tool checks that the output has exactly the same penetrations, then writes the file and decodes it again.

It does not redigitize anything. Stitch lengths, density, underlay and tie-offs stay as they are.

Worked example

The first example uses the monogram badge template as a DST file. The tool found 26 sewn segments and reversed 11 of them:

Trims: 15 → 10 · Jumps: 26 → 26 · Colour changes: 2 → 2 · Sewing time: 8 min 46 s → 8 min 26 s. All 4,925 stitches kept.

Five trims disappear because several gaps became shorter than the 5 mm trim distance, so the machine just jumps. That is 20 s per piece, or more than an hour on a 200-piece run.

The second example takes the name tag as a Melco EXP file and writes an optimised DST at 800 stitches per minute: trims drop from 19 to 12 and the time from 3 min 34 s to 3 min 6 s, with all 1,503 stitches kept.

The third example is a stitch list with a red square, a blue square and another red square that don't touch. The two red blocks are merged: colour changes go from 2 to 1 and the time from 50 s to 30 s.

How to read the result

  • Trims, jumps, colour changes: before → after. The new order is only used when none of them goes up and at least one goes down; otherwise the file is written unchanged and the result says so.
  • Sewing time: stitches at your speed plus 4 s per trim, 20 s per colour change and 0.15 s per jump.
  • Segments / reversed segments: how the file was cut up and how many pieces now run backwards.
  • Stitches preserved and verified: the input and output have the same penetrations, and the written file decodes back to them.
  • Colour order for the machine: thread the needles in this order.

Tips and common mistakes

  • DST and EXP files store no colours. Enter the thread colours in sewing order, otherwise colour blocks are never merged.
  • Jumps count as moves: one long move that a format splits into several records counts once.
  • Lower the trim distance if your machine trims short jumps anyway, or raise it to keep more jumps untrimmed.
  • Turn off Allow sewing segments backwards for designs where the sewing direction matters, such as directional satin effects.
  • Open the result in a viewer or the Threadsmith app and test-stitch before a production run.

FAQ

Can it change how the design looks?

Overlapping segments keep their order, so layering doesn't change. Segments sewn backwards land on the same needle holes, but the thread lies slightly differently at their ends.

Why did it find nothing better?

Designs that are already sewn colour by colour, nearest piece next, often can't be improved without adding trims or jumps somewhere else.

Does it keep tie-in and tie-off stitches?

Yes, they are part of the segments. Where a trim disappears, the tie-off before it stays in the file.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://threadsmithsequenceoptimizer.usefulweb.site/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://threadsmithsequenceoptimizer.usefulweb.site/mcp · tool name threadsmith_sequence_optimizer
Example request
curl -s -X POST https://threadsmithsequenceoptimizer.usefulweb.site/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{…see OpenAPI examples…}'
Feedback · ideas & bug reports welcome