unpaper

Post-processing tool for scanned and photocopied book images

brewmacoslinux
Try with needOr install directly
Source

About

Post-processing for scanned/photocopied books

Commands

unpaper

Examples

Basic cleanup of a scanned document image$ unpaper input.ppm output.ppm
Process a two-page scan with automatic layout detection$ unpaper --layout double input.ppm output.ppm
Clean image with deskew, despeckle, and margin removal$ unpaper --deskew auto --despeckle 3 --margin-left 10 input.ppm output.ppm