English
Login

Binary G-code

Relevant for

MINI
MINI+
XL
MK4
MK3.9
+
10 comments
Article is also available in following languages
English
Čeština
Polski
Deutsch
Français
Español
Italiano
日本語

Binary G-code is a new standard for encoding and compressing ASCII G-code files. G-code files are easy to read and interpret, but their downside is that the data is not saved efficiently, and the file size is often large. Compression of the file is problematic because the printers usually run on limited hardware and may not have enough memory and/or CPU power to decompress it.

Binary G-code

The binary G-code format is flexible and the encoding and compression of individual blocks is variable. We also provide libbgcode library which contains the routines to convert ASCII G-codes to binary and vice versa. The library is written in C++ and the repository includes bindings for Python.

Our testing shows that using binary G-code reduces the average size by about 70%.

Slicer requirements

The support for the .bgcode file format is implemented in PrusaSlicer, including its export, loading configs, and previewing G-code or file associations. Exporting binary G-code can be enabled in the Printers tab in General -> Support binary G-code. This option is enabled by default starting from the PrusaSlicer version 2.7.0. An option to convert ASCII G-code to binary (or the opposite) can be found at File -> Convert.

Disabling binary G-code export for all profiles

You can disable the use of binary G-code even globally for all profiles in the Configuration - > Preferences -> Other -> Use binary G-code when the printer supports it.

Firmware requirements

To print a binary G-code, it has to be supported by the firmware of the printer. For Original Prusa MINI, MK4, and XL printers, it is supported starting from firmware 5.1.0. It is necessary to update the printer firmware before using the binary G-code format.

Compatibility issues

Some external printer control programs like Octoprint might have an issue with the binary G-code. In this case, disable the binary G-code feature in PrusaSlicer.

 

6 comments

Log in  to post a comment
RobMcCoy
Edit: I found the option --binary-gcode.Thanks for the hard work and great software.Is bgcode supported by prusa-slicer-console.exe? I have a large library that needs periodic reslicing, so the console is crucial.
dcorbin13
When generating ASCII G-code, the Prusa slicer generates a lot of interesting and useful meta-data in the .gcode file.    Is this information available in the binary format?  Is there a page that documents the binary format?
Cedric Finance
rwhiffen
This should be updated to reflect the new location of this preference in the 2.7.1 version.  I thought I was going crazy because my UI didn't match this screen shot anymore after upgraded from 2.7.0 to 2.7.1
Radim Láska
tSliser mi exportuje do bcode, ale v MK4 se mi nezobrazí. Tikára vidí jen formát bcode. co stím, abych mohl tisknout?
David B.

Dobrý den, Radime. 

Zkuste updatovat firmware tiskárny na verzi 5.1.0 či vyšší.

Jet 5487
Worst update ever, i never update the firmware myself and i just wanted to teach my mom how to make gcodes. Theres no button to turn it off meaning she cant print until i update. Please fix quickly, in the meantime can i download an old slicer or something?
Sjaak Spaak
You can turn it off in the settings. Go to Configurations -> Preferences -> Other
FreckledLibrarian
Thank you! :)