Introduction
GOO is the sliced print file of Elegoo resin printers. A slicer writes it with everything the printer needs: two preview pictures, the exposure and movement settings, and one grey scale image for every layer, which the printer shows on its LCD screen. Elegoo publishes the layout as “Goo Format Spec” (version 1.2 of the document is described here).
It fills the same role as CTB and SL1 do for other resin printers.
Structure
A file is a header of 195,477 bytes, then the layers one after another, then an 11-byte ending string. Numbers are big-endian; the document does not say so, but the readers do. Short int is 2 bytes, int and float are 4 (IEEE single precision), and bool is 1 byte. Strings have a fixed length and are padded with zero bytes.
- Header195,477 bytes, previews included
- Layer 1settings, size, image
- Layer 2 …one per layer
- Ending string11 bytes
Header
Offsets are from the start of the file, in bytes. “Bottom” settings apply to the bottom layers, the first ones, which stick the print to the plate; “common” settings to the rest.
Identification
| Offset | Size | Type | Field |
|---|---|---|---|
| 0 | 4 | string | Format version, such as V3.0. |
| 4 | 8 | bytes | Magic tag, always 07 00 00 00 44 4C 50 00 (the last four bytes read DLP and a zero). |
| 12 | 32 | string | Software information. |
| 44 | 24 | string | Software version. |
| 68 | 24 | string | Time the file was created. |
| 92 | 32 | string | Printer name. |
| 124 | 32 | string | Printer type. |
| 156 | 32 | string | Resin profile name. |
| 188 | 2 | short | Anti-aliasing level set in the slicer. |
| 190 | 2 | short | Grey level. |
| 192 | 2 | short | Blur level. |
Preview images
| Offset | Size | Field |
|---|---|---|
| 194 | 26,912 | Small preview, 116 × 116 pixels. |
| 27106 | 2 | Delimiter 0D 0A. |
| 27108 | 168,200 | Large preview, 290 × 290 pixels. |
| 195308 | 2 | Delimiter 0D 0A. |
Each pixel is 16 bits, RGB 565: red in bits 15–11, green in bits 10–5 and blue in bits 4–0, stored high byte first, row by row.
Layers, screen and size
| Offset | Size | Type | Field |
|---|---|---|---|
| 195310 | 4 | int | Total number of layers. |
| 195314 | 2 | short | LCD resolution in X, pixels. |
| 195316 | 2 | short | LCD resolution in Y, pixels. |
| 195318 | 1 | bool | 1 if the slicer mirrored the images in X. |
| 195319 | 1 | bool | 1 if mirrored in Y. |
| 195320 | 4 | float | Active printing area in X, mm. |
| 195324 | 4 | float | Active printing area in Y, mm. |
| 195328 | 4 | float | Platform size in Z, mm. |
| 195332 | 4 | float | Layer thickness, mm. |
Exposure and waiting times
All times are floats in seconds.
| Offset | Size | Field |
|---|---|---|
| 195336 | 4 | Exposure time of common layers. |
| 195340 | 1 | Exposure delay mode (bool). 1: use the static waiting times; 0: use the turn-off time. |
| 195341 | 4 | Turn-off time: the delay before exposure in turn-off mode. |
| 195345 | 4 | Bottom layers: wait before lift. |
| 195349 | 4 | Bottom layers: wait after lift. |
| 195353 | 4 | Bottom layers: wait after retract. |
| 195357 | 4 | Common layers: wait before lift. |
| 195361 | 4 | Common layers: wait after lift. |
| 195365 | 4 | Common layers: wait after retract. |
| 195369 | 4 | Exposure time of bottom layers. |
| 195373 | 4 | Number of bottom layers (int, not a time). |
Lift and retract
All fields are floats. Distances are in mm and speeds in mm/min. The movement of the plate after an exposure can have two stages.
| Offset | Field |
|---|---|
| 195377 | Bottom lift distance. |
| 195381 | Bottom lift speed. |
| 195385 | Lift distance. |
| 195389 | Lift speed. |
| 195393 | Bottom retract distance. |
| 195397 | Bottom retract speed. |
| 195401 | Retract distance. |
| 195405 | Retract speed. |
| 195409 | Bottom second-stage lift distance. |
| 195413 | Bottom second-stage lift speed. |
| 195417 | Second-stage lift distance. |
| 195421 | Second-stage lift speed. |
| 195425 | Bottom second-stage retract distance. |
| 195429 | Bottom second-stage retract speed. |
| 195433 | Second-stage retract distance. |
| 195437 | Second-stage retract speed. |
Light, totals and layer offset
| Offset | Size | Type | Field |
|---|---|---|---|
| 195441 | 2 | short | Light power (PWM) for bottom layers, 0–255. |
| 195443 | 2 | short | Light power for common layers, 0–255. |
| 195445 | 1 | bool | Advance mode. 0: normal; 1: the printer uses the values in each layer’s definition. |
| 195446 | 4 | int | Printing time, seconds. |
| 195450 | 4 | float | Total volume of all parts, mm³. |
| 195454 | 4 | float | Total weight of all parts, g. |
| 195458 | 4 | float | Total price of the resin used. |
| 195462 | 8 | string | Price unit, such as $. |
| 195470 | 4 | int | Offset of the first layer. For this header it is 195,477 (0x2FB95); the document’s example, 0x2FAB7, does not match its own table. |
| 195474 | 1 | bool | Grey scale level. 0: pixel values run from 0x0 to 0xF; 1: from 0x00 to 0xFF. |
| 195475 | 2 | short | Number of transition layers. |
Layers
The first layer starts at the offset given in the header. Each layer is a 66-byte definition (ending in a delimiter), a data size, the encoded image and another delimiter, so a reader walks from one layer to the next using the data size.
| Offset in layer | Size | Type | Field |
|---|---|---|---|
| 0 | 2 | short | Pause flag. 0: reserved (no pause); 1: pause printing at this layer. |
| 2 | 4 | float | Height the Z axis lifts to during the pause, mm. |
| 6 | 4 | float | Height of this layer, mm. |
| 10 | 4 | float | Exposure time, s. |
| 14 | 4 | float | Off time, s, used when the exposure delay mode is 0. |
| 18 | 4 | float | Wait before lift, s, used when the mode is 1. |
| 22 | 4 | float | Wait after lift, s, mode 1. |
| 26 | 4 | float | Wait after retract, s, mode 1. |
| 30 | 4 | float | Lift distance, mm. |
| 34 | 4 | float | Lift speed, mm/min. |
| 38 | 4 | float | Second-stage lift distance, mm. |
| 42 | 4 | float | Second-stage lift speed, mm/min. |
| 46 | 4 | float | Retract distance, mm. |
| 50 | 4 | float | Retract speed, mm/min. |
| 54 | 4 | float | Second-stage retract distance, mm. |
| 58 | 4 | float | Second-stage retract speed, mm/min. |
| 62 | 2 | short | Light power for this layer, 0–255. |
| 64 | 2 | bytes | Delimiter 0D 0A. |
| 66 | 4 | int | Data size n: the length of the encoded image. |
| 70 | n | bytes | Encoded image: 55, chunks, one checksum byte. |
| 70 + n | 2 | bytes | Delimiter 0D 0A. |
Layer image encoding
The image is run-length encoded, one grey value per LCD pixel, row after row. It starts with
the byte 0x55 and ends with an 8-bit checksum. The checksum covers the bytes between
the two, not the 0x55: add them modulo 256 and invert all eight bits (the inversion
is what the readers do; the document only calls it an 8-bit checksum).
Between them are chunks. Bits 7–6 of a chunk’s first byte give its type.
| Bits 7–6 | Pixel value |
|---|---|
00 | 0x00 (black). |
01 | A grey value from 0x01 to 0xFE, in the byte that follows. |
10 | The previous pixel value plus or minus a small difference. |
11 | 0xFF (white). |
Run length of types 00, 01 and 11
Bits 5–4 say how many more bytes hold the run length. Bits 3–0 of the first byte are always
the lowest four bits of the length; the extra bytes hold the higher bits, most significant byte
first. In a type 01 chunk the grey value comes before the length bytes.
| Bits 5–4 | Extra bytes | Run length |
|---|---|---|
00 | none | low nibble (4 bits) |
01 | b1 | b1 × 16 + nibble (12 bits) |
10 | b1 b2 | b1 × 4096 + b2 × 16 + nibble (20 bits) |
11 | b1 b2 b3 | b1 × 220 + b2 × 4096 + b3 × 16 + nibble (28 bits) |
Difference chunks (type 10)
Bits 3–0 are the difference, 0 to 15. The result becomes the current value.
| Bits 5–4 | Value | Run length |
|---|---|---|
00 | previous + difference | 1 |
01 | previous + difference | in the next byte |
10 | previous − difference | 1 |
11 | previous − difference | in the next byte |
Readers take the value before the first chunk to be 0.
Examples
| Chunk bytes | Meaning |
|---|---|
05 | 5 black pixels. |
3F 55 56 57 | 0x555657F black pixels. |
75 AA BB CC 15 | 0xBBCC155 pixels of grey 0xAA. |
F1 CC BB AA | 0xCCBBAA1 white pixels. The document’s table adds a fourth byte and a longer number, which its rule does not allow. |
81 | One pixel, previous value + 1. |
92 FF | 255 pixels of previous value + 2. |
A1 | One pixel, previous value − 1. |
B2 EE | 238 pixels of previous value − 2. |
Ending string
After the last layer come 11 bytes: three zero bytes, then the same magic tag as in the header,
00 00 00 07 00 00 00 44 4C 50 00.
Recognising a file
Bytes 4 to 11 are 07 00 00 00 44 4C 50 00, after a four-character version such as
V3.0. The file ends with the 11-byte ending string.
Divergence in software
- UVtools writes version
V3.0and refuses other versions. It also uses this layout for.przfiles of the Phrozen Sonic Mini 8K S, and writes those without difference chunks. - UVtools writes the resin volume in millilitres into the total weight field.
- mslicer requires the layer offset to be exactly 195,477. It writes a difference chunk only after the first chunk of a layer.
- Neither reader changes how it decodes pixels according to the grey scale level byte.
In the explorer
The viewer shows both preview pictures, every header field and a table of all layers. Each layer opens with its settings, its whole image (averaged down to fit), the image at full resolution in tiles of 1024 × 1024 pixels, and every run-length chunk. Checksums of the first 1024 MB of image data are all worked out when the file is opened; later layers are checked as their table rows are shown. Layers are shown as stored, also when the header says the slicer mirrored them.
Not described
The layout is taken from Elegoo’s document, with byte order, checksum and starting value from the UVtools and mslicer sources.
Known, not yet covered
- Viewer: with grey scale level 0 the pixels are decoded as for level 1,
and a file with another version string is read with the
V3.0layout.
Unknown
- Reference: how pixels are encoded when the grey scale level byte is 0. The document gives the range 0x0–0xF but defines the chunks only in terms of 0x00 and 0xFF, and neither reader treats the case.
- Reference: the scales of the anti-aliasing, grey and blur level fields.
- Reference: which version strings other than
V3.0exist and how their layouts differ.
Links
Software
Developers
- goo_format – the GOO crate of mslicer, reading and writing (Rust)
- UVtools GooFile.cs – UVtools’ reader and writer (C#)
Reference
- elegooofficial/GOO – Elegoo’s repository with the Goo Format Spec V1.2 (PDF)