Last week someone on Hacker News discovered that sending code as screenshots to Claude Fable costs 60% less than sending it as text. The post hit the front page, collected hundreds of comments, and split the AI community into two camps: people who thought it was a pricing loophole about to get patched, and people who thought it was the future of how we feed data to models.

The trick is dead simple. Take your code, render it as an image with syntax highlighting, send the image to a vision-capable LLM instead of the raw text. The model does OCR internally, reads the code from the pixels, and gives you the same output. But the token count drops dramatically because image tokens are compressed differently than text tokens.

This is not a new idea in the academic sense. A paper called CodeOCR, accepted at ISSTA 2026, explored exactly this approach. The researchers converted source code into rendered images and tested whether vision language models could handle code completion, code QA, clone detection, and summarization through optical input. Their finding: VLMs perform surprisingly well on code understanding when the code arrives as an image rather than a token stream. The approach is called "optical compression" because you are literally compressing text into a visual representation that the model processes more efficiently.

DeepSeek's OCR research went further, demonstrating that a single image token can represent roughly ten text tokens with near-100% accuracy in reconstruction. That is the theoretical foundation for why this works. Text tokens are discrete: each one maps to one entry in a 50,000-word vocabulary. Image tokens are continuous: each one is a floating-point vector that can encode far more information per token. The model sees more detail per image token than per text token, which means you can pack more content into the same context window for fewer billed tokens.

The PageWatch blog ran controlled experiments across multiple OpenAI models. With GPT-5, converting text to images reduced prompt tokens by over 40%. The output quality was comparable for summarization tasks. But there is a catch that the HN hype glosses over: completion tokens increased significantly for most models. Completion tokens cost more than prompt tokens on most APIs, so the net savings can evaporate depending on the task. Only GPT-5-chat showed savings on both sides of the equation.

The pxpipe project that sparked the HN discussion was specifically targeting Claude Fable, Anthropic's most expensive model. At Fable's pricing, even a partial reduction in input tokens translates to real money on large codebases. But the project's own readme acknowledges this is lossy compression. You cannot send a screenshot of code to an LLM and expect character-perfect recall of every variable name and indentation level. The model gets the gist, not the exact text. For tasks where approximate understanding is fine, like summarization or code review, this works. For tasks requiring exact reproduction, like code generation or refactoring, it falls apart.

The deeper question is whether this is a pricing anomaly or a genuine architectural insight. If Anthropic and OpenAI are charging the same rate for image tokens and text tokens, but image tokens carry more information, then the pricing is misaligned with compute costs. Several HN commenters pointed out that providers will likely reprice image tokens upward once they realize the mismatch. Others argued that visual embeddings genuinely use fewer compute resources per unit of information, so the pricing reflects reality and the savings are legitimate.

There is a BirdNet analogy worth considering. BirdNet, the best-performing bird call identifier, converts audio into a spectrogram, which is an image, then runs it through a CNN. Nobody sends raw audio waveforms to a neural network for classification. The spectrogram representation is more efficient because it preserves the information that matters for the task while discarding noise. Text-as-image could follow the same logic. Code has visual structure: indentation, syntax coloring, whitespace patterns. A vision model can parse all of that from an image in a way that token-level processing misses.

The practical upshot for developers right now: if you are burning through context windows on large code files and your task is read-only analysis, code review, or summarization, the image trick is worth testing. Render your code with a monospace font and syntax highlighting, resize to 768x768 or similar, send it as a high-detail image. You will likely see prompt token savings of 30-60%. Whether those savings survive after accounting for completion tokens depends entirely on your model and your task.

But do not bet your production pipeline on this. The pricing will change. The models will adapt. And the lossy nature of the compression means you are trading accuracy for cost in ways that are hard to predict across different codebases and languages.

The real takeaway is that we are still in the early innings of figuring out how models should consume information. Text tokens are a convention inherited from language modeling, not an optimal representation for every use case. As vision capabilities improve, expect more data to flow through image channels even when it started as text.

Sources