Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Turn an SVG into a PES file

In this tutorial you save a small design as SVG and plan it for a Brother machine. Then you look at what it will sew, and sew it. The design is a red star inside a blue ring, 44 mm across.

You need

  • StitchCraft, installed.
  • A text editor, or a drawing program that saves SVG, such as Inkscape.
  • To sew it: the machine and materials of your first sew-out.

1. Save the design

Save this text as badge.svg:

<svg xmlns="http://www.w3.org/2000/svg" width="50mm" height="50mm" viewBox="0 0 50 50">
  <!-- A red star inside a blue ring, 44 mm across. The star sews first. -->
  <polygon id="star" fill="none" stroke="#c8102e" stroke-width="0.4"
           points="25,10 28.53,20.15 39.27,20.36 30.71,26.85 33.82,37.14
                   25,31 16.18,37.14 19.29,26.85 10.73,20.36 21.47,20.15"/>
  <circle id="ring" cx="25" cy="25" r="22" fill="none" stroke="#1f4e9c" stroke-width="0.4"/>
</svg>

StitchCraft sews each shape’s stroke as a line of running stitch, in the stroke’s colour. It reads the design’s size from width, height and viewBox, and here one unit is 1 mm. Shapes are sewn in the order the file lists them, and the star comes first.

2. Plan it

$ stitch plan badge.svg -o badge.pes --preview badge.png
badge.svg
  file      badge.pes (PES v1, 1498 bytes)
  sha256    5fea2f6734fadacdc1f3f1a7268bd964d3ab6c4bf1ba3b9f8fd6d10a4aae0d8c
  profile   brother-pe800-5x7 (Brother PE800 with its 5 × 7 in hoop)
  size      44.0 × 44.0 mm
  stitches  124 stitches, 2 jumps, 1 trim, 1 colour change, 0 stops
  threads   1. unnamed (#c8102e), shown as Brother PEC 5 "Red"
            2. unnamed (#1f4e9c), shown as Brother PEC 2 "Blue"
  preview   badge.png (384 × 384 pixels)

stitch plan writes the machine file and, with --preview, a picture of it. It plans for the brother-pe800-5x7 profile, the PE800 with its 5 × 7 in hoop, unless --profile names another. Each colour is a thread, and the PES file shows it as the nearest Brother palette colour that no other thread of the design has. The machine stops between the red and the blue for you to change the thread.

3. Look at it

The preview shows the embroidery as it will sew:

The simple style, from stitch preview badge.pes -o badge-simple.png --style simple, shows each needle point:

The stitches are spread evenly along each straight edge, and every corner of the star has a needle point. The grey dashes are the frame’s move from the star to the ring, after the colour change.

4. Sew it

Load badge.pes and sew it as in your first sew-out. Thread red first, and blue when the machine stops.

When StitchCraft warns

StitchCraft says what it changes or leaves out of a design. This one from StitchCraft’s tests has a fill of 2 rectangles and 2 lines that nearly touch:

$ stitch plan strokes.svg -o strokes.pes --preview strokes.png --report strokes.json
strokes.svg
  file      strokes.pes (PES v1, 2840 bytes)
  sha256    d0ce3f4cb7843412b2ab0d4aeab07385fdf20b16a7e77cac3cefcf0b4b9193a3
  profile   brother-pe800-5x7 (Brother PE800 with its 5 × 7 in hoop)
  size      60.0 × 45.0 mm
  stitches  556 stitches, 6 jumps, 5 trims, 3 colour changes, 0 stops
  threads   1. unnamed (#c00000), shown as Brother PEC 5 "Red"
            2. unnamed (#0040c0), shown as Brother PEC 21 "Ultramarine"
            3. unnamed (#c00000), shown as Brother PEC 5 "Red"
            4. unnamed (#00a000), shown as Brother PEC 37 "Leaf Green"
  preview   strokes.png (512 × 392 pixels)
  report    strokes.json
warning SC-W0307 (svg:patch:fill): This fill's area falls into 2 parts that are sewn one after another, with a jump between each.
  hint: To choose the order the parts are sewn in, break the fill apart into one element for each part.
info SC-I0504: A needle point less than the shortest stitch (0.3 mm) from a needle point next to it was left out.
  • SC-W0307 names the fill, whose 2 rectangles are sewn one after the other, with a jump between them.
  • SC-I0504 says a needle point too close to the one before was left out, where the lines nearly touch.

stitch explain with a code tells you more, and diagnostic codes lists them all. --report writes the file’s counts, size and SHA-256, the threads and the messages as JSON, for scripts.

Next

Stitch types shows what each stitch type does and the parameters that change it.