Providers
Claude (Patch-Based)
How current Claude vision models count 28px patches and how VisionSqueezer fits their budgets.
How Claude bills images
Claude counts image tokens on a 28×28 patch grid:
tokens = ceil(Width / 28) × ceil(Height / 28)
Claude 4.7+ high-resolution vision accepts a 2576px long edge and up to 4784 visual tokens. The standard tier uses a 1568px edge and 1568-token budget. Oversized images are downscaled while preserving aspect ratio.
Optimization strategy
VisionSqueezer removes padding, fits the correct tier budget, and lands dimensions on 28px boundaries:
- Strip all non-essential padding. Solid borders are pure waste under area billing.
- Fit the provider limit without sending pixels Claude will discard.
- Snap to 28px patches to avoid paying for a nearly empty patch.
Terminal
# Claude 4.7+ high-resolution tier
vision-squeezer screenshot.png --model claude
# Earlier/standard-resolution tier
vision-squeezer screenshot.png --model claude-standard
Example
A 1000×1000 image uses ceil(1000/28)² = 1296 visual tokens. A 28px-aligned 980×980 version uses 1225.
| Metric | Before | After |
|---|---|---|
| Resolution | 1000×1000 | 980×980 |
| Tokens | 1,296 | 1,225 |
| Savings | — | 71 tokens (-5.5%) |
For screenshots with solid borders, the default corner-tolerance crop is ideal. For photographic content, add
--smart-crop.Source: Anthropic vision documentation.
