Guide
Convert an image to ZPL
A thermal printer prints one thing: a black dot, or nothing. Getting a logo onto a label
means turning your image into a grid of those dots and encoding it as a
^GFA graphic field. Here is what happens in between, and how to keep the
result readable.
What the conversion actually does
Three stages, none of them reversible: rasterise to the dot size you want, decide black-or-white for every dot, then pack those bits into hexadecimal.
Rasterise
The image is drawn at the exact pixel size it will occupy on the label — if the logo is 30 mm wide on a 203 dpi printer, that is 240 dots. Scaling happens here, once, rather than on the printer, which has no scaler for graphic fields.
Threshold
Each pixel’s brightness is measured (weighted for how the eye sees red, green and blue), transparent areas are treated as white, and anything darker than your threshold becomes a printed dot. MakeZPL gives you the threshold as a slider plus an invert switch, because the right cut-off is a judgement about your artwork, not a constant. There is no dithering: a dot is on or off, which keeps edges crisp and prevents the grey mush that halftoning produces at 203 dpi.
Pack
Bits are packed eight to a byte, left to right, and each byte written as two uppercase
hex characters. The ^GFA parameters are the total byte count, the same count
again, and the bytes per row:
^FO30,30^GFA,4064,4064,8,3C7EE7C3C3E77E3C...^FS
How large the ZPL gets
^GFA is inline hex, so the file grows with the area of the image.
Doubling the width of a logo quadruples the data.
| Image, in dots | Bytes per row | Total bytes | Hex in the file |
|---|---|---|---|
| 200 × 100 | 25 | 2,500 | 5,000 chars |
| 400 × 200 | 50 | 10,000 | 20,000 chars |
| 600 × 300 | 75 | 22,500 | 45,000 chars |
| 812 × 406 | 102 | 41,412 | 82,824 chars |
| 1200 × 600 | 150 | 90,000 | 180,000 chars |
A full-width image on a 4 inch label is bigger than everything else on that label put together. If you print thousands of labels over a slow link, that is real time. Crop the artwork to its ink, print the logo at the size it is actually needed, and consider having your printer administrator store it in printer memory instead.
Getting a logo that survives 203 dpi
Start from vector or high-contrast art
A one-colour SVG or a clean PNG of the logo beats a screenshot of it every time. Grey gradients, drop shadows and anti-aliased edges all become noise once thresholded.
Set the size before the threshold
Rescaling after thresholding re-samples dots that are already binary and turns clean edges ragged. Choose the printed size first, then tune the cut-off at that size.
Respect the minimum stroke
At 203 dpi one dot is 0.125 mm. A hairline that is half a dot wide either disappears or doubles. Anything thinner than two dots is a gamble; three is safe.
Try the invert switch
White artwork intended for a dark background needs inverting before it means anything on white label stock. It is one toggle, and it is the fix for a logo that arrives as a black rectangle.
Image to ZPL FAQ
Formats, quality, printer memory and file size.
What image formats can I use?
Anything your browser can decode — PNG, JPEG, GIF, WebP, BMP. MakeZPL rasterises it and converts the result, so the source format makes no difference to the output.
Why does my logo look blotchy on the label?
A thermal printer has exactly two colours. Any photograph or soft gradient has to be forced to pure black or pure white, and mid-greys land wherever the threshold falls. Line art, solid shapes and bold type survive the trip; photos rarely do.
Can I store the logo on the printer instead?
Yes — Zebra printers can hold a graphic in memory (~DG) and recall it by name, which keeps each label file small. MakeZPL does not generate those commands; it embeds the image in every label with ^GFA. For a high-volume format, hand the ^GFA data to your printer administrator to store once.
How big is too big?
Watch the byte count, not the pixel count. A full-width 812 x 406 dot image is over 80,000 characters of hex — more than most labels' entire text content, and enough to slow a serial or USB connection noticeably. Keep logos to the size they will actually print at.