skillfed

presidio-image-redactor

Presidio image redactor package

presidio-image-redactor v0.0.60 168.3K downloads/30d#10,450 on PyPI10,486
Permissive license MIT Active released

What it is and what it does

Presidio Image Redactor is a Python module that finds and masks PII text embedded in images and DICOM medical files. It combines OCR via pytesseract with named-entity recognition via spacy and presidio-analyzer to locate sensitive text, then covers those regions with a solid color or pattern of your choice.

The package handles both standard image formats and DICOM medical imaging files. For DICOM, it redacts only pixel-level burn-in text and does not modify metadata; the documentation explicitly recommends using a separate tool for metadata scrubbing. It supports batch processing from directories and can optionally return bounding boxes of redacted regions. The module runs as a Python library or as a Docker service with an HTTP API.

Use it for:

  • Anonymize photographs or scanned documents before sharing them in research or compliance workflows.
  • Remove patient names and medical record numbers from DICOM images before publishing or archiving.
  • Batch-redact burn-in text from medical imaging studies to prepare datasets for machine learning training.
  • Build a privacy-preserving image pipeline in a web service using the HTTP API or Docker deployment.
  • Detect and mask PII in user-uploaded images to enforce data minimization policies.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Detects and redacts personally identifiable information (PII) text in images and DICOM medical files using OCR and named-entity recognition.

Yes, if you need to redact PII text from images or DICOM files. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and integrates with standard image libraries. The main gotcha is the Tesseract OCR system dependency—plan for that installation before deploying. Not suitable if you need metadata-level DICOM anonymization without a separate tool.

Install

presidio-image-redactor on PyPI

pip

pip install presidio-image-redactor

uv

uv add presidio-image-redactor

poetry

poetry add presidio-image-redactor

Installing presidio-image-redactor

Before you install

Low friction install with a pure-Python wheel. Active maintenance (last commit 2026-08-11) and no known vulnerabilities. Requires Tesseract OCR as a system dependency; documentation specifies v5.2.0 for best results.

License in practice

MIT license permits commercial and private use with minimal restrictions—suitable for most production deployments.

Quickstart

pip install presidio-image-redactor
python -m spacy download en_core_web_lg

from presidio_image_redactor import ImageRedactorEngine
from pillow import Image

image = Image.open("image.png")
engine = ImageRedactorEngine()
redacted = engine.redact(image, (255, 192, 203))
redacted.save("redacted.png")

Tesseract OCR must be installed on your system (not via pip). Documentation recommends v5.2.0. The spacy model en_core_web_lg must be downloaded after package installation.

Verify before relying

  • Actual redaction accuracy and false-positive rates for different image types and quality levels.
  • Performance characteristics (processing time per image, memory usage) at scale.
  • Whether DICOM metadata scrubbing is handled by this package or requires a separate tool as the docs suggest.

Package facts

License MIT (permissive)
Python support supports the current Python release (<3.15,>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 10 — azure-ai-formrecognizer, matplotlib, opencv-python, pillow, presidio-analyzer, pydicom, pypng, pytesseract, python-gdcm, spacy
Maintenance actively maintained — 23 days since the last release
Last repo commit
First released
Downloads 168,350/month — #10,450 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: presidio_image_redactor-0.0.60-py3-none-any.whl

Keywords: presidio_image_redactor

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

redact pii from imagesocr text detection and removaldicom image anonymizationburn-in text redactionimage privacy maskingmedical image de-identificationpii detection in photos
pii-redactionocrdicom

More Security packages