--- title: Zpl Generator emoji: 🔥 colorFrom: blue colorTo: blue sdk: gradio sdk_version: 5.49.1 app_file: app.py pinned: false license: mit --- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference # Image → ZPL (^GFA) Converter — Hugging Face Space This is a simple Gradio app that converts an uploaded image into **Zebra Programming Language** ZPL using the **^GFA (ASCII Hex)** graphics command. ## Features - Scale image to label width by (inches × DPI) - Dithering or manual threshold to 1‑bit - Optional invert - Preview the converted bitmap - Generate complete ZPL with `^XA/^XZ`, `^PW`, `^LL`, `^FO`, and `^GFA` - Download a ready‑to‑print `.zpl` file ## Run locally ```bash pip install -r requirements.txt python app.py # open the printed local URL ``` ## Deploy to Hugging Face Spaces 1. Create a new **Space** (SDK: **Gradio**, Python). 2. Upload these files: - `app.py` - `requirements.txt` - `README.md` (optional) 3. The app should build and run automatically. ## Notes - `^GFA,m,n,o,data` (ASCII Hex): where `m` is total bytes of data, `n` is bytes per row, `o` is rows (height). - The app pads the bitmap width to a multiple of 8 pixels (ZPL packs 8 dots per byte). - For a 4×6" label at 203 dpi, the max width is ≈ **812** dots. If you need Z64 compression or `~DG/^XG` storage, open an issue/PR and we can extend it.