@dhruvhkumar19/imagizer
v0.1.0
Published
Render dense text into PNG pages for vision-capable coding agents.
Readme
IMAGIZER
IMAGIZER renders text into deterministic, high-contrast PNG pages for vision-capable coding agents. It is CLI-agnostic: output is simply page-*.png plus manifest.json.
Install
npm install
npm linkRequires Node.js 20+.
Render
imagizer render ./context.txt --out .imagizer/context
imagizer render - --out .imagizer/context --title "tool output" < output.txtOptions: --width, --height, --font-size, --line-height, and --title.
Each output directory contains lossless PNG pages and a manifest with the source byte count, SHA-256 digest, and render profile.
Use with coding CLIs
Attach the generated PNGs using your tool's normal image/file option. Keep the prompt short and tell the agent what the pages contain.
Claude Code
Attach page-*.png through Claude Code's image/file attachment workflow, alongside a prompt such as: Read the attached rendered context and implement the requested change.
OpenCode
OpenCode accepts file attachments in non-interactive mode:
opencode run --file .imagizer/context/page-001.png "Use this rendered context."Repeat --file for each page. Verify the selected provider/model accepts image input.
Codex CLI
Codex CLI accepts initial image attachments:
codex --image .imagizer/context/page-001.png "Use this rendered context."Repeat --image for more pages.
Other CLIs
Use any image or file attachment flag supplied by the CLI. If a tool only accepts text, IMAGIZER cannot reduce its text input directly; use that tool's multimodal API or a compatible provider.
Safety and quality
Image rendering is lossy. Keep exact values such as secrets, tokens, hashes, IDs, URLs, line-sensitive patches, and the current task as native text. Image only dense, older, low-risk context. Test your target model with realistic inputs before enabling automatic conversion.
PNG is the default because code and monospaced text remain sharp. JPEG and WebP are not recommended for dense code.
API
import { renderTextToImages } from "imagizer";
const { pages, manifest } = await renderTextToImages("large context", { width: 1536, height: 864 });
await writeFile("page-001.png", pages[0].png);Development
npm test