Skip to content

About

Convert "rich black" (RGB black) elements in a PDF to CMYK 0/0/0/100.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RichBlackFixer

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.

What it does

  • 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 _100K suffix — original is never modified

Usage

Command line

python3 fix_pdf.py yourfile.pdf
# → yourfile_100K.pdf

Multiple files:

python3 fix_pdf.py file1.pdf file2.pdf file3.pdf

macOS drag-and-drop app

Drop one or more PDFs onto RichBlackFixer.app. Output lands next to each input file.

Requirements

pip install pikepdf

Thresholds (configurable in fix_pdf.py)

Constant Default Meaning
K_MIN 0.40 minimum K to consider as near-black
CMY_MIN 0.08 minimum CMY contamination to trigger replacement

Building the macOS app

Requires Python 3.11+ and PyInstaller:

pip install pikepdf pyinstaller
pyinstaller RichBlackFixer.spec --clean
# → dist/RichBlackFixer.app

The resulting .app is self-contained (~54 MB) and requires no Python installation on the target machine. Distribute as a zip via GitHub Releases.

License

MIT — see LICENSE

Dependencies:

  • pikepdf — MIT License
  • lxml — BSD 3-Clause License (only used in macOS app bundle)

About

Convert "rich black" (RGB black) elements in a PDF to CMYK 0/0/0/100.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages