Unredact.py
a python project that removes weak redaction methods such as black text highlighted black, and putting a non-flattened image over text.
Install / Use
/learn @OpLumina/Unredact.pyREADME
PDF Redaction Auditor (Unredactor)
This script is designed to process PDF files to relveal what's under weak redaction methods by recoloring digital text and selectively removing certain unburned redaction markings
It works by creating a new document and re-inserting only the essential elements from the original.
Features
- Text Recovery: Extracts underlying digital text that might be hidden beneath redaction layers.
- Smart Box Removal: Detects images that appear to be black redaction boxes (based on brightness) and allows for their removal.
- Highlighting: Option to turn recovered text red to make it easily identifiable.
- Batch Processing: Supports individual files or entire directories.
Installation
- Install Python 3.x
Install Python - Install Git and Clone Obj
git clone https://github.com/OpLumina/unredact.py/
- Install Dependencies:
cd unredact.py python -m venv venv .\venv\Scripts\Activate pip install -r .\docs\requirements.txt
Usage:
You can run the script using command-line arguments or by following the interactive prompts.
Command Line Arguments:
python .\src\unredact.py -i <input_path> -o <output_folder> [options]
Argument Description:
-i, --input: to the input PDF file or a folder containing PDFs.
-o, --output: to the folder where processed files will be saved.
-n, --name: Custom name for the output file (Single file mode only).
-b, --bbox1 to remove black box images that aren't flattened on the pdf (default), 0 to keep them. --hl, --highlight1 to turn recovered text red (default), 0 for black.
-h, --help: Shows the contents of this README.Example
To process a folder and turn off the red highlighting:
cd <project folder>
.\venv\Scripts\Activate
python unredact.py -i ./input_pdfs -o ./cleaned_pdfs --hl 0
<pre>
Directory Structure:
├── src
| └──unredact.py
└── docs/
└── Readme.md
└── requirements.txt
---
### 2. requirements.txt
```text
pymupdf==1.23.26
``
</pre>Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
