A command to mask secret information of images using OCR
Project description
A command to mask secret information of images using OCR.
Prerequisite
Python 3.3+
Languages for OCR (can be set by --lang, default is eng+jpn) must be available.
Installation
$ pip3 install masecret
You may need sudo.
masecret depends on pyocr and Pillow. If you fail to install Pillow, please see the installation instruction of Pillow.
Usage
Preparation
Create a SECRETS.txt in a current directory. Content of the file is regular expression patterns which match secret information you want to mask. You can includes multiple patterns using multi lines.
Example content of SECRETS.txt to mask AWS account number:
[-\d]{12,}
Mask Secret
Mask a single file:
$ masecret original.png masked.png
Mask multiple files (output directory must exist):
$ masecret original1.png original2.png ... masked_images/
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.