Compare Two Screenshots with Claude API: A Visual Acceptance Report
Proposed acceptance brief: compare a baseline and candidate checkout screen captured under identical conditions. Confirm that the final amount, selected address, delivery date, and payment action remain understandable after the approved layout change. Return visible observations, unresolved evidence, and items requiring human review. The release owner retains approval authority. Claude receives the screenshots through an image-capable API; it is not asked to operate the interface or certify that its business logic works.
Write the acceptance brief before sending the images
Begin with the decision the reviewer must make. “Find every difference” produces a long inventory of details that may not matter. A better brief identifies the screen, the customer task, the approved change, and the elements that must remain understandable. For a delivery screen, the approved change might be a new address layout; the protected elements might be the final price, selected address, delivery date, and payment action. Give those elements stable names so findings remain comparable across runs.
Separate authorized differences from acceptance risks. A changed brand color is expected when the design brief approves it. The same color change becomes relevant when a warning loses its visual prominence. Ask for the visible observation first and the possible user consequence second. The reasoning should be inspectable: “The label wraps beneath the amount in the candidate” is evidence; “customers will abandon checkout” is an unsupported behavioral prediction. The existing Claude prompting discussion provides broader context, but this task benefits from a short, explicit review contract.
Define three outcomes for each protected element: no visible concern, candidate concern, or insufficient evidence. The third outcome is essential. A spinner can cover the amount; a screenshot can end before the action button; a font can be too small to read. Those are reasons to request a better capture, not reasons to invent the missing state. A report that honestly leaves one acceptance criterion unresolved is more useful than a complete-looking report that silently guesses.
Why the brief needs visible evidence
A checkout redesign can pass its automated tests while putting the delivery total below the fold. A settings screen can preserve every endpoint while clipping the only explanation of an important switch. These are acceptance questions: what changed for the person looking at the product, and which changes deserve a release review? Two screenshots give Claude a bounded evidence set for answering them. The useful output is a reviewable account of visible differences, with uncertainty attached, rather than a confident declaration that the application works.
This walkthrough designs that report around one baseline image and one candidate image. It is a proposed evaluation workflow, not a claim about results from an actual product test. Claude receives already captured images and returns observations; it does not open a browser, inspect source code, click controls, or approve deployment. That boundary makes the exercise practical for product engineers, designers, and release owners who need a second reading of screenshots they already collect.
Make the pair comparable
Hold the capture conditions stable: viewport size, device scale, browser, operating system, locale, theme, test account state, and application data. Wait for the intended screen state before capturing. Use fixed example dates and amounts when those values are irrelevant to the change. Record the capture configuration alongside the images because it explains differences that pixels alone cannot explain. The Playwright visual comparisons documentation discusses screenshot assertions and environment-sensitive rendering; its deterministic comparison remains a useful companion to semantic review.
Do not ask Claude to compensate for a poorly matched pair. Comparing a desktop baseline with a mobile candidate combines responsive behavior with the intended change. Comparing an empty cart with a populated cart combines data state with layout. In either case, the right first result is “pair not comparable.” Build that outcome into your review process. When a legitimate redesign changes the layout substantially, keep the viewport and task state fixed, then explicitly describe which structural changes are authorized.
Send readable images without decorative framing. Keep original captures available for human inspection, and assign each a digest so an accepted report cannot accidentally be paired with another build. Anthropic’s vision guide documents multiple image inputs and cautions that small text and spatial localization can be imperfect. Therefore, this report uses named regions and visible labels rather than treating model coordinates as exact geometry. Precise spacing and pixel differences belong in deterministic checks.
The report is evidence, not a replacement test suite
A screenshot reveals appearance at one moment. It does not prove that a button has the right accessible name, that keyboard focus reaches it, that a form submits correctly, or that a price came from the right service. Put those exclusions in the report’s scope, where the reviewer will see them. If Claude observes a disabled-looking button, describe that appearance without asserting its actual disabled state. A human can then decide whether a DOM assertion or interaction test should investigate it.
Keep visual interpretation separate from image-to-code evaluation. The image-to-web development benchmark discussion concerns producing interfaces from references. Here, both interface states already exist, and the model’s job is to explain acceptance-relevant differences. That distinction prevents the review from drifting into implementation advice. Suggestions such as changing CSS selectors are speculation when the request contains no source or DOM.
Use a small finding vocabulary: missing content, clipped content, altered hierarchy, changed copy, alignment concern, and expected change. Allow other observations only with a clear description. Severity should describe your release policy, not the model’s apparent confidence. For example, a candidate concern affecting the final amount can require review regardless of whether the model calls it minor. Confidence and consequence are different dimensions; storing them separately makes downstream decisions easier to defend.
Send one labeled pair to the native Messages API
The following Python script is an upstream reference example using an Anthropic credential and the native Messages endpoint. Choose a model available to that account through CLAUDE_MODEL. The current Claude model overview lists image input among current model capabilities. This does not establish that a particular intermediary exposes the same image request shape. The example deliberately keeps the native credential and base URL together, and performs no network call until you run it.
The request follows the Messages API reference, placing the labeled images before the final review instruction. Its response format is prompted JSON, not a claim that every possible model response is schema constrained. The script checks completion, parses the result, and rejects an unexpected report shape. An invalid response becomes a review failure; it does not become an empty set of findings or an automatic approval.
The official Python SDK documentation covers timeout configuration and response handling. A timeout here means the review was not delivered, even if the upstream system performed work. Record that state separately from a completed report with no concerns. The code uses a conservative output bound for a single pair; a production implementation should also limit input file dimensions and request size before uploading, using the limits of its selected route.
Turn observations into an acceptance meeting
Present each finding beside the two actual screenshots. A useful review card contains the named region, baseline observation, candidate observation, possible impact, and the reviewer’s resolution. Keep the model’s original observation even after the reviewer rejects it. The next evaluation needs to distinguish a genuine regression, an approved design change, and an unsupported interpretation. Collapsing all three into “resolved” destroys the information needed to improve the workflow.
Consider a hypothetical report saying the delivery date disappeared. The reviewer should first inspect whether the date is absent, outside the capture, obscured by a loading state, or represented differently. Only the first case is direct evidence of missing visible content in that captured state. This resembles the distinction between new findings and new defects discussed in reviewing changes between audit reports, although this workflow evaluates rendered screens rather than code findings.
Use release criteria that your team owns. A candidate concern involving the payable total may block acceptance until checked; an uncertain alignment observation may be informational. Never let the absence of a finding override a deterministic assertion that failed. Conversely, a pixel comparison can flag a large intended redesign without explaining whether the task still reads clearly. These complementary signals answer different questions, and the reviewer should see both rather than a blended score with an unclear meaning.
Keep an evidence packet for each reviewed pair: capture digests, build identifiers, viewport settings, brief version, prompt version, model identifier, raw report, and human disposition. Attach the screenshots or their controlled references under the same retention rules as the product’s test artifacts. The broader discussion of Claude audit trails is relevant to this separation of generated analysis from approved conclusions. The reviewer’s decision should remain a distinct record with its own author and time.
When one layout shift produces several observations, group them for review without erasing the individual evidence. A wider address card might move the total, wrap the delivery date, and push the action lower. Those can be three symptoms of one approved change or three separate acceptance concerns. Ask the reviewer to assign a shared issue identifier after inspecting the pair. Do not ask the model to declare a root cause that screenshots cannot establish. Keeping observation identifiers stable also lets a later candidate resolve one symptom while leaving another visible.
Evaluate the reviewer before trusting its silence
Build a small local collection of screenshot pairs with known outcomes. Include an unchanged pair, an authorized layout change, an obviously missing protected element, a clipped label, and an incomparable viewport pair. These are proposed fixtures, not published benchmark results. Have a product reviewer label the acceptance-relevant changes before looking at model outputs. Otherwise, the model’s wording can influence what the reviewer later remembers as the expected answer.
Measure missed protected-element defects and unsupported concerns separately. Also count how often the report correctly asks for a better capture. A model that always finds something can look attentive while generating unnecessary work; a model that rarely reports concerns can appear precise while missing important changes. The existing multimodal validation discussion offers related context, but your screenshot collection and human judgments should determine the acceptance threshold for this particular use.
Keep the first integration small: one screen, one viewport, one protected customer task. Broader image-processing concerns are discussed in the multimodal production workflow guide. For this reviewer, expansion should follow evidence that people can resolve the reports efficiently. Add another screen only after you can explain why a report was accepted or rejected and reproduce the exact image pair that produced it.
To explore deployment through 4SAPI, start with the 4SAPI integration overview, then inspect the model and image-request documentation available from your 4SAPI account and the API documentation. Confirm the supported endpoint and image format before adapting the native example. Run one labeled pair with the appropriate gateway credential and compare its complete report with your expected acceptance notes. The first useful result is a report your reviewer can verify.




