Fast ZPL & EPL label parser and renderer.
2.7K
Turn ZPL/EPL into pixels — label rendering, simplified.
Labelize is a fast, open-source Rust engine that parses ZPL (Zebra Programming Language) and EPL (Eltron Programming Language) label data and renders it to PNG or PDF. Use it as a CLI tool, an HTTP microservice, or embed it as a Rust library — no printer hardware required.
If you need a self-hosted, offline alternative to Labelary for previewing and converting thermal label formats, Labelize has you covered.
Existing solutions either depend on external services (Labelary API — data privacy concerns), require paid licenses (often hundreds of dollars), or produce poor rendering quality. Labelize gives you a fast, free, open-source option that runs entirely on your own infrastructure.
| Labelize | Labelary (web) | Zebra Printer | |
|---|---|---|---|
| Offline / self-hosted | ✅ | ❌ | ✅ |
| No hardware needed | ✅ | ✅ | ❌ |
| Open source | ✅ | ❌ | ❌ |
| EPL support | ✅ | ❌ | ✅ |
| PDF output | ✅ | ❌ | ❌ |
| Embeddable library | ✅ | ❌ | ❌ |
| REST API | ✅ | ✅ | ❌ |
| Cost | Free | Free / paid | Hardware cost |
Benchmarked against the Labelary API on the same set of labels:
| Metric | Labelize | Labelary API |
|---|---|---|
| Avg render time | ~5 ms | ~388 ms |
| Offline | ✅ | ❌ |
| Data privacy | Full control | Third-party |
Content-Type header; deploy anywhere with Docker or bare metalGET / — paste or open a .zpl/.epl file, choose a label size (4×6, 4×4, etc.), render PNG inline, and download PNG or PDF with one click# Via Homebrew (macOS / Linux)
brew tap GOODBOY008/homebrew-labelize && brew install labelize
# From source (requires Rust toolchain)
cargo install --path . --features cli
# Windows — download from GitHub Releases:
# 1. Go to https://github.com/GOODBOY008/labelize/releases
# 2. Download labelize-x86_64-pc-windows-msvc.zip
# 3. Extract the .exe and add it to your PATH
# Windows — via cargo (requires Rust toolchain):
cargo install labelize --features cli
labelize convert label.zpl # → label.png (format auto-detected)
labelize convert label.epl # EPL works too
labelize convert label.zpl -t pdf # output as PDF
labelize convert label.zpl --width 100 --height 62 --dpmm 12 # custom dimensions
labelize serve --port 8080
Open http://localhost:8080/ in your browser to use the built-in interactive playground — paste ZPL/EPL, pick a label size, and render PNG instantly. Download PNG or PDF directly from the page.
# Convert via REST API
curl -X POST http://localhost:8080/convert \
-H "Content-Type: application/zpl" \
-d '^XA^FO50,50^A0N,40,40^FDHello World^FS^XZ' \
-o label.png
Pre-built multi-arch images (linux/amd64 + linux/arm64) are published on every
release:
# Docker Hub
docker run -p 8080:8080 goodboy008/labelize:latest
# GitHub Container Registry
docker run -p 8080:8080 ghcr.io/goodboy008/labelize:latest
Available tags: latest (newest stable release), 1.3.0 / 1.3 / 1 (pinned
versions), and edge (current main).
Or build and run it from source with Compose:
docker compose up -d --build
Usage: labelize <COMMAND>
Commands:
convert Convert a ZPL/EPL file to PNG or PDF
serve Start HTTP server for label conversion
Convert Options:
<INPUT> Input file path (.zpl or .epl)
-o, --output <PATH> Output file path (default: input stem + .png/.pdf)
-f, --format <FMT> Input format override: zpl | epl
-t, --type <TYPE> Output type: png | pdf [default: png]
--width <MM> Label width in mm [default: 102]
--height <MM> Label height in mm [default: 152]
--dpmm <N> Dots per mm [default: 8]
Serve Options:
--host <HOST> Bind address [default: 0.0.0.0]
-p, --port <PORT> Listen port [default: 8080]
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Interactive web playground (browser UI) |
/health | GET | Health check → {"status":"ok"} |
/convert | POST | Convert label data → PNG or PDF |
POST /convert query parameters:
| Parameter | Default | Description |
|---|---|---|
width | 102 | Label width in mm |
height | 152 | Label height in mm |
dpmm | 8 | Dots per mm |
output | png | Output format: png/pdf |
Set Content-Type: application/zpl or Content-Type: application/epl to select the parser.
use std::io::Cursor;
use labelize::{ZplParser, Renderer, DrawerOptions};
let zpl = b"^XA^FO50,50^A0N,40,40^FDHello^FS^XZ";
let mut parser = ZplParser::new();
let labels = parser.parse(zpl).unwrap();
let renderer = Renderer::new();
let mut buf = Cursor::new(Vec::new());
renderer.draw_label_as_png(&labels[0], &mut buf, DrawerOptions::default()).unwrap();
std::fs::write("output.png", buf.into_inner()).unwrap();
| Category | Commands |
|---|---|
| Text & Font | ^FO ^FT ^FD ^FS ^A ^CF ^FB ^FR ^FH ^FN ^FW ^FV |
| Barcodes | ^BC (Code 128) ^BE (EAN-13) ^B2 (Interleaved 2-of-5) ^B3 (Code 39) ^B7 (PDF417) ^BO (Aztec) ^BX (DataMatrix) ^BQ (QR Code) ^BD (MaxiCode) ^BY (defaults) |
| Graphics | ^GB (box) ^GC (circle) ^GD (diagonal) ^GF (graphic field) ^GS (symbol) ~DG (download graphic) ^IL ^XG |
| Label Control | ^XA ^XZ ^PW ^PO ^LH ^LR ^CI |
| Stored Formats | ^DF ^XF |
N (new label) · A (text) · B (barcode) · LO (line draw) · R (reference point) · P (print)
ZPL/EPL input
│
▼
┌─────────┐ ┌──────────┐ ┌─────────┐
│ Parser │ ──▶ │ Renderer │ ──▶ │ Encoder │
└─────────┘ └──────────┘ └─────────┘
│ │ │
LabelInfo RgbaImage PNG / PDF
Vec<LabelElement>Side-by-side comparison against Labelary reference renderer. Left = Labelary, Right = Labelize.
All diff images are in testdata/diffs/ — browse them to review any label.
| Label | Diff | Preview |
|---|---|---|
| amazon | 2.26% | ![]() |
| fedex | 5.77% | ![]() |
| ups | 5.74% | ![]() |
| dhlpaket | 2.17% | ![]() |
| usps | 4.05% | ![]() |
| swisspost | 1.49% | ![]() |
83 labels tested — 6 perfect · 27 good (<1%) · 39 minor (<5%) · 11 moderate (<15%) · 0 high
Full report:
testdata/diffs/diff_report.txt
cargo test # all tests
cargo test --test 'e2e_*' # golden-file E2E tests
cargo test --test 'unit_*' # unit tests
# E2E shell scripts (requires labelize on PATH)
PATH="$PATH:target/debug" bash e2e/http/test_http.sh # HTTP microservice tests
PATH="$PATH:target/debug" bash e2e/cli/test_cli.sh # CLI tests
82 golden-file E2E tests compare rendered output pixel-by-pixel against reference PNGs from the Labelary reference renderer.
cargo build --release
# Binary: target/release/labelize
Looking for a ZPL renderer, ZPL to PNG converter, ZPL to PDF, EPL parser, Zebra label preview, thermal label rendering, or Labelary alternative? Labelize covers all of these.
Contributions are welcome! Please open an issue or submit a pull request.
See LICENSE in the repository root.
Content type
Image
Digest
sha256:8005b2caf…
Size
36.1 MB
Last updated
5 days ago
docker pull goodboy008/labelize