JEF File Viewer

Here are some are some source files and program files to crudely view JEF files.

JEF files are a binary file consisting of two parts: header and stitches. The header part is mainly 32bit integers. The stitches are held in a list of x-y pairs of 8bit signed integers.

The header contains a ordered list of 32bit integers, except the date and time values, which are ASCII numbers in YYYYMMDDHHMM format, but padded with zeroes to the 32bit boundary. The fields I have guessed are,

  1. header length or first stitch file offset
  2. file version or something
  3. date
  4. time
  5. colour count
  6. stitch count
  7. unknown
  8. width 1 in 0.02cm units
  9. height 1 in 0.02cm units
  10. width 2 in 0.02cm units
  11. height 2 in 0.02cm units
  12. width 3 in 0.02cm units
  13. height 3 in 0.02cm units
  14. width 4 in 0.02cm units
  15. height 4 in 0.02cm units
  16. minus 1
  17. minus 1
  18. minus 1
  19. minus 1
  20. width 5 in stitch size units or something
  21. height 5 in stitch size units or something
  22. width 6 in stitch size units or something
  23. height 6 in stitch size units or something
  24. width 7 in stitch size units or something
  25. height 7 in stitch size units or something
  26. width 8 in stitch size units or something
  27. height 8 in stitch size units or something
  28. array of colour codes, one for each colour/thread change
  29. array of value 13, one for each colour/thread change: I do not know what 13 might signify

The stritches are either a signed 8 bit offset from the last stitch or a command code. The command codes have the x offset equal to -128 and the y offset could be 1 for change colour/thread, 2 for move - do not stitch, and 16 for end of stitch list.

I do not know what colour code is what colour and it does not seem related to the Janome thread code. I do not know what values might indicate: design size (width 1 and height 1), hoop size, sewing time, sewing order, thread density, thread type, or what all the different widths and heights are for.

The sewing seems to start in the centre, the first few stitches move to the design start.

Source Files

Makefile
Project file
JEFView.c
The main source file
JEF.h
JEF.c
JEF library source files
ps.h
ps.c
PostScript library source files

Built Files

x86_64/JEFView
JEF to EPS convertion program.
x86_64/JEFScan
JEF read/scan program.

Examples

R16 - Jam Pot Cover

r16.jef r16.eps Jam Pot Cover Embroidery

Teddy

tiddy10.jef tiddy10.eps Teddy Embroidery

USA Flag

US_Flag.jef US_Flag.eps USA Flag Embroidery

While Lily

white_lily05.jef white_lily05.eps White Lily Embroidery