Prompt Engineering Mastery/Image & Multimodal Prompting
Lesson 5 / 6 · 20 min · 0 / 3 exercises
Course contents
Walkthrough · 3 hands-on exercises

Prompting With Images as Input

Get reliable answers from screenshots, charts and photos: images first and labeled, dense regions cropped, a clear output contract, and an honest way to say what's unreadable.

Every frontier model reads images now, and the newest read them much better. Anthropic's Claude Opus 5.5 guide reports that, in its testing, the model read values off dense charts more accurately at its lowest effort setting than Claude Opus 5 did at its highest. OpenAI pitches GPT-6.1 Terra at visual reasoning and precise computer use. That cuts both ways: scaffolding you built for older models, such as tiling every chart into crops, may no longer earn its cost, so re-test it.

How a model sees an image

Models don't see pixels one by one. Claude processes an image in 28×28-pixel patches, each one a visual token, so an image costs about (width ÷ 28) × (height ÷ 28) tokens. Each model has a maximum resolution, and larger images are scaled down first. On Claude 4.7 models and later, that limit is 2,576 pixels on the long edge and 4,784 visual tokens; older models use 1,568 pixels. A 4K screenshot gets shrunk to fit, and small print can blur in the process. The practical rules follow: crop to the part that matters, send text-heavy screenshots close to native size, and avoid heavy JPEG compression, which Anthropic warns can make text hard to read.

Quick checkExercise 1 of 3

You send a 3840×2160 screenshot of a dense dashboard to Claude Opus 5.5 and ask for a figure printed in small type. What happens to the image first?

Prompt structure for images

  • Images first, then the question. Anthropic's vision guide says Claude works best when images come before text, the same way long documents go before the query.
  • Label multiple images. Put “Image 1:”, “Image 2:” before each one, so you and the model can refer to them by name.
  • Give an output contract. A schema or a fixed format turns a description into data you can file, compare or store.
  • Separate seen from inferred. Ask the model to say what's clearly legible versus blurry, cropped or ambiguous, and to use null for anything it can't read.

What vision still gets wrong

Sort itExercise 2 of 3

Anthropic documents these limits for Claude, and other vendors' models share most of them. Sort each task by how far you can trust the answer.

Card 1 of 7

Counting 300 birds in a flock photo

Quick checkExercise 3 of 3

A pipeline built for an older model tiles every chart into four crops before asking questions. You're moving it to Claude Opus 5.5. What should you do?

Steps · 0 / 6 done
  1. Turn a screenshot into a structured bug report

    Attach the screenshot first, then give a role and an output contract, so you get a bug you can file rather than a paragraph of description.

    prompt
    [Image 1: the screenshot]
    
    You are a QA engineer. Image 1 shows a bug in our web app. Produce a bug report as JSON:
    
    {
      "title": "short and specific",
      "observed": "what is wrong, naming visible UI elements and quoting any error text",
      "expected": "what should happen",
      "location": "the screen or component shown",
      "severity": "low | medium | high"
    }
    
    Describe only what is visible. If something is ambiguous, say so in "observed" instead of guessing.
    VerifyThe report names real on-screen elements (button labels, quoted error text), not a generic description.
  2. Extract a chart into data

    Ask for the underlying numbers in a fixed format, and say how to handle values it has to estimate rather than read.

    prompt
    [Image 1: the chart]
    
    Extract the data from Image 1 as JSON. For each series, give its label and an array of {x, y} points read from the axes. If a value isn't labeled exactly, estimate it from the gridlines and add "approx": true. Also return the axis titles and units. Don't invent series that aren't shown.
    VerifyYou get labeled series with units and approx flags. Spot-check two points against the chart.
  3. Turn a photo into JSON, with a null policy

    Receipts, labels and whiteboards become data with the same contract-first approach. State the fields and what to do when a value can't be read.

    prompt
    [Image 1: photo of a receipt]
    
    Extract to JSON: {merchant, date (ISO 8601), currency, line_items: [{name, qty, unit_price}], subtotal, tax, total}. Use null for anything unreadable or missing. Transcribe only what you can read; don't calculate values that aren't printed.
    VerifyUnreadable fields come back null, and the total isn't back-calculated from the line items.
  4. Ground it: seen versus inferred

    The main failure is a confident description of something that isn't there. Make the model separate what it can read from what it's inferring.

    prompt
    Before extracting, list what is clearly legible in Image 1 and what is blurry, cropped or ambiguous. Base the extraction only on the legible parts, and add a "confidence" (low / medium / high) to each uncertain field. Never fill an unreadable field with a plausible guess.
    VerifyBlurry or cropped values come back flagged low-confidence or null, and the model names what it couldn't read.
  5. Compare labeled images

    For before-and-after checks or multi-page documents, label each image and ask about them by name.

    prompt
    Image 1: [design mockup]
    Image 2: [screenshot of the built page]
    
    List every visible difference between Image 1 and Image 2 as {element, in_image_1, in_image_2}. Ignore differences in the sample text content.
    VerifyEach difference names the element and what each image shows, and you can check every line against the two images.
  6. Teach the format with multimodal few-shot

    When you need the same style of answer across many images, show one or two solved examples before the real image.

    prompt
    Here are two examples of how we caption catalog photos:
    
    [Image A] -> {"title": "Matte Black Ceramic Mug, 12oz", "attributes": ["matte", "black", "ceramic", "12oz"], "tone": "minimal"}
    [Image B] -> {"title": "Hand-Woven Rattan Basket, Medium", "attributes": ["handwoven", "rattan", "natural", "medium"], "tone": "artisanal"}
    
    Now caption this image in the same JSON format:
    [Image C]
    VerifyThe new caption matches the demonstrated structure and tone rather than the model's default long description.
Check your understanding
Q1. Your receipt pipeline returned a confident total for a smudged, unreadable receipt. What's the best fix?
Q2. You send three screenshots and ask which one shows the error. What makes the answer easiest to trust and act on?
· Tick off the 6 step(s) above.
· Work through the 3 remaining exercises above (stuck? each one can show you the answer).
· Score 100% on the quiz.
Vocabulary in this lesson

Plain-English definitions from the AI Coding Dictionary.