Prompt

How do I find the exact area that changed in a screenshot diff?

Technology / Testing & QA1 observationLast seen Oct 27, 2026

Latest observation

Oct 27, 2026OpenAI APIWeb search: off

To find the exact area that changed in a screenshot diff, the usual approach is to compare the two images pixel-by-pixel and then compute the bounding box around all differing pixels.

Basic idea

  1. Load both screenshots.
  2. Ensure they’re the same size.
  3. Compare each pixel.
  4. Mark pixels that differ.
  5. Find the smallest rectangle containing all changed pixels.

Example in Python

Using Pillow and NumPy:

from PIL import Image, ImageChops
import numpy as np

img1 = Image.open("before.png").convert("RGBA")
img2 = Image.open("after.png").convert("RGBA")

if img1.size != img2.size:
    raise ValueError("Images must be the same size")

diff = ImageChops.difference(img1, img2)
diff_array = np.array(diff)

# Find pixels that changed
changed = np.any(diff_array != 0, axis=2)

ys, xs = np.where(changed)

if len(xs) == 0:
    print("No differences found")
else:
    left, right = xs.min(), xs.max()
    top, bottom = ys.min(), ys.max()
    print(f"Changed area: left={left}, top={top}, right={right}, bottom={bottom}")

If you want the changed region visually highlighted

You can draw the rectangle on top of the image:

from PIL import ImageDraw

draw = ImageDraw.Draw(img2)
draw.rectangle([left, top, right, bottom], outline="red", width=3)
img2.save("changed_area.png")

Notes

  • If the screenshots have tiny anti-aliasing or compression differences, you may want to treat pixels as “changed” only if the difference exceeds a threshold.
  • If there are multiple separate changed regions, the bounding box gives the overall extent, but not each individual patch. In that case, you’d use connected-component labeling to get each region separately.

If you want, I can also show:

  • a JavaScript/browser version,
  • how to get multiple changed rectangles instead of one,
  • or how to ignore small noise in the diff.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.