# 开源工具 pxpipe 将文本隐藏到 PNG 中，削减 Claude Code 和 Fable 5 的 token 成本高达 70%

- 来源：The Decoder：AI News（RSS）
- 作者：Matthias Bastian
- 发布时间：2026-07-05 02:11
- AIHOT 分数：67
- AIHOT 链接：https://aihot.virxact.com/items/cmr6ot689000aslya4rykm1zr
- 原文链接：https://the-decoder.com/open-source-tool-pxpipe-hides-text-in-pngs-to-cut-claude-code-and-fable-5-token-costs-up-to-70

## AI 摘要

开源工具 pxpipe 利用 Anthropic 的图像定价策略，将长文本（如提示、文档、历史对话）渲染为紧凑 PNG，以降低 token 消耗。文本约 1 token/字符，图像按像素固定计费，每图像 token 约容纳 3.1 字符。pxpipe 作为本地代理拦截 Claude Code 请求，将静态内容转为图像，近期消息和输出仍为文本。开发者称平均节省 59%–70% token 成本；Fable 5 演示中会话成本从 42.21 美元降至 6.06 美元。默认支持 Claude Fable 5 和 GPT 5.6，但 Opus 4.7、4.8 及 GPT 5.5 图像读取误读约 7%，需手动启用。代价是精确性损失和推理速度下降。

## 正文

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

Jul 4, 2026

Steven Chong

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.

pxpipe puts 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.

This is how the model sees the compressed text: a single PNG page replaces thousands of text tokens. | Image: Steven Chong

According to developer 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.

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 slower since 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 evaluations are 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.

Feeding text to AI models as compressed images isn't a new idea. Deepseek built an OCR system that 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.
