Printing
Graphics in ZPL – GRF Images (^GF)
Photos, logos and rendered text become monochrome bitmaps in ZPL with the ^GF command. zplCloud does this automatically image → GRF, SVG → GRF, HTML/P…
Photos, logos and rendered text become monochrome bitmaps in ZPL with the ^GF command. zplCloud does this automatically (image → GRF, SVG → GRF, HTML/PDF → GRF).
Structure of ^GF
^GFa,b,c,d,data^FS
| Parameter | Meaning |
|---|---|
| a | Compression: A = ASCII hex, B = binary, C = compressed (RLE) |
| b | Total bytes of the graphic (uncompressed) |
| c | Bytes per row (uncompressed) |
| d | Bytes per row of the actual data (with compression) |
| data | The pixel data |
Example (a 4×4 black square, ASCII hex):
^XA
^FO50,50^GFA,8,8,2,FFFFFFFF^FS
^XZ
Converting an image to GRF
1. Scale the image to the label resolution: widthPx = mm × DPI / 25.4.
2. Convert to monochrome (threshold or dithering – zplCloud uses Floyd–Steinberg for photos).
3. Pack rows: 1 bit per pixel, MSB first, pad each row to a byte boundary.
4. Encode with the C (compressed) variant to keep the ZPL small – typically 1:4 for barcodes, 1:2 for photos.
Tips
- Keep GRF small: every dot costs bytes. A 600-dpi full-colour photo can exceed printer memory – use 203 dpi or crop.
- Zebra printers store GRF images in flash (
~DYE:LOGO.GRF) – upload once and reference by name instead of re-sending^GFon every label. - The Zebra-Images tab in zplCloud manages stored GRF images on the printer.