# Image Quality Checker — Detect Blurry, Dark & Duplicate Photos (`adorable_partial/image-quality-checker`) Actor

Score photos 0-100 and flag blurry, motion-blurred, too dark, overexposed, noisy, low-contrast, low-resolution and duplicate images in bulk. For listings, uploads, KYC and AI datasets. Fast CPU checks, pay per image.

- **URL**: https://apify.com/adorable_partial/image-quality-checker.md
- **Developed by:** [Leandro Zanatta](https://apify.com/adorable_partial) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.70 / 1,000 image checkeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Image Quality Checker — Blurry, Dark & Duplicate Photo Detection

Check photos in bulk before they go live or into a dataset. Every image gets a **0–100 quality score**, a clear **pass / flagged** verdict and the reasons: **blurry**, **motion blur**, **too dark**, **overexposed**, **low contrast**, **noisy**, **low resolution** or **duplicate** of another image in the batch. Fast CPU measurements, no AI service calls, pay per image.

![Five photos checked: one passed, four flagged as blurry, motion blur, too dark and duplicate, with scores and measurements](https://api.apify.com/v2/key-value-stores/3H4SMG1B0OaqYYtXM/records/demo.png?signature=hAei2gpH8sTJzoy6bIOI)

*Real output of this Actor on its sample set (photos CC BY-SA 4.0, Wikimedia Commons, with blur and darkening added).*

### Why use it

- 🚫 **Stop bad photos at the door**: blurry listing photos, dark selfies and tiny thumbnails cost conversions, re-shoots and support tickets.
- 🧹 **Cleaner AI datasets**: drop blurred, dark and duplicate images before labeling or training.
- 🎯 **Tells you why**: each issue is named, with the measurement behind it, so you can show users a precise message ("photo is too dark").
- 🔁 **Finds duplicates**: resized or re-compressed copies of the same photo in a batch are flagged.
- ⚙️ **Your rules**: strict, standard or lenient presets, or set each threshold yourself; choose which issues should not fail an image.
- ⚡ **Fast and cheap**: about 0.2 s of CPU per 10-megapixel photo; nothing is sent to external AI services.

### Who uses it

| Sector | Typical use |
|---|---|
| **Marketplaces & classifieds** | Reject or warn on blurry, dark or tiny listing photos before publishing |
| **Real estate & hospitality** | Audit property and room photos across thousands of listings |
| **E-commerce** | Check product photos from suppliers before they reach the catalog |
| **KYC & onboarding** | Ask users to retake a document photo or selfie that is too dark or blurry |
| **AI & data teams** | Filter training images and remove duplicates |
| **Insurance & inspections** | Make sure field photos are usable before closing a claim or report |
| **Media & DAM** | Sort archives by quality and find duplicate files |

### Checks

| Issue | How it is measured | Standard threshold |
|---|---|---|
| **blurry** | Laplacian variance on the most detailed parts of the picture, divided by contrast (a soft background or a dark photo is not mistaken for blur) | sharpness < 20 |
| **motion blur** | Same, plus a direction check: camera shake removes detail in one direction only | sharpness < 20 and direction balance < 0.08 |
| **too dark** | Average brightness, share of pure-black pixels | brightness < 40 or > 15% clipped |
| **overexposed** | Average brightness, share of pure-white pixels | brightness > 215 or > 15% clipped |
| **low contrast** | Standard deviation of brightness | < 25 |
| **noisy** | Noise measured in the smoothest areas (sky, walls), where texture can't be confused with noise | > 1.0 |
| **low resolution** | Short side in pixels | < 480 px |
| **duplicate** | Perceptual hash compared with earlier images in the run | distance ≤ 6 |

**Tested** on four real photos, each degraded eight ways (Gaussian blur, horizontal and vertical motion blur, darkening, overexposure, noise, low resolution, low contrast): **35 of 36 cases flagged correctly**, and every original passed. The one miss was a vertical shake on a wide landscape, labeled *blurry* instead of *motion blur* (still flagged). Typical sharp photos score 30–200 in sharpness, blurry ones under 10.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| **Image URLs** (`imageUrls`) | array | — | Photos to check (JPEG, PNG, WebP, BMP, TIFF), up to 100 MB. Google Drive and Dropbox links work |
| **Strictness** (`preset`) | string | `standard` | `standard`, `strict` (print, product, documents) or `lenient` (user content, thumbnails) |
| **Issues that do not fail an image** (`ignoreIssues`) | array | — | Still reported, but `passed` stays true |
| **Flag duplicates** (`findDuplicates`) | boolean | `true` | Compare each image with the earlier ones in the run |
| **Duplicate tolerance** (`duplicateDistance`) | integer | `6` | 0 = identical only, 6 = resized/re-saved copies, 12 = similar shots |
| **Threshold overrides** | string | preset | `minSharpness`, `minBrightness`, `maxBrightness`, `maxClippedPercent`, `minContrast`, `maxNoise`, `minShortSide` |

| Preset | Sharpness | Brightness | Clipped | Contrast | Noise | Short side |
|---|---|---|---|---|---|---|
| lenient | ≥ 10 | 25–230 | ≤ 25% | ≥ 15 | ≤ 2.0 | ≥ 240 px |
| standard | ≥ 20 | 40–215 | ≤ 15% | ≥ 25 | ≤ 1.0 | ≥ 480 px |
| strict | ≥ 30 | 60–200 | ≤ 8% | ≥ 35 | ≤ 0.7 | ≥ 1000 px |

```json
{
  "imageUrls": ["https://example.com/listing/123/1.jpg", "https://example.com/listing/123/2.jpg"],
  "preset": "standard",
  "ignoreIssues": ["low resolution"]
}
```

### Output

```json
{
  "sourceUrl": "https://example.com/listing/123/2.jpg",
  "passed": false,
  "qualityScore": 65,
  "issues": [
    "blurry"
  ],
  "width": 1600,
  "height": 899,
  "megapixels": 1.44,
  "fileBytes": 76368,
  "sharpness": 0.27,
  "directionBalance": 0.228,
  "brightness": 105.4,
  "contrast": 46.8,
  "shadowsClippedPercent": 0.0,
  "highlightsClippedPercent": 0.09,
  "noise": 0.05,
  "colorfulness": 41.7,
  "phash": "ebcc84d4d0c8eaae",
  "duplicateOf": null
}
```

`passed` is true when the image has no issue (except those in *ignoreIssues*). `qualityScore` (0–100) is useful to sort or rank images. A run summary (passed, failed, duplicates) is saved as **`SUMMARY`**. Failed downloads return an `error` field and are free.

### Pricing

Pay per **image checked**, plus a tiny per-run start fee. No subscription. Apify plan discounts apply automatically (see the **Pricing** tab).

| Example | Images billed |
|---|---|
| One listing with 12 photos | 12 |
| 5,000 product images | 5,000 |
| 100,000 dataset images | 100,000 |

### Use it from code or an AI agent

**Python: keep only the good photos**

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("adorable_partial/image-quality-checker").call(run_input={
    "imageUrls": ["https://example.com/a.jpg", "https://example.com/b.jpg"],
    "preset": "standard",
})
good = [r["sourceUrl"] for r in client.dataset(run["defaultDatasetId"]).iterate_items() if r.get("passed")]
print(good)
```

**JavaScript: show the user why a photo was rejected**

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: '<YOUR_APIFY_TOKEN>' });
const run = await client.actor('adorable_partial/image-quality-checker').call({
    imageUrls: ['https://example.com/upload.jpg'],
});
const [r] = (await client.dataset(run.defaultDatasetId).listItems()).items;
if (!r.passed) console.log(`Please retake the photo: ${r.issues.join(', ')}`);
```

**HTTP**

```bash
curl -X POST "https://api.apify.com/v2/acts/adorable_partial~image-quality-checker/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://example.com/photo.jpg"]}'
```

**No-code and agents:** check new uploads with **Make**, **Zapier** or **n8n**, chain it after a scraper with an integration, or let an AI agent judge photos through the **Apify MCP server**.

### FAQ

**My product photos on white background are flagged as overexposed.** White backgrounds have many pure-white pixels. Raise `maxClippedPercent` (e.g. 60) or add `overexposed` to *ignoreIssues*.

**Night photos are flagged as too dark.** That is the intended signal; use the *lenient* preset or lower `minBrightness` for night content.

**Does it judge composition or aesthetics?** No. It measures technical quality (focus, exposure, noise, size, duplicates), which is objective and explainable.

**Are duplicates checked against previous runs?** Only within one run. Each row includes its `phash`, so you can compare across runs in your own database (Hamming distance).

**Is my data kept?** Images are processed inside the run and not stored; only the measurements are saved in your dataset.

### Related Actors

- [EXIF & GPS Cleaner](https://apify.com/adorable_partial/exif-gps-cleaner) — read and remove hidden photo metadata, losslessly
- [Image & Video Anonymizer](https://apify.com/adorable_partial/image-anonymizer) — blur faces and license plates
- [Video Frame Extractor for AI](https://apify.com/adorable_partial/video-frame-extractor-ai) — sharp, de-duplicated frames from videos
- [Face Compare](https://apify.com/adorable_partial/face-compare) — face verification and embeddings

### Support

A photo judged wrongly? Open an issue in the **Issues** tab with the image link and the result.

### Need a different tool? Request it

Missing a feature, an input or output format, or a whole different tool for your workflow? **Open an issue in the Issues tab** and describe what you need:

- what goes in (files, URLs, data) and what should come out,
- roughly how much you process (per day or month),
- one example, if you can share it.

Requests with a real use case get built, either as a new option in this Actor or as a new Actor in [this collection](https://apify.com/adorable_partial), and you get notified in the issue when it's live. Every request is read.

# Actor input Schema

## `imageUrls` (type: `array`):

Photos to check (JPEG, PNG, WebP, BMP, TIFF), up to 100 MB each. Public Google Drive and Dropbox links work.

## `preset` (type: `string`):

A ready-made set of thresholds. Any threshold you fill in below overrides it.

## `ignoreIssues` (type: `array`):

An image passes when it has no issue except these. Example: ignore 'low resolution' for thumbnails. Every issue is still reported.

## `findDuplicates` (type: `boolean`):

Mark images that look the same as an earlier image in this run (also resized or re-compressed copies).

## `duplicateDistance` (type: `integer`):

Perceptual-hash distance (0-64) up to which two images count as duplicates. 0 = identical only, 6 = resized/re-saved copies (default), 12 = similar shots.

## `minSharpness` (type: `string`):

Contrast-normalised sharpness. Sharp photos usually score 30-200, blurry ones under 10. Preset: 20.

## `minBrightness` (type: `string`):

Average brightness below this = too dark. Preset: 40.

## `maxBrightness` (type: `string`):

Average brightness above this = overexposed. Preset: 215.

## `maxClippedPercent` (type: `string`):

Share of pure black or pure white pixels allowed. Preset: 15.

## `minContrast` (type: `string`):

Standard deviation of brightness. Preset: 25.

## `maxNoise` (type: `string`):

Noise level measured in smooth areas. Preset: 1.0.

## `minShortSide` (type: `string`):

Smaller images are flagged as low resolution. Preset: 480.

## Actor input object example

```json
{
  "imageUrls": [
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/01-sharp.jpg?signature=nwz62lB2dOzt3yeaZjSW",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/02-blurry.jpg?signature=10TxYh3cjSgLz2vFCswsZ",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/03-motion-blur.jpg?signature=1BtmzBwGnw9B0BardrqHa",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/04-dark.jpg?signature=35dOGzC81XPYFhrbYa0s",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/05-duplicate-resized.jpg?signature=1nx92yEWecZcyupRqR4zD"
  ],
  "preset": "standard",
  "findDuplicates": true,
  "duplicateDistance": 6
}
```

# Actor output Schema

## `results` (type: `string`):

One row per image: pass/fail, score, issues and measurements.

## `summary` (type: `string`):

Passed, failed and duplicate counts.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "imageUrls": [
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/01-sharp.jpg?signature=nwz62lB2dOzt3yeaZjSW",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/02-blurry.jpg?signature=10TxYh3cjSgLz2vFCswsZ",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/03-motion-blur.jpg?signature=1BtmzBwGnw9B0BardrqHa",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/04-dark.jpg?signature=35dOGzC81XPYFhrbYa0s",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/05-duplicate-resized.jpg?signature=1nx92yEWecZcyupRqR4zD"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("adorable_partial/image-quality-checker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "imageUrls": [
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/01-sharp.jpg?signature=nwz62lB2dOzt3yeaZjSW",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/02-blurry.jpg?signature=10TxYh3cjSgLz2vFCswsZ",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/03-motion-blur.jpg?signature=1BtmzBwGnw9B0BardrqHa",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/04-dark.jpg?signature=35dOGzC81XPYFhrbYa0s",
        "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/05-duplicate-resized.jpg?signature=1nx92yEWecZcyupRqR4zD",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("adorable_partial/image-quality-checker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "imageUrls": [
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/01-sharp.jpg?signature=nwz62lB2dOzt3yeaZjSW",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/02-blurry.jpg?signature=10TxYh3cjSgLz2vFCswsZ",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/03-motion-blur.jpg?signature=1BtmzBwGnw9B0BardrqHa",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/04-dark.jpg?signature=35dOGzC81XPYFhrbYa0s",
    "https://api.apify.com/v2/key-value-stores/NzPquBDefCOqPzYwD/records/05-duplicate-resized.jpg?signature=1nx92yEWecZcyupRqR4zD"
  ]
}' |
apify call adorable_partial/image-quality-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,adorable_partial/image-quality-checker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/n7rElc7ngx8ITSKSi/builds/zSRcgn7hta7QRfasS/openapi.json
