Source-led article
pxpipe Tool Reduces Claude Code Token Costs by Hiding Text in PNGs

A new open-source tool, pxpipe, is enabling developers to significantly cut token costs when using large language models like Anthropic’s Claude Code and Fable 5. The tool achieves this by converting extensive text prompts into compact PNG images, leveraging a pricing loophole in how AI models process visual data versus text.
Developed by Steven Chong, pxpipe acts as a local proxy. It intercepts requests to Claude Code and renders bulky, static elements such as system prompts, tool documentation, and older chat histories as images. This method exploits the fact that Anthropic charges for images based on pixel dimensions, irrespective of the textual content they hold, unlike text which is billed approximately one token per character.
How pxpipe Works
The core innovation of pxpipe lies in its ability to densely pack text into images. By rendering content like code or JSON into a visual format, the tool can compress approximately 3.1 characters into every image token. This process allows for substantial savings, as demonstrated by Chong’s findings. For instance, around 48,000 characters of system prompt and tool documentation, which would typically cost about 25,000 tokens as text, are reduced to roughly 2,700 tokens when converted into a single, densely packed PNG image.
This approach translates to average cost reductions of 59 to 70 percent. In a specific Fable 5 demonstration, session costs plummeted from $42.21 to $6.06, showcasing the tool’s financial impact. The tool is designed to allow recent messages and model outputs to pass through as normal text, maintaining the real-time interaction quality.
Key facts
| Feature | Description |
|---|---|
| Tool Name | pxpipe |
| Function | Converts text prompts to PNGs for AI models |
| Primary Benefit | Reduces token costs for Claude Code and Fable 5 |
| Cost Savings | Averages 59-70%, with reported savings from $42.21 to $6.06 in one demo |
| Developer | Steven Chong |
Trade-offs and Limitations
While pxpipe offers significant cost advantages, it comes with certain trade-offs. The image conversion process is lossy, meaning exact strings like hashes can sometimes become garbled when the AI model reads them from the images. Additionally, processing speed is affected as the model must run the rendered images through a vision encoder, a slower process than reading text directly.
By default, pxpipe supports Claude Fable 5 and GPT 5.6. Benchmarks indicate that Fable 5 achieves 100 percent accuracy on math problems with fresh random numbers when using pxpipe. However, models like Opus 4.7 and 4.8 misread about 7 percent of the rendered images, and GPT 5.5 also shows reduced performance with image context, requiring manual activation for these models.
Implications for AI Cost Optimization
The emergence of tools like pxpipe highlights the ongoing efforts within the AI community to optimize the operational costs of large language models. If this method gains widespread adoption, it could prompt AI companies to re-evaluate their image processing pricing structures to close such loopholes.
The concept of feeding text to AI models as compressed images is not entirely new. Deepseek, for example, developed an OCR system that processes text documents as images, achieving up to a tenfold compression factor while retaining 97 percent of the information, according to its technical paper. This underscores a broader trend towards innovative data compression techniques to manage the resource-intensive nature of advanced AI applications.
Source: The Decoder (https://the-decoder.com/open-source-tool-pxpipe-hides-text-in-pngs-to-cut-claude-code-and-fable-5-token-costs-up-to-70/)