AI觉醒星球
Awakening is here
Knowledge File / AI技能杠杆
2026-07-05 0 浏览 会员

开源工具pxpipe将文本隐藏在PNG中,以降低Claude Code和Fable 5的token成本高达70%

开源工具pxpipe通过将长文本输入转换为紧凑的PNG图像,利用Anthropic的图像定价机制,大幅降低token消耗,平均节省59-70%成本。

SOURCE / AI技能杠杆 MIN / 9 ACCESS / 会员 POST / 2026-07-05 02:11:33

原贴

查看原文
作者:Matthias Bastian 来源站点:the-decoder.com 原贴时间:

原文

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. Ad 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. Ad DEC_D_Incontent-1 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. Ad 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. 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.

中文翻译

开源工具pxpipe将Claude Code的长文本输入转换为紧凑的PNG以降低token成本。这个技巧之所以有效,是因为Anthropic对图像的定价方式。文本成本大约每字符一个token,但图像根据像素尺寸收费固定数量的token,无论其中包含多少文本。将代码或JSON等密集内容渲染为图像,每个图像token可以打包约3.1个字符。pxpipe以本地代理的形式实现这一功能。它拦截对Claude Code的请求,将系统提示、工具文档和较早的聊天记录等庞大静态部分渲染为图像。最近的消息和模型输出则作为普通文本传递。下图显示了模型实际看到的内容:大约48,000个字符的系统提示和工具文档被压缩到一个密集的PNG页面上。作为文本,这将花费约25,000个token。作为图像,大约2,700个。据开发者Steven Chong称,平均总节省59%至70%。在Fable 5的一个演示中,会话成本从42.21美元下降到6.06美元。如果这种略显奇特的技巧流行起来,AI公司可能会提高图像处理价格来应对。这种方法有缺点。它是有损的,像哈希这样的精确字符串从图像中读取时可能会乱码。处理速度也较慢,因为模型必须通过视觉编码器运行渲染后的图像,而不是直接读取文本。默认情况下,pxpipe支持Claude Fable 5和GPT 5.6。基准测试和评估记录在仓库中。Fable 5在数学问题基准测试中达到100%的准确率,使用模型无法记忆的新随机数。据Chong称,Opus 4.7和4.8误解了约7%的渲染图像,GPT 5.5在图像上下文方面表现也更差。这两个模型默认关闭,只能手动启用。将文本作为压缩图像输入AI模型并不是一个新想法。Deepseek构建了一个OCR系统,将文本文档处理为图像,根据其技术论文,压缩率可达十倍,同时保留97%的信息。订阅THE DECODER以获取无广告阅读、每周AI通讯、每年六期的独家“AI Radar”前沿报告、完整存档访问以及评论区的访问权限。

核心信息

开源工具pxpipe通过将长文本输入转换为紧凑的PNG图像,利用Anthropic的图像定价机制,大幅降低token消耗,平均节省59-70%成本。

  • 开源工具pxpipe通过将长文本输入转换为紧凑的PNG图像,利用Anthropic的图像定价机制,大幅降低token消耗,平均节省59-70%成本。
  • 原贴提到:The open-source tool pxpipe converts long text inputs for Claude Code in
  • 来源:the-decoder.com
试看内容

成为会员查看完整内容

你已经看到了这篇内容的前置整理,剩余深度部分仅对会员开放。

详细解读 信息差价值 参考来源
成为会员查看完整内容
上一篇 sqlite-utils 4.0rc2,主要由Claude Fable编写(花费约149.25美元) 下一篇 26000名学生研究显示AI隐藏学习成本需两年才显现