Replaces near-black CMYK colors in PDF files with pure K100 (0/0/0/100) black.
Useful for print production: InDesign, Illustrator and other tools sometimes produce "rich black" (e.g. 60/40/40/100 or similar CMY contamination) where a clean K-only black is required — especially for text and fine lines.
- Scans all content streams in a PDF for CMYK color operators (
scn/SCN) - Identifies near-black values: K ≥ 40% and any CMY channel ≥ 8%
- Replaces them with
0 0 0 1(pure K100) - Leaves intentional grays (K-only, no CMY) untouched
- Saves a new file with
_100Ksuffix — original is never modified
python3 fix_pdf.py yourfile.pdf
# → yourfile_100K.pdfMultiple files:
python3 fix_pdf.py file1.pdf file2.pdf file3.pdfDrop one or more PDFs onto RichBlackFixer.app. Output lands next to each input file.
- Python 3.8+
- pikepdf
pip install pikepdf| Constant | Default | Meaning |
|---|---|---|
K_MIN |
0.40 | minimum K to consider as near-black |
CMY_MIN |
0.08 | minimum CMY contamination to trigger replacement |
Requires Python 3.11+ and PyInstaller:
pip install pikepdf pyinstaller
pyinstaller RichBlackFixer.spec --clean
# → dist/RichBlackFixer.appThe resulting .app is self-contained (~54 MB) and requires no Python installation on the target machine. Distribute as a zip via GitHub Releases.
MIT — see LICENSE
Dependencies:
- pikepdf — MIT License
- lxml — BSD 3-Clause License (only used in macOS app bundle)