Last active
February 2, 2020 15:31
-
-
Save Pmmlabs/1bedcee4da9a54680d718e9bf91ad315 to your computer and use it in GitHub Desktop.
Deletes known watermark
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 | |
MASK="mask.png" | |
NEGATE_FIXED="negate_fixed.png" | |
NEGATE="negate.png" | |
#convert -density 300 -trim test.pdf -quality 100 -flatten -sharpen 0x1.0 test.jpg | |
convert $MASK -negate $MASK | |
for i in *.png | |
do | |
convert $i -negate $NEGATE | |
convert $NEGATE $MASK -compose difference -composite $NEGATE_FIXED | |
convert $NEGATE_FIXED -negate $i | |
done | |
rm $NEGATE $NEGATE_FIXED | |
mkdir files | |
mv $MASK ./files | |
#convert *.png result.pdf | |
#for a in [0-9]*.png; do | |
# mv $a ./new/`printf %04d.%s ${a%.*} ${a##*.}` | |
#done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment