A Canadian developer may have found a way to cut costs of Claude Code bills by submitting contextual text as images, rather than as text. 

Steven Chong, a Toronto-based software developer, created an application called pxpipe, that flags dense context text, renders it as PNG images, and inserts it back into the user’s request. That part is not exciting. What is notable is that Claude Code will charge users only a fraction of the tokens to ingest the image through OCR, compared to ingesting that context in its original text form.

The work is timely. With Anthropic charging twice-per-token for Fable as it did for its predecessor Opus, many users will start scrutinizing their monthly bills, if they haven’t already.

Pictures Worth a Thousand Words

Chong estimates that packing information-dense text (code, JSON, tool output) into an image can cut token usage (and resulting bills) by up to 70%. Through visual recognition, an LLM can encode ~3.1 characters per token, versus the ~1 character per text-token rate of a typical ingestion.

On GitHub, Chong posted an example image with about 48,000 characters, mostly consisting of system prompts and tool documentation. It would have cost about 25,000 tokens if submitted through the terminal. But the data cost only 2,700 tokens when taken as an image. 

Nothing else changes in the process. Responses from the LLM are still streamed as text. The output operates as normally, with no modifications.

Chong offers some caveats to OCR-based input. Most notably, it is lossy. So it shouldn’t be used where the job requires rigorous accuracy of the source material. The LLM, after all, can misinterpret individual characters when converting images to text. Text that must be correct at the byte level  (IDs, hashes, secrets) should probably be submitted as text. 

Another issue is that it adds latency to the job on the user’s side, as the image must be converted to text. 

Chong did not comment on if this technique works on other models.

Bug or Feature?

The success of this billing hack has been debated on Hacker News and elsewhere, where readers wondered if it was a billing fluke or an inherently more cost-effective way to process context. 

Most LLMs already have built-in tools to process data from external formats, such as images or PDFs. Perhaps Anthropic hasn’t fully integrated these processes into the billing yet, some argued. Certainly, it will be only a matter of time before they notice the discrepancy and fill in the loophole. 

Anthropic did not immediately respond to inquiries about this story.

Others dug more deeply into the mechanics of LLMs, suggesting that optical recognition is actually more efficient, due to how LLMs encode text. 

Due to their high-dimensional embedding spaces, LLMs can use thousands of bytes to encode characters. And many of these characters are filler words (“and”). They carry little information useful to an LLM.  

Worth noting that engineers at DeepSeek have made a similar argument in at least one research paper, “DeepSeek-OCR: Contexts Optical Compression,” in which optical recognition actually performs a type of data compression. Visual context compression is semantically richer than text compression. 

When an LLM processes an image it renders it into a grid, with each patch summarized into a vector, much like a text is vectorized. But an image-based vectorization can carry up to 10 times the information as a text vectorization. 

“Through DeepSeek OCR, we demonstrate that vision-text compression can achieve significant token reduction,” the DeepSeek researchers concluded. And this token reduction can directly result in less power usage.

Chong’s pxpipe is a temporary hack, but it could also be a reminder for the frontier labs to work on the efficiency of their models.