A ZPL image prints distorted, slanted or cut
A ^GF image prints slanted or garbled when its bytes per row don't match the image width, and cut short when the data is shorter than the declared total. Bytes per row is the width in dots divided by 8, rounded up; total bytes is bytes per row times the height.
2026-10-20 に更新されました · Renders made with the OpenZPL engine
Open in the viewerWhat you see
A logo or icon prints as diagonal stripes, leans to one side, repeats in bands, or stops halfway. The text around it is fine.
Bytes per row 7 for a 64 dot wide image

^XA ^FO60,40^GFA,512,512,7, 0000000000000000 0000003FFC000000 000003FFFFC00000 00000FFFFFF00000 00003FFFFFFC0000 0000FFFFFFFF0000 0003FFFFFFFFC000 0007FFFFFFFFE000 000FFFFFFFFFF000 001FFFE007FFF800 003FFF0000FFFC00 007FFC00003FFE00 00FFF000000FFF00 01FFC0000003FF80 03FF80000001FFC0 03FF003FFC00FFC0 07FE003FFC007FE0 07FC003FFC003FE0 0FF8003FFC001FF0 : 1FF0003FFC000FF8 : 3FE0003FFC0007FC : 3FC0003FFC0003FC : 7FC1FFFFFFFF83FE 7F81FFFFFFFF81FE : : : : : : : : : 7FC1FFFFFFFF83FE 3FC0003FFC0003FC : 3FE0003FFC0007FC : 1FF0003FFC000FF8 : 0FF8003FFC001FF0 : 07FC003FFC003FE0 07FE003FFC007FE0 03FF003FFC00FFC0 03FF80000001FFC0 01FFC0000003FF80 00FFF000000FFF00 007FFC00003FFE00 003FFF0000FFFC00 001FFFE007FFF800 000FFFFFFFFFF000 0007FFFFFFFFE000 0003FFFFFFFFC000 0000FFFFFFFF0000 00003FFFFFFC0000 00000FFFFFF00000 000003FFFFC00000 0000003FFC000000 0000000000000000 ^FS ^FO160,60^A0N,40,40^FDFRAGILE^FS ^XZ
Bytes per row 8

^XA ^FO60,40^GFA,512,512,8, 0000000000000000 0000003FFC000000 000003FFFFC00000 00000FFFFFF00000 00003FFFFFFC0000 0000FFFFFFFF0000 0003FFFFFFFFC000 0007FFFFFFFFE000 000FFFFFFFFFF000 001FFFE007FFF800 003FFF0000FFFC00 007FFC00003FFE00 00FFF000000FFF00 01FFC0000003FF80 03FF80000001FFC0 03FF003FFC00FFC0 07FE003FFC007FE0 07FC003FFC003FE0 0FF8003FFC001FF0 : 1FF0003FFC000FF8 : 3FE0003FFC0007FC : 3FC0003FFC0003FC : 7FC1FFFFFFFF83FE 7F81FFFFFFFF81FE : : : : : : : : : 7FC1FFFFFFFF83FE 3FC0003FFC0003FC : 3FE0003FFC0007FC : 1FF0003FFC000FF8 : 0FF8003FFC001FF0 : 07FC003FFC003FE0 07FE003FFC007FE0 03FF003FFC00FFC0 03FF80000001FFC0 01FFC0000003FF80 00FFF000000FFF00 007FFC00003FFE00 003FFF0000FFFC00 001FFFE007FFF800 000FFFFFFFFFF000 0007FFFFFFFFE000 0003FFFFFFFFC000 0000FFFFFFFF0000 00003FFFFFFC0000 00000FFFFFF00000 000003FFFFC00000 0000003FFC000000 0000000000000000 ^FS ^FO160,60^A0N,40,40^FDFRAGILE^FS ^XZ
Why it happens
^GF sends an image as rows of bits, one bit per dot. It has four numbers: compression type, total bytes, total bytes again (the field count) and bytes per row. The printer splits the data into rows using bytes per row. If that number is wrong by one, every row starts one byte early or late, and the error builds up line by line: the image shears into diagonal stripes.
| Image | 幅 | Bytes per row | 高さ | Total bytes |
|---|---|---|---|---|
| Icon above | 64 dots | 8 | 64 | 512 |
| Logo | 300 dots | 38 (300 / 8 = 37.5, rounded up) | 120 | 4,560 |
| Full 4 inch width at 203 dpi | 812 dots | 102 | 200 | 20,400 |
The other common faults:
- Data shorter than the total. The image stops where the data ends: you see the top part only. Usually the hex was truncated when it was pasted into a template or a database field with a length limit.
- Width not a multiple of 8. The last byte of each row is padded with zero bits. A converter that doesn't pad makes the rows one byte short, which shears the image.
- Inverted colours. A 1 bit is black. A converter that writes 1 for white prints a negative.
The fix
Recompute the numbers from the image: bytes per row = ceil(width / 8), total = bytes per row × height. For the 64 × 64 icon:
^FO60,40^GFA,512,512,8,<hex data, 1,024 hex digits>^FS
The easiest way to get them right is to let a tool produce the whole ^GF command. The ZPL viewer has an Add image button that converts a PNG or JPG into a ^GF field, and the guide on images in ZPL explains the format and its compressed variants (: to repeat a row, Z64 for zlib).
Renderer or printer?
Byte counts are interpreted the same way by the engine and the printer, so a distorted preview means distorted ZPL. If the preview is right and the printed image is not, look at printer memory (very large images can fail to load), darkness (fine dithering fills in), or a ~DG image stored on the printer under the same name with older content.
質問
What does the A in ^GFA mean?
The data format: A is ASCII hex (two characters per byte), B is raw binary and C is compressed binary. ASCII hex is the one that survives copy and paste.
Why is my image the right shape but too small?
^GF images are in printer dots, so a 300 dot wide image is 1.5 inches at 203 dpi and 1 inch at 300 dpi. Resize the source image for the printer's density before converting it.