Token Cost Engineering · 6 / 13

Image Tokens: Pixels Pay Tax Too

Text BPE “merges characters”; image encoding “cuts pixels.” You think you're sending the original—models bill the resolution after scale-and-align. Inside sits the same tier-jump trap as the text 32k red line.

Pixel chunks32-alignmentResolution curseBudget tiers
How images become Tokens

Vision models cut images into fixed-size pixel blocks; each block maps to one Token. For Qwen VL, the core formula is:

Image Tokens = (h̄ × w̄) / token_pixels + 2
VariableMeaningNotes
h̄ / w̄Height & width after scalingForced to multiples of 32 (or 28)
token_pixelsPixels per TokenQwen3-VL is 32×32=1,024; QVQ / Qwen2.5-VL is 28×28=784
+2Fixed overheadVision start/end markers <vision_bos> and <vision_eos>

GPT-4o and Gemini use a tile mechanism: GPT-4o ~170 Tokens per 512×512 tile; Gemini 1.5 Pro ~258 Tokens per 768×768 tile. Analogy: text compression rate is set by vocabulary size; image compression rate is set by pixel-block size—32×32 saves more than 28×28.

How images become Tokens: cutting pixels and the core formula
Text BPE merges characters; image encoding cuts pixels. Bigger pixel blocks = higher compression = fewer Tokens. (Figure: from the author's internal share deck)
Interactive Demo · How many Tokens is your image worth?

Pick a common resolution, or drag width and height yourself. Watch the “twin trap” of 1000×1000 vs 1025×1025. Billing assumption: Qwen3-VL, token_pixels = 1,024, input 1 ¥/M (standard tier within 32k).

1000 px
1000 px
Size after align
Image Tokens
Cost per image
Images to fill 32k
The 32-pixel alignment tier-jump trap
The image is only 2.5% larger, but crossing 1024—a multiple of 32—jumps Token count by 6.5%: the same logic as text's 33k full-request billing. (Figure: from the author's internal share deck)
Resolution curse: diminishing marginal returns

Is a 4K image better than 1080p? Not necessarily—and usually not worth it.

ResolutionAfter scale (32-align)Token countRelative cost
512 × 512512 × 5122581x
1080p (1920×1080)1920 × 10882,0427.9x
2K (2560×1440)2560 × 14403,60214x
4K (3840×2160)3840 × 21768,16231.6x
8K (7680×4320)Hits scale cap~16,38463.5x

From 512 to 1080p, Tokens jump ~8× and recognition clearly improves; from 2K to 4K, Tokens roughly double again while accuracy gains may be invisible. You think you're paying for “sharper”—you're paying for “more pixel blocks”—and those extra blocks help the model less and less. Studies put VLM visual-Token redundancy as high as 85%.

Multi-image is riskier: 5 × 4K ≈ 40,000 Tokens kicks you from the standard tier into the expensive band—same pit as “RAG retrieves 5 docs and stitches to 33k.”
Strategy: match resolution to task tier
Task typeToken budgetTarget resolutionWhy
Coarse classification (cat vs dog)< 300512 × 512No detail needed
Scene understanding (what's happening)< 1,000~1000 × 1000Enough
OCR / chart analysis< 4,000~2000 × 2000Need to read text
High-precision detection (medical imaging)< 16,3844K+Enable vl_high_resolution_images as needed

Three moves on the ground: front-end pre-compress (shrink to the target Token budget before upload; hold the resolution red line), task tiering (match the table—don't use 4K for classification), multi-image budget pool (when batch Tokens near 32k, truncate—same logic as last lesson's RAG budget cut).

Budget-aware image handling: three strategies and three red lines
Front-end pre-compress, match resolution to task tier, and the 32k red line for multi-image. (Figure: from the author's internal share deck)
Three red lines for image cost
Red lineThresholdConsequenceResponse
32-pixel alignmentSize crosses a multiple of 32Token count jumpsFront-end preprocess; align proactively
32k input tierMulti-image total > 32k TokensWhole request bills in the expensive bandBudget truncation like RAG
HD abuseBlindly sending 4K+ originalsCost ×30, limited accuracy gainMatch resolution to task tier
Key Takeaways

Images bill the resolution after scale-and-align, not the original you upload. Formula: (h̄×w̄)/token_pixels + 2.

High-res returns diminish: 4K costs ~4× 1080p and may not understand better. Match resolution to task tier.

Multi-image needs a budget pool: near 32k, truncate or compress—don't let the 5th image drag the whole bill into the expensive band.

Source: Adapted from the author's internal team share “AI Token Cost Engineering Strategies,” section “Image Token Billing.” Official rules: Alibaba Cloud Model Studio vision docs; academic source for the “resolution curse”: CARES paper.