# Face Blur: Blur Faces in Photos & Videos (`jumblemog/face-blur`) Actor

Automatically find and blur every face in photos and videos for privacy and GDPR compliance. Blur, pixelate or black out faces, with tracking in videos and crowd-ready detection in photos. Returns face positions too. JPEG, PNG, HEIC, MP4, MOV and more.

- **URL**: https://apify.com/jumblemog/face-blur.md
- **Developed by:** [Jumble Mog](https://apify.com/jumblemog) (community)
- **Categories:** AI, Videos, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Face Blur: Blur Faces in Photos & Videos

**Automatically find and hide every face** in photos and videos. Upload or link your files, pick blur, pixelate or a black oval, and get back privacy-safe copies ready to publish, share or store. Built for crowds and for video: small faces in the back of a group photo are searched for at several sizes, and faces in videos are tracked from frame to frame so they stay covered when people move or turn. No API key, no GPU and no editing software.

![A 1940s crowd photo before and after: 15 faces are found and blurred](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/face-blur-crowd.jpg?signature=W9xkpnk84s4fA4balsJ1)

![The same group with faces blurred, pixelated and covered with black ovals](https://api.apify.com/v2/key-value-stores/Km5b4PG3kYHdZSb1E/records/face-blur-styles.jpg?signature=1hcrWia9PnL9XUTqcu7YG)

*Samples: Pie Town, New Mexico, 1940, by Russell Lee (Library of Congress, no known restrictions). Default settings.*

### What it does

- **Finds faces in crowds**: photos are searched at full size and again enlarged (small photos) or tile by tile (large photos), so small and distant faces are found much more reliably than in a single pass. Faces looking at the camera or turned partly away are found, including small, dark and slightly blurry ones.
- **Hides them three ways**: a strong, smooth **blur** that looks natural, chunky **pixelation**, or a solid **black oval**. The hidden area covers the face with hair and ears, and you can make it bigger.
- **Blurs whole videos**: every frame is processed. Faces are detected about ten times a second and kept covered between detections and for half a second after a face is lost, so a face that turns away or is briefly missed stays hidden. Sound is kept.
- **Returns face positions**: each photo comes with a list of faces (x, y, width, height, confidence). Turn on **only find faces** to count faces or feed your own pipeline without saving edited copies.
- **Keeps your format**: JPEG stays JPEG, PNG stays PNG, WebP stays WebP (other formats become JPEG). Videos come back as MP4 (H.264 + AAC) up to 1080p, upright even when the phone stored them sideways.
- **Takes files from anywhere**: direct links, Google Drive and Dropbox share links, or uploads. Photos in JPEG, PNG, WebP, HEIC (iPhone), TIFF, BMP and GIF; videos in MP4, MOV, MKV, WebM, AVI and more, up to 2 GB and 2 hours.
- **Fair billing**: you pay per photo and per minute of video. Files that fail cost nothing.

### Who it's for

- **Publishers, journalists and bloggers** who need to protect bystanders, minors or sources before publishing.
- **Real estate, street and event photographers** cleaning up passers-by in their shots.
- **Dashcam, drone, bodycam and CCTV footage** that has to be anonymized before sharing.
- **Schools, clubs and companies** posting event photos without the faces of people who didn't agree.
- **Machine learning teams** anonymizing image and video datasets under GDPR and similar privacy rules.
- **Developers and AI agents** adding automatic face anonymization to upload flows and content pipelines.

### How to use it

1. Paste links to photos or videos, or upload them.
2. Choose how to hide faces (blur by default). For crowds, choose **high** sensitivity.
3. Click **Start**. Each result appears in the **Output** tab with a download link and the number of faces hidden.

You can also run it through the [Apify API](https://docs.apify.com/api/v2), on a schedule, or from Make, n8n, Zapier and other integrations.

### How-to examples

Each example below is a complete input, checked with a run of the Actor.

#### How to blur or pixelate faces in photos automatically

```json
{"mediaUrls": ["https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/messi5.jpg"], "style": "pixelate"}
```

Result: `"facesFound": 2`, each with its box and confidence, and a copy of the photo with both faces pixelated in `outputUrl`. It took 0.24 seconds. Use `"style": "black"` for a black oval, or `"sensitivity": "high"` to also catch small, dark or half-turned faces.

#### How to blur faces in a video

```json
{"mediaUrls": ["https://example.com/videos/dashcam-0412.mp4"], "style": "blur"}
```

Result: a blurred copy of the video in `outputUrl`, with `frames`, `framesWithFaces`, `durationSeconds` and `minutesBilled`. A 4-second test clip came back with 100 of 100 frames blurred in 0.7 seconds. Faces are followed from frame to frame, so a face doesn't flash into view when the detector misses it for a frame.

#### How to find faces without changing the photo

```json
{"mediaUrls": ["https://raw.githubusercontent.com/opencv/opencv/4.x/samples/data/lena.jpg"], "detectOnly": true}
```

Result: `"facesFound": 1, "faces": [{"x": 202, "y": 187, "width": 155, "height": 218, "confidence": 0.915}]` and no edited file, so you can count people or draw your own boxes.

#### How to let an AI agent anonymize photos and videos

Add this Actor to the [Apify MCP server](https://mcp.apify.com) with `https://mcp.apify.com/?tools=jumblemog/face-blur`. The agent sends the links in `mediaUrls` and gives the user `outputUrl`. `facesFound` tells it whether there was anything to hide.

### FAQ

**Is it for GDPR or privacy redaction?** It hides faces in photos and video, which is what most privacy rules ask for when people in the footage haven't agreed to be shown. Check the results before you publish them: no detector finds every face.

**Are my files kept or used for training?** No. They are processed in your own Apify run and stay in your run storage until it expires. Nothing is sent to an outside service.

**Which files work?** JPEG, PNG, WebP and HEIC photos and common video files such as MP4 and MOV, from links, Google Drive or Dropbox, or uploads.

**Does it blur license plates?** No, only faces.

**Does it work with Zapier, Make or n8n?** Yes. Call the Actor with its Apify app or an HTTP request, and pass on `outputUrl`.

### Input

| Field | What it does |
| --- | --- |
| `mediaUrls` | Links to photos or videos, or Google Drive and Dropbox share links. |
| `files` | Files uploaded from your computer or picked from an Apify key-value store. |
| `style` | `blur` (default), `pixelate` or `black`. |
| `sensitivity` | `normal` (default), `high` to catch small, dark or half-turned faces (may also hide a few things that only look like faces), or `low` for clear faces only. |
| `marginPercent` | Extra area around each face, in percent of its size (default 25). |
| `detectOnly` | `true` returns face positions for photos without saving edited copies. |
| `maxFiles` | Stop after this many files (default 100). |

Example:

```json
{
  "mediaUrls": [
    "https://example.com/photos/street-market.jpg",
    "https://example.com/videos/dashcam-0412.mp4",
    "https://drive.google.com/file/d/YOUR_FILE_ID/view?usp=sharing"
  ],
  "style": "blur",
  "sensitivity": "high"
}
```

### Output

Each file becomes one dataset item, and the edited file is saved in the run's key-value store. A photo:

```json
{
  "url": "https://example.com/photos/street-market.jpg",
  "status": "ok",
  "error": null,
  "type": "photo",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/001-street-market-blurred.jpg?signature=...",
  "fileName": "001-street-market-blurred.jpg",
  "facesFound": 2,
  "faces": [
    {"x": 412, "y": 160, "width": 58, "height": 74, "confidence": 0.91},
    {"x": 903, "y": 188, "width": 41, "height": 52, "confidence": 0.84}
  ],
  "width": 1600,
  "height": 1067,
  "style": "blur",
  "processingSeconds": 0.9
}
```

A video adds `durationSeconds`, `minutesBilled`, `frames`, `framesWithFaces` and `fps`, and `facesFound` is the most faces seen in one frame:

```json
{
  "url": "https://example.com/videos/dashcam-0412.mp4",
  "status": "ok",
  "type": "video",
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<store>/records/002-dashcam-0412-blurred.mp4?signature=...",
  "facesFound": 3,
  "width": 1920,
  "height": 1080,
  "durationSeconds": 42.5,
  "minutesBilled": 1,
  "frames": 1275,
  "framesWithFaces": 1190,
  "fps": 30
}
```

A file that couldn't be downloaded or read gets `status: "failed"` and an `error` that says why, and isn't billed. Download your files within your plan's data retention period, or copy them to your own storage, because run storage expires.

### Pricing

You pay per file processed, at the prices shown on this page:

- **Photo processed**: each photo, also in find-only mode.
- **Minute of video processed**: each started minute of video. A 10-minute video is 10 minutes; a 20-second clip is 1 minute.

Files that fail are never charged. If you set a maximum cost per run, the Actor stops before a file that wouldn't fit.

### Speed

Measured on Apify at the default 4 GB of memory:

- **Photos** take about half a second each, plus the download. Large photos searched tile by tile take a second or two.
- **Videos** take one to two times their length at 1080p: a 20-second 1080p clip took 18 seconds and a 2.5-minute one under 5 minutes. Smaller videos are much quicker (a 25-second 360p clip took 16 seconds including the download). Giving the run more memory gives it more CPU, which speeds video up.

### Tips and limits

- This Actor **finds faces; it doesn't recognize anyone**. It never compares faces or works out who a person is.
- Faces seen from behind, fully in profile, covered by masks or helmets, or smaller than about 10 pixels may be missed. Use **high** sensitivity for crowds and check important files before you publish them: automatic blurring helps you meet privacy rules, but you stay responsible for what you share.
- Blurred faces can't be restored from the output. Keep your originals if you might need them.
- Videos are re-encoded to H.264 MP4. Inputs above 1080p are rendered at 1080p (vertical videos at 1080 x 1920). Only the first audio track is kept.
- Photos above 25 megapixels are reduced to 25 megapixels first.
- Links to YouTube, TikTok, Instagram, Facebook, X, LinkedIn and Pinterest aren't supported, because those platforms' terms don't allow downloading. Use your own copy of the file.

### For AI agents and developers

This Actor works with the [Apify MCP server](https://mcp.apify.com), so AI agents can call it as a tool: pass `mediaUrls` and read `outputUrl` (or `faces`) from each dataset item. Every item has the same documented fields, and `status` tells you whether a file succeeded. For a direct API call:

```bash
curl -X POST "https://api.apify.com/v2/acts/jumblemog~face-blur/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"mediaUrls": ["https://example.com/photo.jpg"], "style": "pixelate"}'
```

### Privacy

Files are downloaded into the run, processed there and saved only to your own Apify storage. Nothing is sent to an outside service, and no face data is kept after the run.

### Credits

- Face detection: [YuNet](https://github.com/opencv/opencv_zoo/tree/main/models/face_detection_yunet) by Shiqi Yu and contributors (MIT license), run with [OpenCV](https://opencv.org).
- Video processing: [FFmpeg](https://ffmpeg.org) with x264.

# Actor input Schema

## `mediaUrls` (type: `array`):

Direct links to photos (JPEG, PNG, WebP, HEIC, TIFF, BMP, GIF) or videos (MP4, MOV, MKV, WebM, AVI and more), or Google Drive and Dropbox share links. Links to YouTube, TikTok, Instagram, Facebook, X, LinkedIn and Pinterest aren't supported because their terms don't allow downloading.

## `files` (type: `array`):

Upload photos or videos from your computer, or pick files you already stored in an Apify key-value store.

## `style` (type: `string`):

blur: a strong, smooth blur (looks natural). pixelate: large mosaic blocks. black: a solid black oval.

## `sensitivity` (type: `string`):

normal suits most photos and videos. high also catches small, blurry, dark or half-turned faces (best for crowds and privacy work), and may hide a few things that only look like faces. low hides only clear faces.

## `marginPercent` (type: `integer`):

How much bigger than the detected face the hidden area is. 25% covers the face with hair and ears; raise it to hide more of the head.

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

Return the position of every face in each photo without saving an edited copy. Useful to count faces or to blur them with your own tools. Videos always get blurred.

## `maxFiles` (type: `integer`):

Stop after this many files, so the cost of a run stays predictable.

## Actor input object example

```json
{
  "mediaUrls": [
    "https://tile.loc.gov/storage-services/service/pnp/fsac/1a34000/1a34100/1a34115v.jpg"
  ],
  "style": "blur",
  "sensitivity": "normal",
  "marginPercent": 25,
  "detectOnly": false,
  "maxFiles": 100
}
```

# Actor output Schema

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

One item per file: download link, faces found, size and duration.

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

The photos and videos with faces hidden, saved in the run's key-value store.

# 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 = {
    "mediaUrls": [
        "https://tile.loc.gov/storage-services/service/pnp/fsac/1a34000/1a34100/1a34115v.jpg"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("jumblemog/face-blur").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 = { "mediaUrls": ["https://tile.loc.gov/storage-services/service/pnp/fsac/1a34000/1a34100/1a34115v.jpg"] }

# Run the Actor and wait for it to finish
run = client.actor("jumblemog/face-blur").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 '{
  "mediaUrls": [
    "https://tile.loc.gov/storage-services/service/pnp/fsac/1a34000/1a34100/1a34115v.jpg"
  ]
}' |
apify call jumblemog/face-blur --silent --output-dataset

```

## MCP server setup

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

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/VHbiqooSLYaSe1ANs/builds/b5DVfuwPSpLALBSZX/openapi.json
