# Face Blur & Image Anonymizer (GDPR, No API Key) (`freecamp008/face-blur-anonymizer`) Actor

Automatically detect and blur, pixelate or black out faces in photos, including large group and crowd shots. Optional license plate blurring. Returns the anonymized image plus face boxes and scores. Self-hosted AI, no external APIs.

- **URL**: https://apify.com/freecamp008/face-blur-anonymizer.md
- **Developed by:** [Camp8 fr0](https://apify.com/freecamp008) (community)
- **Categories:** AI, Developer tools, For creators
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 image anonymizeds

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Face Blur & Image Anonymizer: Automatically Blur Faces and License Plates in Photos (GDPR, No API Key)

Automatically **detect and blur faces** in any photo, from a single portrait to a **large group photo or crowd**. Choose a strong blur, a pixelated mosaic or a solid black box, optionally **blur license plates** too, and get back the anonymized image plus the exact face boxes and confidence scores. The face detector runs inside the Actor (self-hosted AI, CPU), so your images are never sent to a third-party API, and all EXIF/GPS metadata is stripped from the output.

### What does Face Blur & Image Anonymizer do?

For each image URL, the Actor:

1. downloads and decodes the image (JPEG, PNG, WebP, AVIF, GIF, TIFF; EXIF rotation applied),
2. finds every face with the **YuNet** face detector, scanning the image at several scales in overlapping tiles so that small faces in big group photos are found too,
3. optionally finds **license plates** with the LPD-YuNet plate detector,
4. covers each face with an **ellipse or rectangle** that is blurred, pixelated or filled with a solid color (the effect scales with the face size),
5. saves the anonymized image (JPEG/PNG/WebP, **metadata removed**) and returns a dataset row with its link, the number of faces, and every face box with its score.

### Key features

- **Accurate face detection** with YuNet (OpenCV Model Zoo), including tilted, partly turned and small faces
- **Group photos and crowds**: multi-scale tiled scanning finds all 29 faces of the 1927 Solvay conference photo (3000 x 2171 px) in under a second of detection time
- **Three anonymization methods**: Gaussian blur, pixelate (mosaic) and solid box in any color
- **Ellipse or rectangle** masks, adjustable strength and padding (covers hair, ears and forehead)
- **License plate blurring** (experimental) with a dedicated plate detector
- **Face boxes, scores and optional 5-point landmarks** (eyes, nose, mouth corners) for your own pipelines
- **Detect-only mode** to count faces without producing an image
- **Detection preview** image with boxes and scores for quick quality checks
- **Privacy by design**: self-hosted models, no external API, EXIF/GPS metadata removed from outputs
- **HTTP API (Standby mode)** with optional base64 image in the response
- **Pay per image**; failed downloads and broken files are free

### Use cases

- **GDPR / CCPA compliance**: anonymize bystanders before publishing photos on websites, social media or in reports
- **Real estate, street-level and drone imagery**: blur passers-by and car plates
- **Dataset preparation**: anonymize faces in computer-vision training data
- **Newsrooms, NGOs and researchers**: protect identities of minors, witnesses or protesters
- **User-generated content**: auto-blur faces in uploads before moderation or sharing
- **Face counting**: count people in event photos with detect-only mode

### How to use Face Blur & Image Anonymizer

#### In Apify Console

1. Paste one or more image links into **Image URLs**.
2. Pick a **method** (blur, pixelate, solid box) and a **shape**.
3. For crowds or large photos with tiny faces, set **Detection mode** to *thorough*.
4. Click **Start**. Each result row shows the anonymized image and links to the file.

#### Via the Apify API

```bash
curl -X POST "https://api.apify.com/v2/acts/freecamp008~face-blur-anonymizer/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/6/6e/Solvay_conference_1927.jpg"], "method": "pixelate"}'
```

#### Standby mode (instant HTTP endpoint)

Standby keeps the models loaded. Send the same fields as the Actor input as GET query parameters or as a POST JSON body. The response is `{ "count": n, "items": [...] }`.

```bash
## GET: arrays are comma-separated
curl "https://freecamp008--face-blur-anonymizer.apify.actor/?token=YOUR_APIFY_TOKEN&imageUrls=https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg&method=blur"

## POST: also return the anonymized image as base64
curl -X POST "https://freecamp008--face-blur-anonymizer.apify.actor/?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"imageUrls": ["https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg"], "method": "blackbox", "shape": "rectangle", "returnBase64": true}'
```

**AI agents can pay per call:** the Actor uses pay-per-event pricing and only default storages, so AI agents can call it and pay per request with **x402** through Apify.

### Input example

```json
{
  "imageUrls": ["https://upload.wikimedia.org/wikipedia/commons/6/6e/Solvay_conference_1927.jpg"],
  "method": "blur",
  "shape": "ellipse",
  "strength": 60,
  "paddingPercent": 20,
  "minConfidence": 0.6,
  "detectionMode": "balanced",
  "blurLicensePlates": false,
  "detectOnly": false,
  "savePreview": false,
  "includeLandmarks": false,
  "outputFormat": "jpeg",
  "outputQuality": 90,
  "maxSidePx": 4096
}
```

| Field | Description |
|---|---|
| `imageUrls` | Image links. One result per image. |
| `method` | `blur`, `pixelate` or `blackbox` (solid fill with `boxColor`). |
| `shape` | `ellipse` or `rectangle` for faces (plates are always rectangles). |
| `strength` | 1-100, blur / mosaic strength relative to the face size. |
| `paddingPercent` | Grow each face box by this percentage (default 20). |
| `minConfidence` | Face score threshold (default 0.6). Lower finds more faces but also more false positives. |
| `detectionMode` | `fast` (one pass), `balanced` (default, up to 3 scales) or `thorough` (up to full resolution). |
| `blurLicensePlates` | Also blur license plates (experimental). `plateMinConfidence` sets their threshold. |
| `detectOnly` | Only return boxes and counts, no output image. |
| `savePreview` | Save a copy with boxes and scores drawn (`previewUrl`). |
| `includeLandmarks` | Add 5 facial landmarks per face. |
| `outputFormat` / `outputQuality` | `jpeg`, `png` or `webp`, and quality 1-100. |
| `maxSidePx` | Larger images are downscaled first (default 4096). |
| `returnBase64` | Standby only: include the image as base64 in the response. |

### Output example

```json
{
  "imageUrl": "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg",
  "faceCount": 4,
  "outputUrl": "https://api.apify.com/v2/key-value-stores/STORE_ID/records/ee4601f84cf2edce-anonymized",
  "faces": [
    { "x": 503, "y": 88, "width": 43, "height": 57, "score": 0.931 },
    { "x": 540, "y": 54, "width": 34, "height": 42, "score": 0.872 },
    { "x": 62, "y": 66, "width": 27, "height": 32, "score": 0.868 },
    { "x": 176, "y": 41, "width": 43, "height": 67, "score": 0.818 }
  ],
  "width": 800,
  "height": 533,
  "originalWidth": 800,
  "originalHeight": 533,
  "method": "blur",
  "detectionMode": "balanced",
  "tilesScanned": 3,
  "outputFormat": "jpeg",
  "outputBytes": 62790,
  "detectionMs": 46,
  "processingMs": 111
}
```

- Face boxes are in pixels of the output image (which equals the input unless it was downscaled by `maxSidePx`). `score` is the detector confidence (0-1).
- With `blurLicensePlates` on, results also contain `plateCount` and `plates`.
- Failed images produce `{ "imageUrl": "...", "error": "...", "isError": true }` and are **not charged**.

### Pricing

This Actor uses **pay-per-event** pricing:

| Event | Price | Per 1,000 |
|---|---|---|
| `image-anonymized`: one image scanned and saved anonymized (or analyzed in detect-only mode) | $0.003 | **$3.00** |

Images without faces are still charged, because they were fully scanned (and their metadata removed). Failed downloads and unreadable files are free. Apify platform usage (compute, storage) is billed separately according to your plan. Use **Maximum cost per run** to cap spending.

### FAQ

**How accurate is the face detection?**
YuNet detects frontal and moderately turned faces down to about 10-15 pixels wide. *Balanced* mode finds the faces in typical group photos; use *thorough* for crowds or very large images. Faces seen strictly from behind or in full profile, heavily occluded faces and very blurry faces can be missed, so always review sensitive material. Lower `minConfidence` (e.g. 0.4) to catch more faces at the cost of occasional false positives (for anonymization a few extra blurred patches are usually acceptable; the detector sometimes fires on animal faces).

**How well does license plate blurring work?**
It is experimental. The plate model (LPD-YuNet) was trained on Chinese plates. In our tests it found single-row plates from several countries (Argentina, Mexico, Portugal, some French plates) but missed some long EU-style plates. Check the results when it matters.

**Can the blur be reversed?**
The blur and pixelation are strong and scale with the face size, but for maximum safety (e.g. legal or journalistic use) choose `blackbox`, which replaces the pixels completely.

**What are the limits?**
Images up to 50 MB; they are downscaled to `maxSidePx` (default 4096 px). Animated GIFs use the first frame only. Video is not supported. Typical processing time is well under a second for normal photos and a few seconds for very large group photos.

**Are my images private?**
Yes. Detection and anonymization run inside your Apify run, without any external AI service. Output files are stored in the run's key-value store; their links are unguessable but public, so delete the storage or set a retention period if needed. All metadata (EXIF, GPS, camera info) is removed from the outputs.

**Does it recognize who is in the photo?**
No. The Actor only detects *where* faces are. It does not identify people, compare faces or store any biometric templates.

**Is it legal to blur faces?**
Blurring faces is a common privacy-protection measure and generally helps compliance with GDPR and similar laws. You still need the right to process and publish the images you submit, and you are responsible for checking that anonymization is complete for your use case.

**Which models and licenses are used?**
Face detection: [YuNet 2023mar](https://huggingface.co/opencv/face_detection_yunet) from the OpenCV Model Zoo, **MIT license**. License plates: [LPD-YuNet 2023mar](https://huggingface.co/opencv/license_plate_detection_yunet), **Apache-2.0**. Both allow commercial use and are bundled in the Actor image.

# Actor input Schema

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

Direct links to images (JPEG, PNG, WebP, AVIF, GIF, TIFF). Each image becomes one result with a link to the anonymized copy and the detected face boxes.

## `method` (type: `string`):

<b>blur</b>: strong Gaussian blur. <b>pixelate</b>: mosaic blocks. <b>blackbox</b>: solid fill with the box color (irreversible, strongest).

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

Cover faces with an <b>ellipse</b> (natural look) or a <b>rectangle</b> (covers more of the head). License plates are always rectangles.

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

1-100. Higher = stronger blur or bigger mosaic blocks. The effect scales with the face size, so small and large faces are equally unreadable.

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

Fill color for the <b>blackbox</b> method, as a hex color like <code>#000000</code>.

## `paddingPercent` (type: `integer`):

Grow each detected face box by this percentage on every side before anonymizing (covers hair, ears and chin). Faces also get a little extra room at the top for the forehead.

## `minConfidence` (type: `number`):

0.05-1. Faces scoring below this are ignored. Lower = catch more faces (also more false positives); higher = fewer mistakes. 0.6 is a good default for anonymization.

## `detectionMode` (type: `string`):

<b>fast</b>: one pass over the whole image (portraits, few large faces). <b>balanced</b>: adds 1-2 higher-resolution passes in overlapping tiles (group photos). <b>thorough</b>: scans tiles up to full resolution (crowds, tiny faces in large photos; slower).

## `blurLicensePlates` (type: `boolean`):

Also detect and anonymize vehicle license plates. The plate model was trained mainly on Chinese plates: it works on many single-row plates worldwide but can miss long EU-style plates. Check results when it matters.

## `plateMinConfidence` (type: `number`):

0.05-1. License plates scoring below this are ignored.

## `detectOnly` (type: `boolean`):

Only return face (and plate) boxes and counts, without creating an anonymized image. Useful for counting faces or for your own redaction pipeline.

## `savePreview` (type: `boolean`):

Also save a copy of the original image with the detected boxes and scores drawn on it (<code>previewUrl</code>). Handy for checking results.

## `includeLandmarks` (type: `boolean`):

Add 5 facial landmarks (eyes, nose tip, mouth corners) to each face in the output.

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

Format of the anonymized image. All metadata (EXIF, GPS location, camera info) is removed from the output.

## `outputQuality` (type: `integer`):

1-100, used for JPEG and WebP.

## `maxSidePx` (type: `integer`):

Images larger than this on their longest side are downscaled first. Face boxes refer to the (possibly downscaled) output image.

## `returnBase64` (type: `boolean`):

Standby HTTP API only: also include the anonymized image as a base64 string (<code>imageBase64</code>) in the response.

## Actor input object example

```json
{
  "imageUrls": [
    "https://upload.wikimedia.org/wikipedia/commons/6/6e/Solvay_conference_1927.jpg"
  ],
  "method": "blur",
  "shape": "ellipse",
  "strength": 60,
  "boxColor": "#000000",
  "paddingPercent": 20,
  "minConfidence": 0.6,
  "detectionMode": "balanced",
  "blurLicensePlates": false,
  "plateMinConfidence": 0.5,
  "detectOnly": false,
  "savePreview": false,
  "includeLandmarks": false,
  "outputFormat": "jpeg",
  "outputQuality": 90,
  "maxSidePx": 4096,
  "returnBase64": false
}
```

# Actor output Schema

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

No description

## `files` (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/6/6e/Solvay_conference_1927.jpg",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("freecamp008/face-blur-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/6/6e/Solvay_conference_1927.jpg",
        "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("freecamp008/face-blur-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/6/6e/Solvay_conference_1927.jpg",
    "https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/football-match.jpg"
  ]
}' |
apify call freecamp008/face-blur-anonymizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,freecamp008/face-blur-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/X6vG2JTO0WIT508gP/builds/hU7OLExHpdJtgIuIN/openapi.json
