Presidio image redactor package
Actively maintained. Last release 5 weeks ago, commits in 23 of the last 26 weeks. A safe choice.
pip install presidio-image-redactorPresidio Image Redactor
Description
The Presidio Image Redactor is a Python based module for detecting and redacting PII text entities in images.
Deploy Presidio image redactor to Azure
Use the following button to deploy presidio image redactor to your Azure subscription.
Process for standard images:

Process for DICOM files:

Installation
Pre-requisites:
-
Install Tesseract OCR by following the instructions on how to install it for your operating system.
For best performance, please use the most up-to-date version of Tesseract OCR. Presidio was tested with v5.2.0.
As package
To get started with Presidio-image-redactor, run the following:
pip install presidio-image-redactor
Once Installed, run the following command to download the default spacy model needed for Presidio Analyzer:
python -m spacy download en_core_web_lg
Getting started (standard image types)
The engine will receive 2 parameters:
- Image to redact.
- Color fill to redact with, by default color fill will be black. Can either be an int or tuple (0,0,0)
from PIL import Image
from presidio_image_redactor import ImageRedactorEngine
# Get the image to redact using PIL lib (pillow)
image = Image.open("presidio-image-redactor/tests/integration/resources/ocr_test.png")
# Initialize the engine
engine = ImageRedactorEngine()
# Redact the image with pink color
redacted_image = engine.redact(image, (255, 192, 203))
# save the redacted image
redacted_image.save("new_image.png")
# uncomment to open the image for viewing
# redacted_image.show()
As docker service
In folder presidio/presidio-image-redactor run: