Render text as PNG to save LLM tokens

Paste markdown (or any text). You get a packed black-on-white PNG back — 5×8 cells, original newlines marked with ↵ so they do not leave empty rows. Vision models bill by image tiles, not by the tokenizer, so a page of tool output or a system prompt often costs fewer tokens than the same bytes as text. The canvas shrinks to the glyphs; the big cuts show up on long, dense blocks.

I wrote a take on why this is clever and dumb at the same time.

The proxy that popularised this is pxpipe. This page is just the renderer, so you can try the trick without installing one.

Preview

The PNG will show up here.

Limits: 28080 characters, 1568×728 px max, 15 / 10 min per IP. Nothing is stored.

The honest part

This is a pricing hack, not a better medium. The model reconstructs intent from a bitmap. Short instructions are usually fine. Nested API schemas, 12-character hex IDs, and anything you need byte-exact should stay text. Anthropic can close the loophole. The page is packed the same way as pxpipe's Claude profile: 5×8 Spleen cells, 312 columns, original newlines marked with ↵ so they do not leave empty rows. pxpipe is still the proxy — this page is only the renderer.

API

POST markdown or JSON. The response is the PNG, with token estimates in the headers.

curl -sS -X POST https://ninokroesen.com/api/render-text-as-png \
  -H 'Content-Type: text/markdown' \
  --data-binary @notes.md \
  -o notes.png \
  -D -

JSON body

curl -sS -X POST https://ninokroesen.com/api/render-text-as-png \
  -H 'Content-Type: application/json' \
  -d '{"text":"# hello"}' \
  -o hello.png

FAQ

Does this actually save tokens?

Only on dense blocks. Vision models bill per image tile, so a page of tool output or a long system prompt often costs fewer tokens than the same bytes as text. A short paragraph costs more, because a single tile has a floor price. The page reports both estimates for whatever you paste, so you can see it before you use it.

Can I use it as an API?

Yes: POST markdown or JSON to /api/render-text-as-png and the PNG comes back, with token estimates in the headers. The limit is 28080 characters, canvas up to 1568×728 px, 15 / 10 min per IP.

Why does the PNG look like a terminal?

It is a 5×8 bitmap font (Spleen) drawn cell by cell. Dense glyphs mean fewer image tiles, and fewer tiles are exactly where the trick pays off.

Is the text in the PNG still exact?

No. The model reads a bitmap and reconstructs what it thinks it says. Nested schemas, hex IDs, and anything that has to be byte-exact should stay text — that is why the caveat above is there.

More from the lab

All experiments