Open-source tool pxpipe hides text in PNGs to cut Claude Code and Fable 5 token costs up to 70%

Summary
The open-source tool pxpipe converts long text prompts for Claude Code into compact PNGs, exploiting the fact that Anthropic charges for images by pixel size, not text content.
Original Article
Captured source content or English translation, normalized into this reading format.
Ad
Open-source tool pxpipe hides text in PNGs to cut Claude Code and Fable 5 token costs up to 70%

Matthias Bastian[View the LinkedIn Profile of Matthias Bastian](https://www.linkedin.com/in/matthias-bastian-128b71b1/ "View the LinkedIn Profile of Matthias Bastian")
Jul 4, 2026

Steven Chong
Ask about this article…Search
Topics
The open-source tool pxpipe converts long text inputs for Claude Code into compact PNGs to cut token costs.
The trick works because of how Anthropic prices images. Text costs roughly one token per character, but images cost a fixed number of tokens based on their pixel dimensions, no matter how much text they contain. Render dense content like code or JSON as an image, and you can pack about 3.1 characters into every image token.
pxpipeputs this into practice as a local proxy. It intercepts requests to Claude Code and renders the bulky, static parts as images, including system prompts, tool documentation, and older chat history. Recent messages and model outputs pass through as normal text. The image below shows what the model actually sees: Around 48,000 characters of system prompt and tool documentation get squeezed onto a single densely packed PNG page. As text, that would cost about 25,000 tokens. As an image, it's roughly 2,700.
Ad
This is how the model sees the compressed text: a single PNG page replaces thousands of text tokens. \| Image: Steven Chong
According todeveloper Steven Chong, total savings average 59 to 70 percent. In one Fable 5 demo, session costs dropped from $42.21 to $6.06. If this somewhat exotic trick catches on, AI companies could respond by raising image processing prices.
Ad
The tradeoff is accuracy and speed
The approach has downsides. It's lossy and exact strings like hashes can come back garbled when read from images.Processing is also slowersince the model has to run the rendered images through a vision encoder instead of reading text directly.
By default, pxpipe supports Claude Fable 5 and GPT 5.6.Benchmarks and evaluationsare documented in the repository. Fable 5 hits 100 percent accuracy in benchmarks on math problems with fresh random numbers the model can't have memorized. According to Chong, Opus 4.7 and 4.8 misread about 7 percent of the rendered images, and GPT 5.5 also does worse with image context. Both models are off by default and can only be enabled manually.
Ad
Feeding text to AI models as compressed images isn't a new idea.Deepseek built an OCR systemthat processes text documents as images and, according to its technical paper, compresses them by up to a factor of ten while keeping 97 percent of the information.
Ad
AI News Without the Hype – Curated by Humans
Subscribe to THE DECODER for ad-free reading, a weekly AI newsletter, our exclusive "AI Radar" frontier report six times a year, full archive access, and access to our comment section.
Source:Github
BETA-TEST
×
Start new search
×\|
Send
wpDiscuz
Insert
BETA-TEST
×
Start new search
×\|
Send
wpDiscuz
Insert
׋›
Region
Europe
Heat Score
76
Category
Global Briefs
Language
en
