Kerfview

LightBurn file viewer · nothing uploaded

How a .lbrn2 file is built.

A developer's tour of LightBurn's project format, worked out from LightBurn's documentation and openly licensed sample files. It is not an official specification.

or drop a .lbrn2 or .lbrn anywhere on the page

Sample project

hive-coasters.lbrn2

Job sheet

The root

A project is UTF-8 XML with a <LightBurnProject> root. Its attributes include AppVersion (the LightBurn version that saved it), FormatVersion (1 for .lbrn2, 0 for the legacy .lbrn), MirrorX/MirrorY and sometimes DeviceName. Children include an optional <Thumbnail Source="…"> holding a base64 PNG preview, <VariableText>, <UIPrefs>, the cut settings, the shapes and <Notes>.

Cut settings

Each layer is a <CutSetting type="…"> (or <CutSetting_Img type="Image"> for image layers) whose children each carry a Value attribute: index, name, speed (mm/s), maxPower, minPower, numPasses, interval, priority, doOutput and many more. Types seen in real files are Cut (Line), Scan (Fill), Scan+Cut, Image and Tool. .lbrn2 omits values equal to the defaults, so a reader must supply them. Shapes refer to a layer by CutIndex; indexes 30 and 31 are tool layers T1 and T2.

Shapes and the XForm

Each <Shape Type="…"> has an <XForm> of six numbers, a b c d e f, mapping a local point to x' = a·x + c·y + e and y' = b·x + d·y + f. Units are millimetres and Y points up, so SVG output needs a flip. Groups nest their children inside <Children>, and the transforms compose.

  • Rect: W, H and corner radius Cr, centred on the origin.
  • Ellipse: radii Rx, Ry, centred on the origin.
  • Polygon: N sides with radii Rx, Ry; in sample files the first corner sits on the +X axis.
  • Text: Str, Font, height H and alignment, usually with a <BackupPath> holding its outline as a path. The backup path's XForm is relative to the text's parent, not to the text.
  • Bitmap: W, H and base64 Data (PNG in the samples we have seen). W and H are the picture's size at 96 dpi; the XForm scales it to its placed size. A File attribute may hold the original path on the designer's computer.

Paths: VertList and PrimList

<Shape Type="Path" CutIndex="0" VertID="3" PrimID="1">
  <XForm>1 0 0 1 0 0</XForm>
  <VertList>V0 0c0x1c1x1V10 0c0x15c0y5c1x1V10 10c0x1c1x10c1y5</VertList>
  <PrimList>L0 1B1 2L2 0</PrimList>
</Shape>

Each V starts a vertex with x and y. c0x/c0y is the handle leaving the vertex and c1x/c1y the handle arriving at it. A lone c0x1 or c1x1 with no matching y is a marker for "no handle", not a coordinate. In the PrimList, L a b is a line and B a b a cubic Bézier from vertex a (using its c0) to vertex b (using its c1). A primitive that doesn't start where the last one ended begins a new subpath. A PrimList of just LineClosed means straight lines through every vertex, back to the first.

Copies can omit their lists and refer to earlier ones: a shape with VertID="3" and no VertList uses the vertices stored under that ID, and the same goes for PrimID.

The legacy .lbrn format

.lbrn files share the structure but write every setting, and they are much larger. Our sample .lbrn files contain only rectangles and text, so path encoding in .lbrn is the least tested part of this reader.

Prior work

Open-source projects that read the format include lbrn2-to-svg and lbrnts, both MIT licensed. Kerfview's reader is its own code, checked against openly licensed sample files and against the previews LightBurn saves inside them.

Layers and settings

In the order LightBurn runs them. Untick a layer to hide it here and leave it out of exports.

Layers in this project with their cut settings
ShowLayerModeSpeedPowerPassesIntervalShapesPath lengthTime, est.

Grey italic values aren't saved in the file. A .lbrn2 leaves out values that match LightBurn's defaults, so the documented defaults are shown (100 mm/s, 20% power, 0.1 mm interval, one pass). Speeds are stored in mm/s; hover a speed for mm/min. Times assume the head always moves at full speed, so real jobs take longer; see how they're worked out.

Export

Only the layers that are switched on are exported. Files are made in your browser.

Free

SVG

For Inkscape, Illustrator, xTool Creative Space, the Glowforge app and LightBurn itself. Layers become groups in LightBurn's colours, at real size in millimetres.

Fill layers as

Unlock

DXF

For CAD, CNC routers, cutting services and older laser software. R12 DXF, one DXF layer per LightBurn layer, millimetres, true circles. Pictures can't go in a DXF, so they're left out.

Part of the £6 unlock, coming soon.

Free

Pictures

Images embedded in the project, and the preview LightBurn saved with it, can be saved as PNG files on their own.

See the pictures

Pictures in this file

Shown at their own size. The original file name is what the designer's computer called the picture.

Job sheet

One printed page for whoever runs the laser: the design, every layer's settings, sizes, and the time estimate with its assumptions. Choose Save as PDF in the print window for a file.

Printing the job sheet is part of the £6 unlock, coming soon. The preview is free to look at.

One-time unlock

DXF, batch conversion and job sheets

Viewing, inspecting and SVG export are free and stay free. The unlock adds the things that save a workshop time.

  • DXF export of any project, layer by layer.
  • Batch conversion: drop many .lbrn2 files, or a ZIP of them, and get one ZIP back with SVG and DXF for each, plus a CSV of every layer's settings.
  • Printable job sheets with settings, sizes and time estimates.
  • One payment, no account, no subscription. Your files still never leave your computer.

£6 once

Coming soon

It isn't on sale yet, so there's nothing to pay today. Everything free on this page works now.

How sure is each number?

Read straight from the file

Layer names, modes, speeds, powers, passes and intervals are exactly what the file says, apart from values shown in grey italics, which the file leaves out and LightBurn fills with its defaults. Shape counts are exact.

Measured from the shapes

Sizes and path lengths are measured from the geometry, with curves followed to within a few thousandths of a millimetre. Text without a saved outline has no exact shape, so it isn't measured, and you'll see a note when that happens.

Estimated, and labelled

Times assume the head always moves at the layer's speed. Lines take length × passes ÷ speed; fills sweep each row from the first edge to the last at the line interval; images scan their whole frame. Acceleration, overscan and travel aren't counted, so real jobs take longer, sometimes a lot longer.