VisionSqueezer
v0.9.0 Released 🚀

Stop Leaking Vision Tokens.

Fit images to a token budget before they reach the model. Give it a budget (1600 by default in the MCP server) and it downsizes images on Claude, GPT, and Gemini's exact grid boundaries: up to about 66% fewer Claude tokens on our sample photos (about 56% against what Claude Code already downsizes itself), with composition, colour, and large text intact. It works on images your code, agents, and project files send. It cannot shrink an image you paste into a chat window.

cargo run -- data/image.jpg --model gpt6

// Squeezer simulating OpenAI's short-side algorithm...
Input:  4096×3072  (2.2 MB)
Output: 4095×2048  (1.2 MB)

Tokens Saved: 5,595 (33.3% cheaper)

The Math Behind the Magic

Every provider tokenizes images differently. Squeezer simulates each provider's internal grid math and snaps your images to the cheapest valid boundary.

    Token budget

    --max-tokens N downscales until the target model's estimate fits. The MCP server defaults to 1600, about 66% fewer Claude tokens and 50% fewer GPT-6 tokens on the sample photos.

    OpenAI GPT-6 / GPT-5.6

    Current OpenAI models count 32×32 patches with a 2500-patch high-detail budget. Squeezer fits that budget and removes partially used edge patches.

    Claude 4.7+ (Patch System)

    Claude counts 28×28 patches. Squeezer fits the high-resolution or standard tier and aligns dimensions to the patch grid.

    Gemini (Massive Tiles)

    Gemini uses huge 768×768 blocks. A slightly overlapping image costs you double. We snap images securely down to the nearest tile boundary.

    Think in Code (Sandbox)

    Let your agent execute custom crops, binarization, or filters locally. Extract only the context you need to save up to 99.9% tokens.

    Persistent Analytics

    Locally tracks every optimization in a SQLite database. View your cumulative USD savings directly from your terminal or AI agent.

    Universal MCP

    Works natively with Claude Code, Cursor, Zed, and VS Code. No complex setup — just plug it into your favorite AI tool.

    AVIF Output

    --format avif encodes ~20–50% smaller than WebP at equal quality, ~3× smaller than JPEG. Same tokens, less bandwidth.

    Smart Crop & Auto-Quality

    --smart-crop uses edge-energy (Sobel-lite) to keep high-information regions. --auto-quality 0.95 binary-searches quality to hit a perceptual SSIM target.

    Batch & JSON Output

    Pass a directory + --recursive to squeeze a whole tree at once. --json emits a structured record for pipelines. --dry-run reports without writing.

Interactive Savings Calculator

Real numbers from the Squeezer pipeline. Pick an image source and an optimization target to see token and file-size savings per provider.

Select Image Source

Token budget


Optimizing a 2400x1670 photograph (4MP). Budget: 1600 tokens.

Tokens Saved (Claude)

3,090 (-66%)
4,674 → 1,584 tokens

Tokens Saved (GPT-6)

1,441 (-50%)
2,903 → 1,462 tokens

File Size Reduced

67% Smaller
0.5MB → 0.2MB

Budget 1600 (the MCP default): the image is downscaled until Claude's estimate fits. Composition, colour and large text survive; fine detail goes first.

Universal MCP Integration

Select your agent or editor. Thanks to npx -y, zero global installation is required — just paste the configuration.

# Zero-config one-liner for Claude Code
claude mcp add vision-squeezer -- npx -y vision-squeezer

Current OpenAI support

Use --model gpt6 for GPT-6 and GPT-5.6 patch tokenization. The gpt4o and gpt5 profiles remain for legacy endpoints with 512px high-detail tiling.

Stop paying for padding.

Install VisionSqueezer in one command and start cutting vision token costs across every provider.