A command-line interface for working with Pebble Draw Command (PDC) files. With pdc_tool, you can:
- Convert SVGs to PDCs,
- Render PDCs as PNGs,
- Render SVGs directly to PNGs,
producing pixel-perfect output identical to how the original Pebble (1-bit B&W) or Pebble Time (64 colors) will display a given vector drawing.
Note
This is an early version with known limitations. While this tool should not cause any harm, it may fail in (un-)expected ways.
Download the platform-specific binary from pdc_tool/releases.
- Introduce command
pdcto actually save a PDC. - Emit diagnostics during conversion.
- Provide examples (SVGs and commands to run).
- Command
svgto produce annotated output (embedded diagnostics). - Support Bézier curves and
<circle>elements. - Open-Source (Rust)
svg_tooland itspdccommand (excludingpng, as it depends on Gossan).
If you see the message:
"Apple could not verify 'pdc_tool' is free of malware that may harm your Mac or compromise your privacy."
You can either:
- Click the
(?)icon in the dialog and follow Apple's instructions, or - Remove the quarantine flag via the terminal:
xattr -d com.apple.quarantine ~/Downloads/pdc_toolWhile discussing https://github.com/pebble-dev/iconography/ with @lavglaab, we realized that graphic designers had only limited tools to verify their work. pdc_tool bridges that gap by rendering vector graphics exactly(!) like Pebble, pixel-perfectly down to every single bug. You can run pdc_tool input.svg png output.png and optionally choose from various options from color depth (b&w vs. 64 colors), background color, and anti-aliasing. The result is a 144x168px PNG that matches what Pebble will render, down to the last bit.
Under the hood, pdc_tool uses a cleanroom re-implementation of the Pebble application runtime in Rust called "Gossan". Developed over several years in @HBehrens's spare time, Gossan manages a framebuffer and provides Pebble's drawing routines (and much more that's irrelevant in this context) when rendering Pebble Draw Commands (PDC). It is extensively tested against Pebble's actual firmware to validate the same behavior between Pebble and Gossan or document any discrepancies. Since the Pebble firmware is now open-source, a few remaining edge-cases (pun intended) could be fixed!
The main priority was quickly enable graphic designers to contribute to https://github.com/pebble-dev/iconography/ with high confidence. The source of pdc_tool is entangled with Gossan (see above) and lives in Gossan's private repository. The plan is to restructure it and to open-source at least the conversion from SVG→PDC. That way, folks can understand (and help improving) the PDC generation. It will also allow for use-cases where open-source is critical (i.e. as an alterative to svg2pdc.py).
