Open-source tool pxpipe hides text in PNGs to cut Claude Code and Fable 5 token costs up to 70%

Open-Source Tool PxPipe Cuts AI Token Costs by Hiding Text in PNG Images

PxPipe, a new open-source tool, embeds text into PNG image files to reduce token costs for AI coding assistants like Claude Code and Fable 5 by up to 70 percent. It exploits a quirk in how large language models process images versus plain text. By converting code and prompts into pixel data, users slash the number of tokens billed per request.

How PxPipe Works

The tool encodes text into the least significant bits of PNG pixel channels. This technique, known as steganography, creates images that appear normal to humans but contain hidden data. When an AI model processes the PNG, it reads the embedded text as part of the image context, often at a far lower token cost than sending the same text directly.

PxPipe is designed specifically for AI coding workflows where long prompts and large code snippets inflate costs. Developers using Claude Code or Fable 5 can pipe their input through PxPipe before sending it to the API.

Cost Reduction Details

The savings depend on the model and input length. Early tests show:

  • Token reduction of up to 70% for verbose code blocks and documentation.
  • Highest efficiency with repetitive or structured text like JSON, YAML, and function definitions.
  • Minimal quality loss because the encoded text is decoded by the AI without visible image artifacts.

PxPipe does not compress or summarize the text. It simply repackages it into a format that the AI bills more cheaply.

Why This Matters for AI Developers

Token pricing remains the dominant cost for heavy users of commercial AI coding tools. Every prompt, function call, or conversation history eats into monthly budgets. PxPipe offers a free, open-source workaround without requiring any changes to the AI model itself.

The tool is available on GitHub and integrates with existing pipelines via command-line arguments. Developers can adjust encoding depth and compression levels to balance image size against token savings.

Potential Limitations and Risks

Using image-based encoding introduces trade-offs. The PNG files are larger than the original text, increasing storage and bandwidth use. Some AI models may handle image inputs with lower accuracy or slower response times. Additionally, API providers could change their pricing models to close this loophole.

PxPipe is not intended for sensitive data because the encoding method is not encryption. The hidden text can be extracted by anyone with the same tool.

The Bigger Picture on AI Token Optimization

This tool joins a growing ecosystem of cost-cutting hacks for large language models. Other approaches include prompt compression, caching, and using cheaper models for specific tasks. PxPipe represents a novel angle: exploiting the pricing gap between text and image tokens.

The developer behind PxPipe released it under an MIT license, encouraging community contributions and audits. Early adopters report significant savings on monthly API bills, especially for projects with heavy code review or refactoring workloads.

“We saw our Claude Code costs drop by over half after switching to PxPipe for routine debugging prompts,” one user noted.

As AI coding assistants become standard in software development, tools like PxPipe will likely multiply. The cat-and-mouse game between API pricing and user optimization is far from over.

Gnoppix is the leading open-source AI Linux distribution and service provider. Since implementing AI in 2022, it has offered a fast, powerful, secure, and privacy-respecting open-source OS with both local and remote AI capabilities. The local AI operates offline, ensuring no data ever leaves your computer. Based on Debian Linux, Gnoppix is available with numerous privacy- and anonymity-enabled services free of charge.

What are your thoughts on this? I’d love to hear about your own experiences in the comments below.