Wiki

Clone wiki

python-showjef / Home

Python Tools for Embroidery Formats

This project aims to provide tools for displaying the contents of files for embroidery machines, and for converting them to other formats.

Links

See this Web site for details: http://lydgate.org/blogs/?p=17

Another project that seems to have been inspired by the problem of reading Tajima (.dst) format files: http://code.google.com/p/pyembroidery/

JEF File Format

The Janome Embroidery Format .jef (and the .sow) files contain a header and stitch instructions, but does not contain any obvious signature bytes. The only signature is to see if the thread change table is the correct size and the file length is right for the number of thread changes and the number of stitches. For the .jef+ format there is extra data after the thread tables, then the 32bit aligned string "JANO", "ME\0\0", then a 32bit number (1 for a 1 thread pattern), then a 32bit bitmap-start offset -- with ruins the .jef 'signature', but now we have the string "JANOME".

The header contains a date, number of thread changes, number of stitches, stitch extent rectangle, other optional rectangles, and two thread change tables (the first is thread colour). The stitch instructions are pairs of 8 bit offsets (starting from the centre of the design) with an escape sequence for move, thread change, and end of pattern.

OffsetDescription
0x0000Stitch-start offset
0x0004Flags, domain: 0x1, 0xa
0x0008Date ASCII YYYY
0x000CDate ASCII MMDD
0x0010TIME ASCII HHMM
0x0014TIME ASCII SS00
0x0018Thread-load-count
0x001CStitch-count
0x0020Hoop-code, domain: 0 "A 126mm x 110mm", 1 "C 50mm x 50mm", 2 "B 140mm x 200mm", 3, 4
0x0024Stitch-extent-left 0.1mm units from centre
0x0028Stitch-extent-top
0x002CStitch-extent-right
0x0030Stitch-extent-bottom
0x0034box2-left -- minus 1 appears to indicate not used
0x0038box2-top
0x003Cbox2-right
0x0040box2-bottom
0x0044box3-left
0x0048box3-top
0x004Cbox3-right
0x0050box3-bottom
0x0054box4-left
0x0058box4-top
0x005Cbox4-right
0x0060box4-bottom
0x0064box5-left
0x0068box5-top
0x006Cbox5-right
0x0070box5-bottom
0x0074thread-colour-table, domain: 0x01 - 0x4e -- there are 79 colours in the Janome catalogue
+Thread-load-count * 4
+0x0000 thread-type-table, domain: 0xd
+Thread-load-count * 4
+0x0000 jef plus zero
+0x0004 jef plus zero
+0x0008 jef plus "JANO"
+0x000C jef plus "ME"
+0x0010 jef plus bitmap-count (may be)
+0x0014 jef plus bitmap-start offset
...
Stitch-start stitch-table pairs of signed 8bit values, either 0x80 and command or dx and dy
...
bitmap-start jef plus bitmap

Updated