Skip to content

Pebble Draw Command File Format

Pebble Draw Commands (PDCs) are vector image files that consist of a binary resource containing the instructions for each stroke, fill, etc. that makes up the image. The byte format of all these components are described in tabular form below.

Important: All fields are in the little-endian format!

An example implementation with some usage limitations can be seen in svg2pdc.py.

Component Types

A PDC binary file consists of the following key components, in ascending order of abstraction:

Versions

PDC Format VersionImplemented
1Firmware 3.0

File Format Components

Point

FieldOffset (bytes)Size (bytes)Description
X02X axis coordinate. Has one of two formats depending on the Draw Command type (see below):

Path/Circle type: signed integer.
Precise path type: 13.3 fixed point.
Y22Y axis coordinate. Has one of two formats depending on the Draw Command type (see below):

Path/Circle type: signed integer.
Precise path type: 13.3 fixed point.

View Box

FieldOffset (bytes)Size (bytes)Description
Width02Width of the view box (signed integer).
Height22Height of the view box (signed integer).

Pebble Draw Command

FieldOffset (bytes)Size (bytes)Description
Type01Draw command type. Possible values are:

0 - Invalid
1 - Path
2 - Circle
3 - Precise path
Flags11Bit 0: Hidden (Draw Command should not be drawn).
Bits 1-7: Reserved.
Stroke color21Pebble color (integer).
Stroke width31Stroke width (unsigned integer).
Fill color41Pebble color (integer).
Path open/radius52Path/Precise path type: Bit 0 indicates whether or not the path is drawn open (1) or closed (0).
Circle type: radius of the circle.
Number of points72Number of points (n) in the point array. See below.
Point array9n x 4The number of points (n) points.

Pebble Draw Command List

FieldOffset (bytes)Size (bytes)Description
Number of commands02Number of Draw Commands in this Draw Command List. (0 is invalid).
Draw Command array2n x size of Draw CommandList of Draw Commands in the format specified above.

Pebble Draw Command Frame

FieldOffset (bytes)Size (bytes)Description
Duration02Duration of the frame in milliseconds. If 0, the frame will not be shown at all (unless it is the last frame in a sequence).
Command list2Size of Draw Command ListPebble Draw Command List in the format specified above.

Pebble Draw Command Image

FieldOffset (bytes)Size (bytes)Description
Version81File version.
Reserved91Reserved field. Must be 0.
View box104Bounding box of the image. All Draw Commands are drawn relative to the top left corner of the view box.
Command list14Size of Draw Command ListPebble Draw Command List in the format specified above.

Pebble Draw Command Sequence

FieldOffset (bytes)Size (bytes)Description
Version81File version.
Reserved91Reserved field. Must be 0.
View box104Bounding box of the sequence. All Draw Commands are drawn relative to the top left corner of the view box.
Play count142Number of times to repeat the sequence. A value of 0 will result in no playback at all, whereas a value of 0xFFFF will repeat indefinitely.
Frame count162Number of frames in the sequence. 0 is invalid.
Frame list18n x size of Draw Command FrameArray of Draw Command Frames in the format specified above.

File Formats

Pebble Draw Command Image File

FieldOffset (bytes)Size (bytes)Description
Magic word04ASCII characters spelling "PDCI".
Image size44Size of the Pebble Draw Command Image (in bytes).
Image8Size of Pebble Draw Command Image.The Draw Command Image in the format specified above.

Pebble Draw Command Sequence File

FieldOffset (bytes)Size (bytes)Description
Magic word04ASCII characters spelling "PDCS".
Sequence size44Size of the Pebble Draw Command Sequence (in bytes).
Sequence8Size of Draw Command SequenceThe Draw Command Sequence in the format specified above.