Last active
December 23, 2024 02:36
-
-
Save vielhuber/0fe2fda73262ef495a4a91bb835a1d2b to your computer and use it in GitHub Desktop.
ImageMagick: Increase pdf scan contrast and sharpening #tools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -density 150 input.pdf -brightness-contrast 5x25 -sharpen 0x1 output.pdf | |
convert -density 300 input.pdf -colorspace gray -normalize -level 50%,51% -sharpen 0x1 output.pdf | |
convert -density 300 input.pdf -colorspace gray -normalize -level 25%,26% -sharpen 0x1 output.pdf | |
convert -density 300 input.pdf -colorspace gray -normalize -modulate 150 -sharpen 0x1 output.pdf | |
convert -density 300 input.pdf -contrast -contrast -contrast -contrast -sharpen 0x1 output.pdf | |
convert -density 300 input.pdf -contrast-stretch 15% -sharpen 0x.5 output.pdf | |
find . -name '*.pdf' -type f -exec convert -density 150 {} -brightness-contrast 5x25 -sharpen 0x.5 {}_new.pdf \; |
I had a bulk of unprocessed scanned of documents. I used the following which worked really great for me with a 72.3% file size reduction:
convert -density 300 input.pdf -normalize -sharpen 0x2 -compress jpeg -quality 70 output.pdf
Thanks, will try that also out.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had a bulk of unprocessed scanned of documents. I used the following which worked really great for me with a 72.3% file size reduction: