Claude의 비전 기능을 사용하면 메시지에 이미지를 포함하고 Claude에게 다양한 방식으로 이미지를 분석하도록 요청할 수 있습니다. Claude에게 이미지에 무엇이 있는지 설명하거나, 여러 이미지를 비교하거나, 객체 수를 세거나, 복잡한 시각 분석 작업을 수행하도록 요청할 수 있습니다.
이미지 처리 기본 사항

이미지를 다룰 때 염두에 두어야 할 몇 가지 중요한 제한 사항이 있습니다:
- 단일 요청의 모든 메시지에서 최대 600개의 이미지 (200k 토큰 컨텍스트 창을 가진 모델의 경우 100개)
- base64 인코딩 후 측정한 이미지당 최대 크기 10MB
- 이미지를 1개 보낼 때: 최대 높이/너비 8000px
- 이미지를 여러 개 보낼 때: 최대 높이/너비 2000px
- 이미지는 base64 인코딩 또는 이미지에 대한 URL로 포함할 수 있습니다
- 각 이미지는 해당 크기에 따라 토큰으로 계산됩니다:
tokens = ⌈width / 28⌉ × ⌈height / 28⌉
Claude에게 이미지를 보내려면 사용자 메시지에 텍스트 블록과 함께 이미지 블록을 포함하면 됩니다. 구조는 다음과 같습니다:
import base64
with open("image.png", "rb") as f:
image_bytes = base64.standard_b64encode(f.read()).decode("utf-8")
add_user_message(messages, [
# 이미지 블록
{
"type": "image",
"source": {
"type": "base64",
"media_type": "image/png",
"data": image_bytes,
}
},
# 텍스트 블록
{
"type": "text",
"text": "What do you see in this image?"
}
])메시지 흐름

이 대화는 텍스트 전용 상호작용과 정확히 동일하게 작동합니다. 서버는 이미지와 텍스트 블록을 모두 포함하는 사용자 메시지를 Claude에게 전송하고, Claude는 분석 내용이 담긴 텍스트 블록으로 응답합니다.
프롬프트 작성 기법

이미지에서 좋은 결과를 얻는 핵심은 텍스트에서 사용하는 것과 동일한 프롬프트 엔지니어링 기법을 적용하는 것입니다. 단순한 프롬프트는 종종 좋지 않은 결과로 이어집니다. 예를 들어, "이 이미지에 구슬이 몇 개 있나요?"라고 묻는 것은 잘못된 개수를 반환할 수 있습니다.
다음과 같은 방법으로 Claude의 정확도를 크게 향상시킬 수 있습니다:
- 자세한 지침과 분석 단계를 제공하기
- 원샷 또는 멀티샷 예시 사용하기
- 복잡한 작업을 더 작은 단계로 나누기
단계별 분석

단순한 질문 대신 Claude에게 방법론을 제공하세요:
Analyze this image of marbles and determine the exact count using this methodology:
1. Begin by identifying each unique marble one at a time. Assign each a number as you identify it.
2. Verify your result by counting with a different method. Start from the bottom-left corner and work row by row, from left to right.
What is the exact, verified number of marbles in this image?원샷 예시

메시지 내에 예시를 제공하여 정확도를 높일 수도 있습니다. 알려진 개수가 있는 이미지를 포함하고, 정답을 명시한 다음, 대상 이미지에 대해 질문하세요. 이렇게 하면 Claude가 원하는 유형의 분석에 대한 참조 지점을 갖게 됩니다.
실제 사례: 화재 위험 평가

실용적인 적용 사례를 살펴보겠습니다: 주택 보험을 위한 화재 위험 평가 자동화입니다. 모든 부동산에 검사관을 보내는 대신, 보험 회사는 위성 이미지와 Claude의 분석을 사용할 수 있습니다.
이 시스템은 위성 이미지를 분석하여 다음을 식별합니다:
- 주택 근처에 빽빽하게 밀집된 나무
- 응급 서비스의 접근이 어려운 경로
- 주택 위로 뻗어 있는 나뭇가지
"화재 위험 점수를 제공하세요"와 같은 단순한 프롬프트 대신, 잘 구성된 프롬프트는 분석을 구체적인 단계로 나눕니다:
Analyze the attached satellite image of a property with these specific steps:
1. Residence identification: Locate the primary residence on the property by looking for:
- The largest roofed structure
- Typical residential features (driveway connection, regular geometry)
- Distinction from other structures (garages, sheds, pools)
2. Tree overhang analysis: Examine all trees near the primary residence:
- Identify any trees whose canopy extends directly over any portion of the roof
- Estimate the percentage of roof covered by overhanging branches (0-25%, 25-50%, 50-75%, 75%+)
- Note particularly dense areas of overhang
3. Fire risk assessment: For any overhanging trees, evaluate:
- Potential wildfire vulnerability (ember catch points, continuous fuel paths to structure)
- Proximity to chimneys, vents, or other roof openings if visible
- Areas where branches create a "bridge" between wildland vegetation and the structure
4. Defensible space identification: Assess the property's overall vegetative structure:
- Identify if trees connect to form a continuous canopy over or near the home
- Note any obvious fuel ladders (vegetation that can carry fire from ground to tree to roof)
5. Fire risk rating: Based on your analysis, assign a Fire Risk Rating from 1-4:
- Rating 1 (Low Risk): No tree branches overhanging the roof, good defensible space around the home
- Rating 2 (Moderate Risk): Minimal overhang (<25% of roof), some separation between tree canopies
- Rating 3 (High Risk): Significant overhang (25-50% of roof), connected tree canopies, multiple vulnerability points
- Rating 4 (Severe Risk): Extensive overhang (>50% of roof), dense vegetation against structure
For each item above (1-5), write one sentence summarizing your findings, with your final response being the numerical rating.이 상세한 프롬프트는 Claude가 체계적인 분석을 수행하도록 안내하여, 단순한 요청보다 훨씬 더 정확하고 유용한 평가 결과를 만들어냅니다.
기억하세요: 텍스트에 효과적인 동일한 프롬프트 작성 기법이 이미지에도 적용됩니다. 신뢰할 수 있는 결과를 원한다면 단순한 질문에 의존하기보다 상세하고 체계적인 프롬프트를 작성하는 데 시간을 투자하세요.