Skip to content

jontmy/blackout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blackout

A tool to convert color/grayscale PDF files to black and white. Yes, literally only black pixels and white pixels, no shades of gray.

Pre-requisites

  • pdfium
  • Rust 1.86.0 (stable) or later (if building from source)

Note

If you don't have pdfium installed, you can download the precompiled binary (.dylib for macOS or .so for Linux) from the pdfium-binaries repository. Place the binary in the same directory as the blackout binary.

Tip

If you are running Blackout using Cargo, you can also place the pdfium binary in the root of the repository.

Usage

cargo run --release -- -i <input.pdf> -o <output.pdf> [-p <password>]
  • The input path must be a single PDF file. Support for folders of PDFs is planned.
  • The output path can be a directory, in which case Blackout will use the same file name as the input PDF.
  • If your document is password protected, use the optional -p flag.

Examples

Before and after of Blackout

Limitations

Blackout internally converts PDFs into images and forces all non-white pixels to black (posterization). Therefore, some limitations exist at the moment:

  • Only A4 paper sizes are supported.
  • Pages are converted to images internally at 300 dpi.
  • Text in the output document cannot be selected.
  • Images in the original document will likely end up as a pure black blob (see below).
Example of posterization on images

About

Convert color/grayscale PDFs to black & white (literally)

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages