Embroidery format
Introduction
There are several kinds of Embroidery file formats, and each contains different abilities and features. Some formats have different versions with increased features. Usually these try to preserve backwards compatibility because of the cost of the hardware in question.
This page attempts to provide a short overview on embroidery formats. For technical details, see the specialized articles (menu to the right).
Kinds of Embroidery File Types
- All sorts of 2D bitmap and vector formats for the drawings, i.e. formats that are not specifically made for embroidery
- Embroidery file formats that work on a range of machines and also can be used as exchange formats. These are sometimes called commercial formats.
- Embroidery file formats that are mostly brand or even type specific
- Both so-called commercial file formats and more brand-specific formats come in two forms: Some only have stitching information, others keep information that makes them easily editable. The latter could be called worker files.
It seems that there are about 30 different formats. It is not clear to me what different formats can do. Also, I don't know how formats are supported by various vendors. Some formats seem to be barely editable since they only contain stitching instructions like "go to x/y" and "add a stitch from x1/1y to x2/y2" or "change thread". Others may include precise information about the shape and kind of a design part and keep stitching information apart, i.e. an area is not just defined in terms of stitches. The latter are more easily editable. Other formats (like JEF) may keep just some information, e.g. colors.
The stitching information is actually less informative than that. It actually means move x, y, and stitch or move x, y and don't stitch, or stitch then move x, y. The machine is stitching whether you move or not. But, whether the stitch hits after the movement or before actually differs by format and machine. Stitch doesn't mean put thread between points a and b. It means go somewhere before the needle hits. Just as jump can be taken as do what stitch does but also block that needle bar.
It is sometimes difficult to find out what formats a specific machine from various Brands can read. E.g. Bernina's feature their own brand-specific editable *.art formats, but it seems that the high-end machines directly can read *.exp which is a commercial format, if I understood right. When I bought an Elna 8300, no information about formats was included in the documentation (or I couldn't find it) ...
To make the situation worse, some formats have different subtypes. E.g. the popular .PES comes in eight (actually it's no fewer than 12, but mostly settings in the program that edits them, there's only the 1 type of worker information within them) different versions :( - I once thought that the situation was really bad for video codecs, video containers or 3D vector formats, but embroidery beats anything else I am aware of in terms of obscurity and diversity.
Vendors include conversion software that can translate to their (and other's) machine readable CNC formats from a series of other low-level and also from more high-level formats. The most popular exchange formats seem to be DST and EXP, but these are not necessarily the best. As little as we know of today (after few hours spent on exploration) a good format (e.g. EMB) includes a vector description of each design part and attaches abstract stitching information to that object. This way it can be transformed without deforming stitches. Less powerful formats are directly stitch-based. The most popular rather machine-specific format seems to be *.pes (Brother) since it also includes worker information.
Machine Encoding
The most significant differences between embroidery files with the intent of running a machine, and those intended to run the programs that make those files. Often the actual controllers within the machines are similar and the encoding scheme for the embroidery files turns out to be quite similar. They are intended to control a stepper or servo motor, and a x-y plotter and a needle head. They don't do much beyond that. A lot of files simply encode for three things: a control command, an dx, and dy. This encoding is also heavily influenced by the actual physical requirement of the machine. The machines must stitch, unless the needle bar is blocked, which is the difference between a stitch and a jump. When enough of these are in a row, machines will often force a trim. It's possible with some machines to block the needle bar and move very far from the last stitch, others will force a trim. There are some cases like fringe where this is needed or puffy applique. Given this requirement, the commands used within the machine code is often similar sometimes identical when you get away from the header and into the actual stitches within the file.
Command Encoding Schemes
- Triplet, Tajima Punch-Card DST - triplet code generally with the +x and +y and control bits combined in a particular fashion together. With + and - values for the bits. The important control bits being located on the 3rd bit with the lowest two values of the control bit always set.
- Pairs, Signed X, Y with 0x80 triggered control events. 2 byte stitch, 4 byte controlled. If the X value is set to 0x80 aka -127 this invokes control form. Where the next byte (which would have been "Y") serves as a command usually with 01 being stop, 04 being jump. 0x10 being end. And the next two bytes are often controlled and can have positional characteristics so things like move.
- Triplet, Unsigned X, Y, Control. The control byte provides the direction for the plotter so it has the sign. The first bit of the command bit is always set. The next two bits control the sign of the x and y values. Usually the last bit controls whether that command is stitched or not (jump vs. stitch), block the needle bar or don't.
- Pairs (Varies), Signed 7 or 12 + Control Nibble. 2, 3, 4 byte encoding. Each value of the X and Y is read individually. When the highest bit is set (0x80) it triggers long mode. It means that the top 4 bits are control (the first one being used to trigger long mode). And the bottom nibble is appended to the next byte in the stream. So if the highest bit isn't set it's a 7 bit signed number. If the highest bit is set then control bits may come into effect and the number becomes a 12 bit signed number. This allows not only trigger control events but allowing an optional long mode. Only PEC blocks use this.
There are minor variations of these schemes sometimes with different endian methods and order of the bytes. Some like Xxx use 0x7F as as control, and 0x7D as long mode which means the X and Y in that case are 16 bit signed integers and read right after the 0x7D. And KSM uses triplet: x,y,control triggered control but permits non stitching x,y locations until stitching is re-enabled with a different control event.
Vector Files
At the other extreme there are vector files that serve to create embroidery files by having all by storing all the data needed to create an embroidery. This means having the vector shapes and fill types, and offsets and motifs, and which order these are located the start and stop location. And then generating a bunch of line segments through a variety of algorithms. These are then set into the machine readable formats for the machines to read and follow the set commands.
Hybrid Machine/Vector Files
Some files like PES actually have both of these. They contain a pointer to a PEC block that is entirely intended for brother embroidery machines to use. These blocks also exist in PEC files that simply say #PEC0001 and then have the PEC block, or within PES files or PHB and PHC files that equally also contain a PEC block.
Type and Structure of Embroidery Files
extension | Manufacturer(s) | Target | Structure | Content/Other |
---|---|---|---|---|
.10o | Toyota | Hardware | unsigned(x,y,control) encoded stitch | A separate .00o contain color |
.100 | Toyota | Hardware | 4 byte encoding. 2 bytes of control bytes, x,y with 3rd, 4th signed x, y locations. | |
.art | Bernina | Software | Compound File Binary Format, of a series of files. Different files within the format contain the summary information, the Design Information, contents (the compressed stitch data, zlib 4 bytes in), the Design Icon, a bitmap of the what the design should look like. | |
.bro | Bits & Volts | Hardware | 256 byte header. x == 0x80 control encoding, 2 stop, 3 jump | |
.csd | Singer, POEM | ? | brand-specific | |
.dat | Barudan | Hardware | 256 byte header, unsigned(x,y,control) | |
.dsb | Tajima for Barudan | Hardware | 512 byte DST header but stitches are unsigned(x,y,control) style | |
.dsg | Sierra | Stitch Era software | ? | worker + stitch |
.dst | Tajima | Hardware | (See detailed article)]] 512 byte header, DST encoded direct commands. | |
.dsz | Tajima for ZSK USA | Hardware | 512 byte DST header, big-endian unsigned(x,y,control) style encoding, with specified 4 bit needle | |
.edr | Embird | Software | this is full fledged vector encoding data for Embird software. | |
.emb | Wilcom | Software | vectors, icon, colors, stitch. this is a full fledged vector format stored very similarly to .ART and clearly share a code base. Several elements stored via a byte replacement cypher in a zlib compressed stream of data after a file size. | |
.emd | Elna | Hardware | 48 (0x30) byte header, x == 0x80 controlled encoding: 0x2A stop/color_change, 0x80 Jump, end 0xFD. | |
.exp | Melco, Bernina (high-end models) | Hardware | Expanded Melco (See detailed article) X == 0x80 controlled encoding. Color change, 0x01 is followed directly by 0x00 0x00 and a jump 0x80 0x04 uses the following the X, Y position instructed, but must be repeated each new command. | |
.exy | Eltac | Hardware | 256 bytes of header, Triplet coded in DST encoding. | |
.fdr | Barudan | ? | ? | ? |
.fxy | Forton | Hardware | 256 byte header, unsigned(x,y,control) style encoding | |
.gt | Golden Thread | Hardware | 512 bytes of header, unsigned(x,y,control) style encoding | |
.hus | Husqvarna Viking | Hardware | Compressed bytes. Using a small table arc compression. | |
.inb | Inbro | Hardware | (unverified) 8192 byte header, unsigned(x,y,control) style encoding | |
.jef | Janome | Hardware | (See specific article) stitch + color, Header information, magic-number thread lookup, and 0x80 triggered control events. | |
.ksm | Pfaff | Hardware | 512 byte header. unsigned(x,y,control) triplets. However, it doesn't force that encoding on all jumps. Rather after triggering a color change to a specific needle, it simply gives normal encoded x, y location (indistinguishable from stitches) until control bits of 0x19 triggers sewing again. | |
.max | Pfaff | Hardware | ||
.mit | Mitsubishi | Hardware | ||
.new | Ameco | Hardware | ||
.ofm | Melco | ? | Compound Binary format with some stitches in there. | |
.pcd | Pfaff | ? | these actually have a weird encoding scheme. Using absolute positioning rather than relative positioning. | |
.pcm | Pfaff | ? | stitch | |
.pcq | Pfaff | ? | stitch | |
.pcs | Pfaff | ? | stitch | |
.pec | Brother, Babylock | Hardware | (see detailed article) colors, stitch, 1 bit graphics., header of #PEC0001 then a pec block. This encodes not just magic number colors, but also graphics which are displayed on the machines themselves. And contain high bit long form + control triggering. | |
.pes | Brother, Babylock | Software + Hardware | (see detailed article),vectors, colors, (PEC File), contains several different layers of information. After the header #PES0XXX which determines the version of the file, it contains the position in the file containing the PEC block. The PEC block is information intended for the machine. This some information about the design, name, number of stitches, size, location of graphics information, followed by blanks equalling up to 512 bytes. And a series of direct commands for the design. This is followed by 1 bit graphic bitmaps. All of which are intended for the machine to run. Regardless of the version of the file. The program simply needs to read the location of the pec block, jump forward 512 bytes and read the direct commands. Or jump forward 22 bytes, read the graphics location, and then seek to that location and read the graphics to be displayed on the embroidery machine's screen. Different versions contain different information in the various blocks within the file that are jumped over. These include vector information and design specific instructions that are able to rebuild the stitch data from scratch. So an alteration can allow regeneration of the stitch data. | |
.phb, | Brother | Software + Hardware | Header, bunch of info and a PEC block. | |
.phc, | Brother | Software + Hardware | Header, bunch of info and a PEC block. | |
.sew | Janome, Elna, Kenmore | Hardware | magic number thread lookups. Signed x, y with 0x80 triggered control events. | |
.shv | Husqvarna Viking | Hardware | stitch, Big old giant 1 bit graphic, of varying size. Magic color index threads, duplex code 0x80 controlled events, with predefined length of stitching events before color switching. | |
.sst | Sunstar | ? | ||
.stx | Data Stitch | ? | Full thread data, lotta other stuff. | |
.t01 | Pfaff | Hardware | contains DST stitches with no header. | |
.t09 | Pfaff | Hardware | ||
.tap | Happy | Hardware | contains DST stitches with no header. | |
.thr | ThreadWorks | Software | full vector embroidery format for threadworks software. | |
.vip | Pfaff (older), Husqvarna | Hardware | stitch, Compressed stitches. Like Hus it uses Arc table compression. | |
.vp3 | Pfaff (newer) | ? | stitch, color, (See detailed article) unlike most encoding schemes Pfaff files are stored in designs, blocks, stitch blocks allowing multiple blocks and designs within the file structure (see article on specifics) as such the stitches are encoded in several places with seek values to the next relevant set of data and 0x80 triggered encoding that seems to have very few commands, namely 0x02 which means long form (it may just mean trim, and jump, as Pfaff's software seems to do that) and 0x01 which ends long form. And 0x03 that is seen at the end of the final block. | |
.u?? aka .u00, .u01 | Barudan | Hardware | 512 bytes of header. unsigned(x,y,control) encoded stitches in control, y, x (big endian) form. Can be made to do sequins. Likely any form that can specify needles can be made to do sequins. | |
.xxx | Singer, Compucon | Hardware | stitch | |
.zsk | ZSK USA | Hardware |
Misc Other Embroidery Data
- .INF, contains only color information like a thread chart.
Embroidery files are used both for stitching and editing. They need to be read by the machine doing the embroidery to process the series of commands. Since most machine embroidery is rendered from shapes and fills applied to those shapes, saving only data needed to stitch would be lossy. So many formats have a hybrid of this and store easy to read stitch data and higher level objects sometimes protected with encryption and compressed (.hus, .art, .emb). With the higher level the embroidery program can reproduce the lower level stitch commands. For most programs that read this data, they often have their own higher level objects and can read only the stitch data from other formats. When they also write these formats, they very often produce the minimum acceptable version of the file that will not crash the program reading the file. So converting from Wilcom's emb to PES will produce a PES with only stitches even if the Wilcom had access to the higher level objects and the saved version of .pes also those forms available.
Information that may be found
- Stitch Information.
- Direct commands go dx/dy, add stitch, go dx/dy, trim, change threads, stop.
- Explicit location of the points for the segment list.
- Stitchblocks unbroken lists of stitches in a particular color.
- Vector Information
- Shape Data, Rectangle, Circle, Path etc.
- How these shapes should be filled. For example:
- Type of fill being used
- Angle of the fill
- Angle-path of the fill
- Start and stop location within the shape.
- Pattern for the needle impacts.
- Randomization of edge.
- Font Information
- Text and font, how it should be applied.
- Design information.
- Design name.
- Design author.
- Design comments.
- Design keywords.
- Design copyright.
- Design category.
- Number of Stitches.
- Number of jumps.
- Size of embroidery.
- Start Location.
- Hoop Information.
- Specific custom hoop information.
- Distance design is from edge of hoop.
- Thread Information.
- Color data from a preselected list.
- Custom color data for thread.
- Thread metadata, manufacturer, pantone approximate, etc.
- Thread weight
- 2D Bitmap information, simulated view of the sewout.
- Bitmap representation for project. EMB contain a full color icon.
- Bitmap representation for each color. PEC contains 1 bit graphics.
- Control information for the typical editor of that format.
- Color of background.
- Scaling information.
Other lists:
- Embroidery File Formats supported in Embird
- Formats Supported at embroideryarts.com
- Need other embroidery format? Good list about popular embroidery formats (from Russia).
Acknowledgements
Due to reorganization - i.e. the breakup of the Computerized embroidery page - names of original contributors, in particular Tatarize, do not appear in the history of this page.