intermediate12 min read· Module 6, Lesson 1
👁️Vision — Claude Can See
Send images to Claude and get intelligent analysis
Vision — Sending Images to Claude
Claude can see and understand images! You can send screenshots, diagrams, photos, and more.
Supported Formats
- JPEG, PNG, GIF, WebP
- Maximum: 8000x8000 pixels
- Up to 20 images per message (claude.ai) or 100-600 per API request
Sending an Image by URL
const response = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 1024,
messages: [{
role: "user",
content: [
{
type: "image",
source: {
type: "url",
url: "https://example.com/chart.png"
}
},
{
type: "text",
text: "What does this chart show?"
}
]
}]
});Sending a Base64 Image
import fs from "fs";
const imageData = fs.readFileSync("screenshot.png").toString("base64");
const response = await client.messages.create({
model: "claude-sonnet-4-6",
max_tokens: 1024,
messages: [{
role: "user",
content: [
{
type: "image",
source: {
type: "base64",
media_type: "image/png",
data: imageData
}
},
{
type: "text",
text: "Describe what you see in this image"
}
]
}]
});What Claude Can Do with Images
| Use Case | Example Prompt |
|---|---|
| Describe | "What's in this image?" |
| OCR | "Read all the text in this screenshot" |
| Analyze charts | "What trends does this graph show?" |
| Debug UI | "What's wrong with this layout?" |
| Code from mockup | "Write HTML/CSS that matches this design" |
| Compare | Send 2 images: "What's different?" |
Image Best Practices
- Resize large images — Claude rescales internally, so pre-resize to save tokens
- Use clear images — higher quality = better analysis
- Be specific — tell Claude what to look for
- Multiple images — send several for comparison tasks
Cost Tip
Images are converted to tokens. A typical 1000x1000 image uses ~1,600 tokens. Smaller images = lower cost.
Next up: Extended Thinking — making Claude think harder for complex problems.