Urgent.News

What's breaking now, across thousands of outlets.

AI

Sending text as images cut my Claude tokens by up to 81%. It also started inventing numbers.

There is a trick going around for cutting Claude Code bills: render bulky context (system prompt, tool docs, logs, old history) as dense PNG images instead of text. An image is billed by its pixel size, not by how much text is inside it, so a page packed with small characters can cost far fewer tokens than the same text. The open-source proxy pxpipe does exactly this and reports a 59-70% lower…

A technique is circulating that could save you up to 81% on Claude Code charges by converting lengthy text into compressed PNG images, rather than sending the text itself. Rendering bulky context like system prompts, tool documentation, logs, and past conversation history as dense images costs fewer tokens due to the image's pixel size, not its text content. The open-source tool pxpipe implements this, reporting a 59-70% reduction in costs.

To verify these savings and assess the model's ability to retrieve information, a test was conducted using six documents containing English, Korean, and Japanese text, a JavaScript file, a generated JSON API response, and a 230-line server log. These documents included five specific lines to plant in the text, such as "ticket T123 uses build hash 3f9a1c7e02bd" and a timeout of 19043 milliseconds. The same documents were sent as plain text, through pxpipe's image output, and as images alone.

Claude models 5.5, 5.1, Sonnet 5.5, and Fable 5.1 were evaluated through 144 calls, using the exact-match scoring method. Token savings were consistent across languages, with English prose saving 64% and Korean prose saving 77%. Code snippets saved 75%, JSON data 76%, and server logs 78%.

The results revealed several key insights. First, the savings varied by language, with Korean and Japanese gaining the most. Second, exact values were crucial; the model's ability to retrieve correct information depended on the language and the type of data. Third, while ids and hashes were retrieved correctly, planted numbers often led to incorrect answers, even though the models returned plausible but wrong values.

Based on these findings, it is recommended to use image context for understanding rather than copying. Long, non-English texts, design documents, and old conversation histories are suitable for image conversion. However, ids, hashes, prices, line numbers, and code that needs editing should remain in text form. A new feature, a Text → image button, has been added to the free token counter at tokensave.app, allowing users to visualize token savings before uploading the text.

Limitations of this test include the limited number of runs per cell and the single set of six documents used. The exact recall was measured, but not the gist or arithmetic understanding of the models. Pxpipe's own tests indicate good performance on gist and arithmetic questions, which were not replicated here. The savings also depend on the user's session, as pxpipe images older history and system prompts while keeping recent turns as text.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in AI

More from Wednesday 21 October →