Introduction
Binary G-code is a compact container for G-code, introduced by Prusa Research in 2023 for its printers and written by PrusaSlicer. It holds the same commands as a text G-code file, but compressed and split into blocks, with the print settings and preview images stored in their own blocks so a printer can show them without reading the whole file.
Files are often several times smaller than the text form, which speeds up transfer over a network. Prusa publishes the specification and a library, and the files can be converted back to plain G-code.
Structure
A binary G-code file starts with the four bytes GCDE, a version number
and the type of checksum used. Blocks follow, each with a header giving its type, its
compression and its sizes, then its parameters, its data and an optional CRC-32
checksum. Metadata blocks come first: printer metadata, thumbnails, print metadata and
slicer metadata. The G-code itself follows in a series of blocks, compressed with
Deflate or Heatshrink and optionally packed with MeatPack, which stores common G-code
characters in fewer bits.
0File headerGCDE, version, checksum type10 bytes10Metadata blocks printer, thumbnails, print, slicervaries…G-code blocks the compressed commandsvaries
Links
Software
- PrusaSlicer (Windows, macOS, Linux)
Developers
- libbgcode, Prusa’s C++ library and command line tool for reading, writing and converting binary G-code, with the specification