presidio-image-redactor
Presidio image redactor package
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-redactoruv
uv add presidio-image-redactorpoetry
poetry add presidio-image-redactorInstalling 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
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
argus-redactDetects and redacts personally identifiable…
permissive · top 15,000 on PyPI
presidio-analyzerDetects personally identifiable information…
permissive · top 5,000 on PyPI
presidio-anonymizerReplaces detected PII text entities with…
permissive · top 5,000 on PyPI
openmedExtracts medical entities and personally…
permissive · top 5,000 on PyPI
scrubadubDetects and replaces personally identifiable…
permissive · top 5,000 on PyPI
highdicomHighdicom provides a high-level Python API for…
permissive · top 15,000 on PyPI
pydicomPydicom reads, modifies, and writes DICOM…
permissive · top 5,000 on PyPI
azure-ai-vision-imageanalysisCalls Azure's Computer Vision service to…
permissive · top 15,000 on PyPI
keras-ocrkeras-ocr detects and recognizes text in images…
permissive · top 15,000 on PyPI
dicom2niftiConverts DICOM medical imaging files to NIfTI…
permissive · top 15,000 on PyPI