Last active
October 17, 2020 15:50
-
-
Save aswinpajayan/4c37d1602cfeb89c6830ad4384a46088 to your computer and use it in GitHub Desktop.
Commands to convert pdf to image and adjust threshold
This file contains hidden or 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
# change policy modules in image magick | |
#<!-- <policy domain="coder" rights="none" pattern="MVG" /> --> | |
#<policy domain="coder" rights="read|write" pattern="PDF" /> | |
# add line <policy domain="coder" rights="read|write" pattern="LABEL" /> | |
#copy file to to any folder (one file per folder) | |
convert -density 72 Kashyapa\ samhitha\ Full.pdf -quality 90 output.jpg | |
mkdir out | |
for file in *.jpg;do convert $file -channel RGB -threshold 42% out/$file.jpg; done |
This file contains hidden or 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
#!/bin/bash | |
for i in `ls`; do convert $i -fuzz 100% -fill '#f2f2f2' -region 100x100+50+50 -opaque white $i;done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment