Pack a large codebase into one image so Gemini reads it for a fraction of the usual token cost.
Install it as a GitHub Copilot CLI skill and ask an agent to analyze files using it.
Choose the right image density setting depending on whether you are targeting Gemini, Opus, or GPT.
Skip using it for short documents or tasks that need perfectly exact text.
| imdigitalashish/nyx | 00kaku/wp-rest-playground | aaddrick/ticketmill | |
|---|---|---|---|
| Stars | 5 | 5 | 5 |
| Language | JavaScript | JavaScript | JavaScript |
| Setup difficulty | moderate | hard | hard |
| Complexity | 3/5 | 3/5 | 4/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
Best results require a vision capable model such as Gemini 3.1 Pro, GPT gets no benefit.
Nyx is a tool for coding agents that turns large chunks of text into dense images, so that an AI model with vision can read the content while using far fewer input tokens than if it had read the same text directly. The project backs this claim with 29 measured experiments run against real commercial AI APIs, and it is honest that the trick does not work the same way on every model. The key discovery behind Nyx is that different AI providers bill for images in different ways. Google's Gemini charges a flat rate of about 1080 tokens for any image, whether it is small or very large, so packing more text into one bigger image costs almost nothing extra on Gemini. Anthropic's Claude and OpenAI's GPT models charge based roughly on the number of pixels in the image, so a small, tightly packed page suits them better, and GPT specifically does not benefit from this technique at all and should just read plain text. Because of this, Nyx adjusts the size and density of the image it generates depending on which provider you are using, packing a whole multi file codebase into a single image for Gemini rather than splitting it across several smaller ones. On Gemini, the README reports cutting input tokens by roughly 35 to 50 percent compared to a simpler single layout, and by 85 to 89 percent compared to sending raw text, while keeping accuracy the same or better on real code and reports. On Claude Opus the benefit is smaller but still usable. The tradeoff is that requests using images take about three times longer in wall clock time, so the README recommends this for cost sensitive or batch work rather than fast, interactive back and forth. It installs as a skill for the GitHub Copilot CLI by cloning the repository and running a copilot skill add command, after which you can ask an agent to use it when analyzing files, ideally with the Gemini 3.1 Pro model. The renderer can also run directly from the command line with a chosen provider option. The README lists clear limits: the technique is not worth it for short documents, it loses a small amount of exact text accuracy, and it should not be used where perfectly exact IDs must be preserved. It is released under the MIT license, and the image rendering piece is based on another MIT licensed library.
A tool that compresses large text into dense images so AI coding agents read it using far fewer tokens, tuned per AI provider's image pricing.
Mainly JavaScript. The stack also includes JavaScript, Node.js, GitHub Copilot CLI.
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Don't trust strangers blindly. Verify against the repo.