Vision
圖片理解
Claude's vision capabilities allow it to understand and analyze images, opening up exciting possibilities for multimodal interaction.
Claude 的視覺能力讓它能夠理解和分析圖片,為多模態互動開啟令人興奮的可能性。
How to use vision
如何使用視覺功能
Use Claude's vision capabilities via:
透過以下方式使用 Claude 的視覺能力:
- claude.ai: Upload an image like you would a file, or drag and drop an image directly into the chat window.
- The Console Workbench: A button to add images appears at the top right of every User message block.
- API request: See the examples in this guide.
- claude.ai:像上傳檔案一樣上傳圖片,或直接將圖片拖放到聊天視窗中。
- Console Workbench:在每個使用者訊息區塊的右上角會出現新增圖片的按鈕。
- API 請求:請參閱本指南中的範例。
Basics and Limits
基本說明與限制
You can include multiple images in a single request (up to 20 for claude.ai and 100 for API requests). Claude will analyze all provided images when formulating its response.
你可以在單一請求中包含多張圖片(claude.ai 最多 20 張,API 請求最多 100 張)。Claude 會在生成回應時分析所有提供的圖片。
If you submit an image larger than 8000x8000 px, it will be rejected. If you submit more than 20 images in one API request, this limit is 2000x2000 px.
如果提交的圖片大於 8000x8000 像素,將會被拒絕。如果在一個 API 請求中提交超過 20 張圖片,則每張圖片限制為 2000x2000 像素。
Evaluate image size
評估圖片大小
For optimal performance, we recommend resizing images before uploading if they are too large. If your image's long edge is more than 1568 pixels, or your image is more than ~1,600 tokens, it will first be scaled down, preserving aspect ratio, until it's within the size limits.
為了獲得最佳效能,如果圖片太大,我們建議在上傳前調整大小。如果圖片的長邊超過 1568 像素,或圖片超過約 1,600 個 token,系統會先按比例縮小,同時保持長寬比,直到符合大小限制。
| Aspect ratio | Image size |
|---|---|
| 1:1 | 1092x1092 px |
| 3:4 | 951x1268 px |
| 2:3 | 896x1344 px |
| 9:16 | 819x1456 px |
| 1:2 | 784x1568 px |
| 長寬比 | 圖片尺寸 |
|---|---|
| 1:1 | 1092x1092 px |
| 3:4 | 951x1268 px |
| 2:3 | 896x1344 px |
| 9:16 | 819x1456 px |
| 1:2 | 784x1568 px |
Calculate image costs
計算圖片成本
Each image you include in a request to Claude counts towards your token usage. To calculate the approximate cost, multiply the approximate number of image tokens by the per-token price of the model you're using.
你在請求中包含的每張圖片都會計入 token 使用量。要計算大約成本,請將圖片的大約 token 數乘以你使用的模型的每 token 價格。
If your image does not need to be resized, you can estimate the number of tokens used through this algorithm: tokens = (width px * height px)/750
如果你的圖片不需要調整大小,可以透過以下公式估算使用的 token 數:tokens = (寬度 px * 高度 px)/750
| Image size | # of Tokens | Cost / image | Cost / 1K images |
|---|---|---|---|
| 200x200 px (0.04 megapixels) | ~54 | ~$0.00016 | ~$0.16 |
| 1000x1000 px (1 megapixel) | ~1334 | ~$0.004 | ~$4.00 |
| 1092x1092 px (1.19 megapixels) | ~1590 | ~$0.0048 | ~$4.80 |
| 圖片尺寸 | Token 數量 | 每張成本 | 每千張成本 |
|---|---|---|---|
| 200x200 px(0.04 百萬像素) | 約 54 | 約 $0.00016 | 約 $0.16 |
| 1000x1000 px(1 百萬像素) | 約 1334 | 約 $0.004 | 約 $4.00 |
| 1092x1092 px(1.19 百萬像素) | 約 1590 | 約 $0.0048 | 約 $4.80 |
Ensuring image quality
確保圖片品質
When providing images to Claude, keep the following in mind for best results:
向 Claude 提供圖片時,請注意以下事項以獲得最佳效果:
- Image format: Use a supported image format: JPEG, PNG, GIF, or WebP.
- Image clarity: Ensure images are clear and not too blurry or pixelated.
- Text: If the image contains important text, make sure it's legible and not too small.
- 圖片格式:使用支援的圖片格式:JPEG、PNG、GIF 或 WebP。
- 圖片清晰度:確保圖片清晰,不會太模糊或像素化。
- 文字:如果圖片包含重要文字,請確保文字清晰可讀且不會太小。
Limitations
限制
While Claude's image understanding capabilities are cutting-edge, there are some limitations to be aware of:
雖然 Claude 的圖片理解能力是最先進的,但仍有一些限制需要注意:
- People identification: Claude cannot be used to identify (i.e., name) people in images and will refuse to do so.
- Accuracy: Claude may hallucinate or make mistakes when interpreting low-quality, rotated, or very small images under 200 pixels.
- Spatial reasoning: Claude's spatial reasoning abilities are limited. It may struggle with tasks requiring precise localization or layouts.
- Counting: Claude can give approximate counts of objects in an image but may not always be precisely accurate.
- AI generated images: Claude does not know if an image is AI-generated and may be incorrect if asked.
- Healthcare applications: While Claude can analyze general medical images, it is not designed to interpret complex diagnostic scans.
- 人物識別:Claude 不能用於識別(即說出名字)圖片中的人物,並會拒絕這樣做。
- 準確性:Claude 在解讀低品質、旋轉或小於 200 像素的圖片時可能會產生幻覺或犯錯。
- 空間推理:Claude 的空間推理能力有限。它可能難以處理需要精確定位或版面配置的任務。
- 計數:Claude 可以提供圖片中物體的大約數量,但可能不總是完全準確。
- AI 生成圖片:Claude 無法判斷圖片是否為 AI 生成,如果被問到可能會答錯。
- 醫療應用:雖然 Claude 可以分析一般醫療圖片,但它不是為解讀複雜的診斷掃描而設計的。
FAQ
常見問題
- What image file types does Claude support? JPEG, PNG, GIF, and WebP.
- Can Claude read image URLs? Yes, Claude can process images from URLs.
- Is there a limit to the image file size? API: Maximum 5MB per image. claude.ai: Maximum 10MB per image.
- How many images can I include in one request? Messages API: Up to 100 images. claude.ai: Up to 20 images per turn.
- Does Claude read image metadata? No, Claude does not parse or receive any metadata from images.
- Can Claude generate or edit images? No, Claude is an image understanding model only.
- Claude 支援哪些圖片檔案類型?JPEG、PNG、GIF 和 WebP。
- Claude 可以讀取圖片網址嗎?是的,Claude 可以處理來自網址的圖片。
- 圖片檔案大小有限制嗎?API:每張最大 5MB。claude.ai:每張最大 10MB。
- 一個請求可以包含多少張圖片?Messages API:最多 100 張。claude.ai:每回合最多 20 張。
- Claude 會讀取圖片的元資料嗎?不會,Claude 不會解析或接收圖片的任何元資料。
- Claude 可以生成或編輯圖片嗎?不行,Claude 只是一個圖片理解模型。