pxpipe hides text in PNGs to cut token costs by up to 70%

The open-source tool pxpipe converts large text chunks in Claude Code requests into dense PNG images to save on token usage. The trick exploits Anthropic’s pricing: text costs roughly one token per character, while images cost a fixed amount based on pixel dimensions.
pxpipe runs as a local proxy. It intercepts requests and renders static content like system prompts, documentation, and chat history into images. For example, a 48,000-character prompt costs about 25,000 tokens as text, but only 2,700 tokens as a PNG.
Developer Steven Chong reports average savings of 59% to 70%. In a Fable 5 demo, session costs dropped from $42.21 to $6.06. The trade-off is that the method is lossy. Exact strings like hashes can be misread, and processing is slower due to the vision encoder.
Up next
Claude Code updates command set
Claude Code consolidated /code-review from five passes into one, cutting token usage by 25%. Also, /rewind now restores context even after a /clear, and /usage provides a granular breakdown of tokens by category. The new fallbackModel parameter also allows for three automatic model retries if the primary is overloaded.
Related stories
- rtk promised 60-90% fewer tokens. JetBrains measured 7.6% more spend
- ctx2img packs whole repos into image tiles, cutting token use 60-75%
- Claude Code 2.1.243 uses your contracted model rates
- CCLimitPing automates the 5-hour Claude Code window
- Claude Code cuts subagent update cost 99%, session use 5%
- Claude Code 2.1.318: login expiry warning, runner log change
Comments
No comments yet. Be the first.
Join the conversation
Sign in to leave a comment. It appears after moderation.

