Introduction
CTB is the print job format written by Chitubox, the slicer for resin printers made by CBD-Tech, whose control boards are used in many low-cost resin printers from makers such as Elegoo, Anycubic and others. Like other resin formats it holds one image per layer, to be shown on the printer’s screen, with the exposure and movement settings for each layer.
The format is proprietary. Recent versions encrypt parts of the file, and third-party tools that read it rely on work done by studying the files.
Structure
A CTB file is binary. It starts with a header giving the format version, the printer and print settings, and the positions of the other parts of the file. Two preview images follow, then a table of layers, each with its height, exposure time and the position of its image. Layer images are compressed with run-length encoding, which suits pictures that are mostly solid black and white.
The same layout, with a different first four bytes, is used by the older
.cbddlp and .photon files. A second, encrypted layout for
newer printers keeps the .ctb extension.
In this reference
- Header and tables – magic numbers and versions 1 to 5, the header, previews, print parameters, slicer info, version 4 and 5 blocks and the layer table with its extended records
- Image encoding – the CTB 7-bit run-length layers, the layer XOR encryption, CBDDLP bit planes and the 16-bit colour previews, with worked bytes
- Encrypted CTB – the newer layout: file header, encrypted settings, layer pointers, 88-byte layer records and the signature
Not described
Chitubox has never published these formats. The pages follow UVtools’ reverse-engineered code.
Known, not yet covered
- Reference: the AES key and initialisation vector of encrypted files: CBD-Tech does not publish them, they appear in UVtools’ source, and the encrypted page deliberately does not reproduce them.
- Viewer: none yet; the site shows the hex viewer only.