Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Private Face Redactor

Private Face Redactor Social Preview

A privacy-first, browser-based tool for detecting and redacting faces in images.

Private Face Redactor runs locally in your browser. Your photos are processed on your device and are not uploaded to a server. It supports automatic face detection, manual masks, several redaction effects, stamps, and image export controls.

Important: Always review the final image before sharing it. Face detection can miss faces or produce imperfect bounding boxes.

Private Face Redactor demo

Try it online

Open the hosted app:
https://ttomohisa.github.io/htmlapps-private-face-redactor/private-face-redactor.html

Or download private-face-redactor.html and open it locally.

Features

  • Local, in-browser image processing
  • Automatic face detection powered by YuNet and ONNX Runtime Web
  • Manual masks for missed faces or other sensitive areas
  • Draggable and resizable masks
  • Undo and redo support
  • Face and mask list with individual enable, edit, delete, and original-crop download actions
  • Multiple redaction effects:
    • Pixelate
    • Blur
    • Solid fill
    • Eye bar
    • Emoji
    • Custom image overlay
  • Adjustable padding around detected faces
  • Rectangle or oval mask shapes
  • Customizable eye-bar color, opacity, length, and thickness
  • Built-in stamps, text stamps, and custom image stamps
  • Zoom, pan, and mobile touch support
  • Export to JPEG, PNG, or WebP
  • Adjustable output quality and image scale
  • Pre-save output dimensions and estimated file size
  • Native sharing on supported browsers
  • Responsive UI for desktop and mobile

The app supports JPEG, PNG, and WebP images for export. Video files can be opened and previewed, but video export is not currently supported.

Quick start

  1. Open private-face-redactor.html in a modern browser.
  2. Drop a photo into the canvas area, or click Choose file.
  3. Wait for automatic face detection, or click Find faces manually.
  4. Review every detected face.
  5. Add a manual mask for anything the detector missed.
  6. Choose an effect in the bottom Effect dock.
  7. Adjust effect settings such as blur, pixel size, padding, or shape.
  8. Click Save.
  9. Review output dimensions and estimated file size.
  10. Save the redacted image.

The app works without network access after the HTML file has been downloaded.

Privacy

  • Image processing happens in the browser.
  • Images are not uploaded to an application server.
  • Face detection runs locally through the embedded ONNX Runtime Web and YuNet model.
  • Exported files are downloaded directly by the browser.
  • Saved files use the original filename with _redacted appended.

For example:

holiday-photo.jpg

becomes:

holiday-photo_redacted.jpg

Supported Effects

Effect Description Main Controls
Pixelate Covers an area with mosaic blocks Block size, padding, shape
Blur Softens facial detail Blur radius, padding, shape
Solid fill Covers an area with a selected color Color, padding, shape
Eye bar Places a configurable bar over the eyes Color, opacity, length, thickness
Emoji Places an emoji over the selected area Emoji, padding
Custom image Places a user-selected image over the selected area Overlay image, padding

Export Formats

Format Best for Notes
JPEG Photos and broad compatibility Smaller files, lossy compression
WebP Smaller web-friendly images Often smaller than JPEG
PNG Graphics, text, and lossless output Can produce larger files

The estimated file size is calculated by encoding the current redacted image in the browser using the selected format, quality, and scale. It is a practical estimate, although final file size can vary slightly between browsers.

Running Locally

This project is designed as a single HTML file.

git clone https://github.com/ttomohisa/private-face-redactor.git
cd private-face-redactor

Then open the HTML file in a modern browser:

private-face-redactor.html

Browser Requirements

Use a recent version of one of the following:

  • Google Chrome
  • Microsoft Edge
  • Mozilla Firefox
  • Safari

Recommended browser capabilities:

  • ES Modules
  • Canvas 2D API
  • File API
  • Blob and Object URL support
  • WebAssembly
  • Pointer Events
  • Web Share API for the optional Share button

Mobile Support

The interface is responsive and includes mobile-oriented controls:

  • Compact action header with mask, stamp, undo, redo, clear, share, and save actions
  • Touch-friendly resize handles
  • Zoom and pan support
  • Bottom horizontal Effect dock
  • Horizontal scrolling inside the Effect dock when settings exceed available width
  • Collapsible setup sections

Keyboard Shortcuts

Key Action
D Find faces
M Add a manual mask
Delete Delete the selected mask
Space Play or pause a loaded video

Project Structure

private-face-redactor/
└── private-face-redactor.html

The application is distributed as a self-contained HTML file that includes:

HTML UI
CSS styling
JavaScript application logic
Embedded ONNX Runtime Web assets
Embedded YuNet face-detection model

Limitations

  • Face detection is not perfect and may miss faces.
  • You must manually verify every image before sharing or publishing it.
  • Video files can be loaded and previewed, but cannot currently be exported.
  • Large images or images containing many faces may take longer to process.
  • The file-size estimate is informative, not a guaranteed final size.
  • Browser support for native sharing varies by device and browser.
  • Custom overlays and stamps depend on browser Canvas support.

Development Notes

The application maintains face masks, manual masks, stamps, selection state, and undo/redo history in browser memory. The editing overlay is rendered separately from the output Canvas, so selection borders, resize handles, and delete controls are not included in exported images.

When modifying the project, pay particular attention to:

  • Canvas coordinates versus displayed screen coordinates
  • Zoom and pan transformations
  • Responsive CSS overrides for the Effect dock
  • Asynchronous image loading and face detection
  • Object URL cleanup
  • Undo/redo snapshots
  • Preventing stale file-size estimates from replacing newer estimates

Roadmap

Potential future improvements include:

  • Unredacted-face review mode
  • Batch operations for all masks
  • Before/after comparison preview
  • Redaction presets
  • Mask duplication
  • Region-only face re-detection
  • License-plate and text detection
  • EXIF/privacy metadata controls
  • Export for redacted videos

Contributing

Contributions, bug reports, UI improvements, and privacy-focused feature ideas are welcome.

Before opening a pull request:

  1. Test on desktop and mobile screen widths.
  2. Test JPEG, PNG, and WebP exports.
  3. Verify that selection outlines are not included in output files.
  4. Verify that Undo and Redo work after mask movement, resizing, deletion, and effect changes.
  5. Confirm that the application does not require image uploads to a server.

License

Copyright (c) 2026 Tomohisa Takagi.

This project is available under the MIT License.

In short: you may use, copy, modify, and distribute it, including for commercial purposes, as long as the license notice is included with substantial copies.

Third-Party Components

This project bundles or uses the following third-party components:

Component License Redistribution notes
ONNX Runtime Web MIT License You may use, modify, and redistribute it, including in commercial projects, provided that the Microsoft copyright notice and MIT license text are included in copies or substantial portions of the software.
YuNet face detection model MIT License The face_detection_yunet directory in OpenCV Zoo, including its YuNet ONNX model files, is licensed under the MIT License. Preserve the applicable copyright and license notice when redistributing the model.
ONNX format Apache License 2.0 The ONNX project itself is Apache-2.0 licensed. This generally does not impose copyleft requirements, but its license and NOTICE requirements should be preserved if ONNX project code is redistributed.

About

A privacy-first, local-only face redactor for images with automatic face detection, blur, pixelation, eye bars, emoji overlays, and manual masks.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages