Embroidery format SPX
Spx files are Pfaff machine binary stitch files. As these are saved with .edr files the assumption is they do not themselves store any color information.
All files start with magic numbers 25 73 70 78 25: %spx%
This is very similar to VP3 style format and sectional tagging. Embroidery format VP3
Section 01 01 01
Section tag 01 01 01. 08-0B Following that we have the remaining number of bytes in the file, in a 4 byte big endian number.
We then have in the 01 01 01 block 0x50 characters that typically read:
- 00 4E 00 20 00 20 00 20 00 20 00 20 00 20 00 20
- 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20
- 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20
- 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20
- 00 20 00 20 00 20 00 20 00 20 00 20 00 20 00 20
Section 07 01 01
Section tag 07 01 01.
5F-62 Following that we have the remaining bytes in the file, in a 4 byte big endian number.
We then have a single number:
- 00 01
Section 06 01 01
Section 06 01 01 doesn't contain the distance to the end of the file, but to the end of the current section block. This is usually 00 6D.
- 01 03 E8 00 00 07 01 00 01 00 01 00 00 00 00 19
- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
- 8C-8F Then a we have the width in micrometers. So 5000 (dec) for a 5mm, and 49900 for a 49.9mm wide design.
- 90-92 This is followed by a 4 byte big endian number which is twice the width.
Followed by some unchanging data:
- 03 00 00 01 F4 00 00 0F A0 00 00 2E E0 00 00 8C
- A0 00 00 01 F4 00 00 03 E8 00 00 07 D0 00 00 00
- 00
- B4-B7 This is followed by the height in a 4 byte big endian number.
Then we have another bunch of unchanging characters:
- 00 00 EA 60 03 00 00 00 00 00 00 0B B8 00 00 17
- 70 00 00 23 28 00 00 00 FA 00 00 01 F4 00 00 03
- E8 01 05 01 01 00 00 00 1E 00 00 00 00 00 00 00
- 00 00 00 00 00 00 00 00 00 19
- F2-F5 Then the width again in 4 byte big endian.
- F6-F9 Then the height again in 4 byte big endian.
And we finish out the section with:
- 00 00 00 00 00 01
Section 03 01 01
Section starts exactly at 0x100
103-106: Following that we have the remaining bytes in the file, in a 4 byte big endian number.
We 4 4-byte big endian numbers conveying some information about size.
00 00 00 64 00 00 00 64 00 00 00 64 00 00 00 00
Section 02 01 01
We then enter section 02 01 01:
- Following that we have the remaining bytes in the file, in a 4 byte big endian number.
This is the stitches section:
- All stitches are grouped into 9 bytes. The first two bytes is always 80 2F and the last two are always 80 0F.
- 80 2F XX XX YY YY CC 80 0F
- XX XX is 2 bytes of little-endian signed relative coordinate.
- YY YY is 2 bytes of little-endian signed relative coordinate.
- CC is usually 00, F6 and 0A are also frequently seen values.
Reading
To make a reader most everything in the header is pointless. Skip 0x11E characters. Then read sets of 9. In which the 3,4 5,6 and 7 bytes may be relevant.