# Blur Faces in Photos – Bulk Image Anonymizer for GDPR (`gazidev/image-anonymizer`) Actor

Blur or pixelate every face in your images in bulk before you publish them: real-estate photos, street scenes, event galleries and datasets. Faces are found on CPU with the open YuNet detector. Blur, pixelate or solid box; JPG, PNG or WebP with public links. No API key. $2 per 1,000 images.

- **URL**: https://apify.com/gazidev/image-anonymizer.md
- **Developed by:** [Cemal Atakli](https://apify.com/gazidev) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 image anonymizeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Blur Faces in Photos – Bulk Image Anonymizer (GDPR Face Blur)

Blur, pixelate or black-box **every face in your photos in bulk** before you publish or share them. Paste image URLs (or chain a dataset from any scraper) and get anonymised JPG, PNG or WebP files back with direct download links, plus the face count and face boxes for each image.

Faces are found on CPU with the open-source **YuNet** face detector (OpenCV Zoo, MIT). No API key, no third-party AI service, no upload of your photos anywhere else. **$2 per 1,000 images.**

### What it does

- Detects faces in each image, including small faces in crowds: large photos are scanned as a whole **and** in overlapping tiles at full resolution.
- Hides every face with one of three modes:
  - **Blur** (Gaussian, strength relative to face size): looks natural;
  - **Pixelate** (mosaic): the classic news look;
  - **Solid box** (any colour): strict redaction.
- Rectangle or oval shape, adjustable margin so hair, ears and chin are covered.
- **Strips EXIF metadata by default** (GPS location, camera serial, timestamps), which is usually also personal data. Orientation is applied to the pixels first, so boxes always match what viewers see.
- Returns `outputUrl` (public link), `faces`, `boxes` \[\[x, y, w, h], ...] and the image size.
- Reads JPG, PNG, WebP, HEIC/HEIF (iPhone), TIFF, BMP and AVIF. Keeps PNG/WebP transparency.

### Use cases

- **Real-estate and property listings**: remove passers-by and residents from street and interior photos.
- **Street-level, drone and survey imagery** before publishing.
- **Event galleries, school and club photos** for websites and newsletters where not everyone consented.
- **Machine-learning datasets**: anonymise people before sharing or labelling.
- **Journalism, research and public-sector** photo releases.

### Input example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/4e/Landsat_7_Enhanced_Thematic_Mapper_Plus_%28ETM%2B%29_Team_Photo.jpg"
  ],
  "mode": "blur",
  "strength": 25,
  "marginPct": 20,
  "minFacePx": 12,
  "outputFormat": "same"
}
```

Other sources: `bulkText` (one URL per line or a CSV), `sourceFileUrl` (public .txt/.csv), or `datasetId` + `datasetField` to read URLs from another Actor's dataset.

### Output example

```json
{
  "input": "https://upload.wikimedia.org/.../Landsat_7_..._Team_Photo.jpg",
  "status": "anonymized",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<id>/records/00001-Landsat_7_...-anon.jpg",
  "faces": 56,
  "boxes": [[490, 175, 14, 17], [630, 178, 13, 16], "..."],
  "width": 1280,
  "height": 849,
  "format": "jpg",
  "mode": "blur",
  "metadataStripped": true,
  "outputKb": 310.6
}
```

Failed items have `status: "error"`, an `errorCode` (for example `HTTP_404`, `NOT_AN_IMAGE`, `TOO_LARGE`, `PRIVATE_HOST`) and are free. The `OUTPUT` record in the key-value store holds the run summary (images, faces total, errors, max-charge stop).

### Pricing

| Event | Price |
|---|---|
| Image anonymised (one output image saved) | $0.002 ($2 per 1,000) |
| Actor start | $0.00005 |

**An image is charged when it was checked and saved, also when no face was found** (the check is the work, and "no faces" is an answer). Free: failed downloads, non-images, too-large files, invalid URLs and duplicates. If you set a maximum total charge, the run stops cleanly when it is reached (`OUTPUT.stoppedAtMaxCharge: true`).

| Actor (Apify Store, Nov 2026) | Price per image | Notes |
|---|---|---|
| **This Actor** | **$0.002** | faces only; blur / pixelate / box; EXIF stripped |
| jumblemog/face-blur | $0.003 | photos and videos |
| adorable_partial/image-anonymizer | $0.0035–0.005 + $0.00125 start | faces and licence plates, photos and videos |

### Limits (honest)

- **Faces only.** Licence plates, name tags, screens and tattoos are **not** detected (the open plate detectors are either AGPL-licensed or unreliable). Use a rival above if you need plates.
- **No detector is perfect.** Very small (under ~10 px), heavily blurred, strongly turned (profile, back of the head), masked or partly covered faces can be missed, and face-like patterns can occasionally get a box. Lower `confidencePct` (e.g. 45) and `minFacePx` to catch more; always review images for sensitive publications.
- Still images only (no video, no animated GIF/WebP).
- Images above ~24 MP per 1 GB of run memory are skipped for free (24 MP at the default 1024 MB). Raise the memory and `maxMegapixels` for bigger photos.
- Inputs must be public direct image links; private-network addresses are refused.

### Privacy

The Actor only locates faces (boxes). It never recognises, identifies, compares or embeds faces, and it does not store anything outside your own Apify run storage. Output images are saved in your run's key-value store; delete the run storage if you do not want to keep them.

### FAQ

**Is a blurred face really unrecognisable?** At the default strength 25 the blur radius is about half the face size, which removes features. For strict redaction use `mode: "box"`.

**Why was I charged for an image with 0 faces?** The image was downloaded, checked and saved; that is the same work. Check `faces` and `note` in the row.

**Can I get only the face boxes?** Yes: `boxes` lists \[x, y, width, height] in pixels of the (orientation-corrected) output image.

**Where are the files?** In the run's key-value store. `outputUrl` is a direct download link; the Storage tab lists all files.

### Related Actors by gazidev

- [AI Image Upscaler & Photo Restoration](https://apify.com/gazidev/image-upscaler) does the opposite: it sharpens and restores faces (same YuNet detector).
- [Image Compressor](https://apify.com/gazidev/image-compressor) shrinks files; [Bulk Image Converter](https://apify.com/gazidev/image-converter) changes formats and sizes.
- [Image Metadata & EXIF Extractor](https://apify.com/gazidev/image-metadata-extractor) shows which EXIF/GPS data your photos carry before you anonymise them.
- [Watermark Adder](https://apify.com/gazidev/watermark-adder) stamps a logo or text on images in bulk.

This listing is the only one of ours that **hides** people in photos; the others enhance, convert or label them.

### Use with AI agents (Apify MCP)

Add this Actor to an MCP client through the Apify MCP server (`https://mcp.apify.com`, tool `gazidev/image-anonymizer`). An agent can pass `imageUrls` with `mode` and read `outputUrl`, `faces` and `boxes` from the dataset, or the `OUTPUT` summary record.

# Actor input Schema

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

Direct links to JPG, PNG, WebP, HEIC/HEIF, TIFF, BMP or AVIF photos. Duplicates are removed; invalid values and failed downloads are reported for free. Only public internet addresses are fetched.

## `bulkText` (type: `string`):

One URL per line, or a CSV with a `url` / `image` column.

## `sourceFileUrl` (type: `string`):

Public .txt or .csv link (Google Sheets 'Publish to web → CSV' works).

## `datasetId` (type: `string`):

Chain after a scraper that collects photo URLs (listings, galleries, street-level images).

## `datasetField` (type: `string`):

Arrays of URLs are accepted too.

## `mode` (type: `string`):

Blur looks natural; pixelate is the classic news look; a solid box is the safest for strict redaction.

## `strength` (type: `integer`):

Blur radius and pixel block size relative to each face. 25 makes faces unrecognisable; raise it for large, sharp faces. Ignored for 'Solid box'.

## `marginPct` (type: `integer`):

Grows each detected box so hair, ears and chin are covered too (a bit more on top).

## `shape` (type: `string`):

Rectangle covers more; an oval looks softer.

## `boxColor` (type: `string`):

Hex colour, e.g. #000000 or #ffffff.

## `minFacePx` (type: `integer`):

Faces narrower than this are ignored. Very small, blurry or strongly turned faces (profiles, backs of heads) can be missed by any detector: check the results for sensitive publications.

## `confidencePct` (type: `integer`):

Lower it (e.g. 45) to catch more faces at the cost of some false boxes on face-like objects; raise it for fewer false boxes.

## `outputFormat` (type: `string`):

HEIC, TIFF, BMP and AVIF become JPG (PNG when transparent).

## `quality` (type: `integer`):

Encoder quality for JPG and WebP output.

## `keepMetadata` (type: `boolean`):

Off (default) strips EXIF, including GPS location, camera serial and timestamps: usually what you want when anonymising. The colour profile is kept.

## `maxImages` (type: `integer`):

Stop after this many images. 0 = no limit.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped for free.

## `maxMegapixels` (type: `integer`):

Larger images are skipped for free. The Actor also caps this at about 24 MP per 1 GB of memory (24 MP at the default 1024 MB): raise memory for very large photos.

## `maxConcurrency` (type: `integer`):

Lower it for slow or rate-limited hosts.

## `proxyConfiguration` (type: `object`):

Only needed if an image host blocks datacenter IPs.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/4/4e/Landsat_7_Enhanced_Thematic_Mapper_Plus_%28ETM%2B%29_Team_Photo.jpg",
    "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Astronaut_group_portrait_onboard_STS-51-G.jpg/1280px-Astronaut_group_portrait_onboard_STS-51-G.jpg"
  ],
  "datasetField": "url",
  "mode": "blur",
  "strength": 25,
  "marginPct": 20,
  "shape": "rect",
  "boxColor": "#000000",
  "minFacePx": 12,
  "confidencePct": 60,
  "outputFormat": "same",
  "quality": 90,
  "keepMetadata": false,
  "maxImages": 100,
  "maxFileSizeMb": 30,
  "maxMegapixels": 60,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

No description

## `files` (type: `string`):

No description

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

No description

# 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://upload.wikimedia.org/wikipedia/commons/4/4e/Landsat_7_Enhanced_Thematic_Mapper_Plus_%28ETM%2B%29_Team_Photo.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Astronaut_group_portrait_onboard_STS-51-G.jpg/1280px-Astronaut_group_portrait_onboard_STS-51-G.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("gazidev/image-anonymizer").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://upload.wikimedia.org/wikipedia/commons/4/4e/Landsat_7_Enhanced_Thematic_Mapper_Plus_%28ETM%2B%29_Team_Photo.jpg",
        "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Astronaut_group_portrait_onboard_STS-51-G.jpg/1280px-Astronaut_group_portrait_onboard_STS-51-G.jpg",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("gazidev/image-anonymizer").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://upload.wikimedia.org/wikipedia/commons/4/4e/Landsat_7_Enhanced_Thematic_Mapper_Plus_%28ETM%2B%29_Team_Photo.jpg",
    "https://upload.wikimedia.org/wikipedia/commons/thumb/5/5b/Astronaut_group_portrait_onboard_STS-51-G.jpg/1280px-Astronaut_group_portrait_onboard_STS-51-G.jpg"
  ]
}' |
apify call gazidev/image-anonymizer --silent --output-dataset

```

## MCP server setup

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

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/qAL1yeSxgelykmzLQ/builds/v7V9fZlWbn77GP23X/openapi.json
