Pixel Diff Compare Images Perceptual Similarity API
Free tier included · MediaPixel Diff API offers professional-grade image comparison tools designed for automated visual testing, UI regression suites, design QA, and content verification. It goes far beyond basic pixel counting by providing advanced features such as Structural Similarity Index (SSIM) perceptual scoring, connected-component difference region bounding boxes, and base64-encoded red-and-gray PNG visual diff overlays.
The API handles real-world image complexities seamlessly, including EXIF orientation correction, alpha premultiplication, and 16-bit grey scaling. If compared image dimensions differ, Image B is automatically resized to match Image A. In addition to single comparisons, the `/compare-batch` endpoint allows you to evaluate up to 100 image pairs (200 files) in a single HTTP request, making it ideal for high-throughput CI/CD pipelines and batch ETL jobs.
It is fully stateless and processes everything in-memory: no files are saved to disk, ensuring strict privacy for your visual assets.
Honest limits: Uploads are restricted by a maximum file size of 20MB per image and an absolute ceiling of 12,000,000 pixels per image to maintain high performance. Request concurrency is managed gracefully, and returning overlays in large batch calls will increase response payload sizes and processing time.
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | / | Root endpoint returning API metadata. |
GET | /health | Liveness probe checking service health. |
POST | /compare | Compare two images and get differing pixel count, percentage, and an optional base64 PNG diff overlay. |
POST | /compare/full | Full image comparison with perceptual similarity (SSIM), difference regions (bounding boxes), and optional overlay. |
POST | /compare-batch | Compare multiple image pairs (up to 100 pairs / 200 files) in a single request. |
Quick start
curl -X POST "https://pixeldiff.p.rapidapi.com/compare" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: pixeldiff.p.rapidapi.com" \
-F "file_a=@a.png" \
-F "file_b=@b.png" \
-F "threshold=0"
FAQ
What image formats are supported?
The API supports standard web formats including PNG, JPEG, and WEBP. Images are automatically handled with EXIF orientation correction and alpha premultiplication.
What happens if the two images have different dimensions?
Image B is automatically resized to match the dimensions of Image A before comparison, and the response will flag `resized: true`.
Are my uploaded images stored or logged?
No. All processing happens entirely in-memory using stateless workers. Images are never written to disk or stored.
How many image pairs can I submit in a batch request?
You can submit up to 100 pairs (total 200 files) in a single request using the `/compare-batch` endpoint by passing files as alternating pairs.
Try Pixel Diff Compare Images Perceptual Similarity free
Free tier on every plan. Get an API key and start calling in under a minute.
Open on RapidAPI