A modern Windows desktop application for inverting PDF colours, with batch conversion, live preview, drag-and-drop, and optional English + Malayalam OCR.
PDF Color Inverter is useful in a few practical situations:
- Dark-mode reading: Invert a white-background PDF to create a dark-background copy that is easier to read in low light.
- Printing: Invert a dark or black-background PDF to create a white-background copy that uses less ink or toner.
- Accessibility and personal preference: Some documents are simply more comfortable to read with inverted colours, depending on the display and lighting.
1.1.0
| Mode | Best for | What happens |
|---|---|---|
| Keep text (vector) | Normal digital PDFs | Adds a Difference-blend layer to each page. Colours are inverted while text, links, and vector graphics stay intact. Output files stay small. |
| Rasterize | Scanned PDFs, maximum viewer compatibility, OCR | Renders every page at the chosen DPI, inverts the bitmap, and rebuilds the PDF. Output is larger and text becomes part of the image (unless OCR is enabled). |
OCR is available in Rasterize mode only. It adds invisible, searchable text on top of the inverted pages.
- Vector-preserving inversion that keeps text selectable and links working
- Rasterized inversion for scanned documents and maximum compatibility
- Batch conversion of multiple PDFs
- Add individual files or an entire folder
- Native Windows drag-and-drop, including dropped folders
- Live inverted page preview with page navigation
- Per-file progress, status, and a working cancel button
- Adjustable rendering quality from 100–300 DPI
- Optional English + Malayalam OCR with searchable text
- Bundled Malayalam Unicode font and Tesseract runtime in the Windows build
- Output collision handling and an optional replace-existing switch
- Settings and window size saved between launches
- Light, dark, and system appearance modes
- Keyboard shortcuts
- Standalone Windows executable with version metadata
OCR uses Tesseract with:
- English:
eng - Malayalam:
mal - Font: Noto Sans Malayalam (bundled), with Nirmala UI as a source-mode fallback
The Windows build script downloads and validates the required OCR language data and font before creating the executable. OCR text is inserted invisibly so the inverted pages stay searchable and selectable.
For building from source:
- Windows 10 or 11
- Normal CPython 3.13
- Internet access during the first build
- Tesseract OCR, or WinGet so the build script can install it
Important: use normal CPython 3.13. Do not use the Python 3.14 free-threaded build (3.14t).
For OCR when running from source without a build:
- Tesseract
engandmallanguage data NotoSansMalayalam-Regular.ttfinruntime\fonts\, or the Windows Nirmala UI font
- Clone the repository.
- Open Command Prompt in the project directory.
- Run:
build_windows.batThe finished executable is created at:
dist\PDFColorInverter.exe
The build script automatically:
- Creates a Python 3.13 virtual environment.
- Installs the Python dependencies.
- Finds or installs Tesseract OCR.
- Downloads the English and Malayalam Tesseract models.
- Downloads the Noto Sans Malayalam font.
- Validates the downloaded runtime files.
- Builds a standalone one-file Windows executable with version metadata.
Prepare the environment once with build_windows.bat, then run:
run_windows.batOr launch the application directly:
.venv\Scripts\python.exe app.pyTo install only the Python dependencies:
py -3.13 -m venv .venv
.venv\Scripts\python.exe -m pip install -r requirements.txt- Add PDFs with Add PDF files, Add folder, or by dragging them into the window.
- Click a file in the queue to preview the inverted first page. Use the arrow buttons to change pages.
- Choose Keep text or Rasterize.
- Adjust the output folder, filename suffix, and replace-existing option if needed.
- Click Invert queued PDFs. The same button becomes Cancel conversion while a batch is running.
- Use the arrow button beside the output folder to open the results.
| Shortcut | Action |
|---|---|
Ctrl+O |
Add PDF files |
Ctrl+Shift+O |
Add a folder |
Ctrl+Enter |
Start or cancel conversion |
Ctrl+L |
Clear the queue |
Page Up / Page Down |
Previous / next preview page |
Esc |
Cancel a running conversion |
If no output folder is selected, each source PDF gets an Inverted folder beside it. The default filename suffix is:
_inverted
With Replace existing output files enabled, an existing output is replaced. With it disabled, a unique name such as report_inverted (1).pdf is created instead.
Files are written to a temporary file and moved into place, so a cancelled or failed conversion does not leave a half-written PDF behind.
- Keep text mode uses the PDF
Differenceblend mode. It preserves text, links, and vector content, but annotations and form-field appearances are not recoloured. If a document relies heavily on annotations, use Rasterize. - Rasterize mode flattens the page. Text is no longer selectable unless OCR is enabled. Higher DPI values produce larger files.
- Password-protected PDFs are reported clearly but must be unlocked before conversion.
- OCR adds an invisible text layer; it does not change the visible inverted image.
Run build_windows.bat to bundle Tesseract and both language models. If you already have Tesseract, make sure eng.traineddata and mal.traineddata are in its tessdata folder. You can also set TESSERACT_CMD to the full path of tesseract.exe and TESSDATA_PREFIX to the tessdata folder.
Use Keep text mode. If you need rasterization, lower the DPI from 300 to 150–200.
Use Add PDF files instead. Native drag-and-drop is Windows-only and can be blocked by some remote-desktop or security tools.
%LOCALAPPDATA%\PDFColorInverter\app.log
Settings are stored at:
%APPDATA%\PDFColorInverter\settings.json
PDF-Color-Inverter/
├── app.py Entry point, logging, DPI awareness
├── pdf_color_inverter/
│ ├── __init__.py App metadata and bundled-resource paths
│ ├── core.py Vector/raster conversion and OCR engine
│ ├── dnd.py Native Windows drag-and-drop
│ ├── settings.py Persisted user settings
│ └── ui.py CustomTkinter interface
├── tests/
│ ├── test_core.py
│ ├── test_metadata.py
│ └── test_settings.py
├── packaging/
│ └── version_info.txt Windows EXE version metadata
├── docs/
│ └── screenshot.png
├── build_windows.bat
├── run_windows.bat
├── requirements.txt
├── requirements-dev.txt
├── pyproject.toml Pytest and Ruff configuration
├── README.md
├── CHANGELOG.md
├── .gitattributes
└── .gitignore
The Tesseract runtime and Malayalam font are generated locally by the build script and are intentionally excluded from Git.
Install the development dependencies and run the tests:
.venv\Scripts\python.exe -m pip install -r requirements-dev.txt
.venv\Scripts\python.exe -m pytestThis project is licensed under the MIT License.
See LICENSE for the full license text.
Adithya S
GitHub: adithya-s-119
