Images consume real tokens via provider-specific tiling rules, often 1000+ for a high-resolution image, so a text-only budget calculator under-reports prompt length and triggers silent overflow or truncation.
Imagine a suitcase that has a weight limit. You weigh all your clothes carefully and pack everything to the line. Then you remember you also packed a heavy book, but you never weighed it. The suitcase is now over the limit and the airline starts removing things at the gate, and you do not know which. Images in a prompt are like that book. They take up real space in the context window even though they are not text. If your budget only weighs text, you go over without realizing it, and the model silently drops content.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Multimodal context engineering breaks the moment you stop tracking image tokens. The context window is a single physical resource, and images consume it just as text does, with per-image costs that often exceed a long paragraph of text. A budget calculator that only counts text tokens silently under-reports the real prompt length and creates failure modes that range from visible API errors to invisible quality degradation. This deep dive walks through the provider-specific token math, the three failure modes, the right accounting architecture, and the operational controls that production teams ship in 2026.
The token math by provider
Image tokenization is provider-specific in 2026, and the numbers differ enough that you cannot guess across providers.
Anthropic's Claude Opus 4.7 computes image tokens as approximately (width * height) / 750, capped near 1600 tokens per image. A 1568x1568 image is the canonical near-max example at about 1600 tokens. A 512x512 image is about 350 tokens. The formula gives a clean rule of thumb: about a megapixel and a half hits the cap, anything smaller scales proportionally.
OpenAI's GPT-5.5 uses a tile-based formula. In detail-high mode, the cost is a baseline of 85 tokens plus 170 tokens per 512x512 tile that the image is divided into. A 2048x2048 image is approximately 16 tiles plus baseline, around 2800 tokens. In detail-low mode, the cost is a fixed 85 tokens regardless of resolution. The detail mode is selectable at the per-image level.
Google's Gemini 3.1 Pro uses approximately 258 tokens per image at typical resolutions, with adjustments at the extremes. The model handles high-resolution inputs by tiling internally but the token cost stays relatively flat for most practical sizes.
The variance matters in practice. The same image, sent at the same resolution, can cost dramatically different amounts across providers. A 2048x2048 image is 1600 tokens on Claude, 2800 on GPT-5.5 high-detail, and 258 on Gemini. Multi-provider products need per-provider calculators.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- Anthropic's vision documentation publishes the exact per-image token formula for Claude Opus 4.7
- OpenAI's vision documentation publishes the tile-based formula for GPT-5.5 with detail-high and detail-low modes
What an interviewer would ask next. Try answering before peeking at the approach.
QHow would you decide between downscaling an image and sending it at full resolution?
Run an eval at both resolutions for your task and compare quality. If quality is equivalent, downscale to save tokens. If quality degrades at lower resolution (often the case for OCR, chart-reading, fine-detail), keep full resolution and accept the token cost. The decision is workload-specific and should be made with data.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Building a token-budget calculator that only counts text tokens, then watching the model truncate or behave strangely after a high-resolution image is added to the prompt.
60 second bullets to scan on the way to the call.
State that images consume tokens computed by provider-specific formulas
Give an order of magnitude figure for image token cost (1k+ for high-res)
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.