New tool cuts AI token costs by encoding text in PNGs

A new open-source tool is letting developers shrink their AI expenses by replacing text prompts with compact PNG images. pxpipe encodes long instructions into pixel data, exploiting how some AI models bill by image size rather than text tokens.
Developer Steven Chong reports that switching from plain text to PNGs cut his Claude Code and Fable 5 token costs by 59 to 70 percent. The approach hinges on Anthropic’s pricing model, which charges per pixel for images but not by the character in text prompts. By condensing verbose instructions into a single PNG, users can shrink their bills while keeping the same semantic content.
How pxpipe works under the hood
pxpipe takes a text file, renders it as a black-and-white PNG, and then decodes the image back to text when the AI service reads it. The conversion adds a small processing step but avoids the per-token surcharge that inflates bills for lengthy prompts. The trade-off is a slight drop in accuracy and a modest slowdown in inference time, factors that vary with the prompt’s length and complexity.
Who should—and shouldn’t—use it
Teams running large-scale automation or batch processing stand to benefit most, especially when sending multi-kilobyte instructions to models that price by tokens. On the other hand, latency-sensitive applications may find the extra encode-decode cycle disruptive. For now, the tool remains experimental, so users should test thoroughly before rolling it out in production environments.
Source: The Decoder. AI-assisted editorial synthesis — TechnoExpress.

