summaryrefslogtreecommitdiff
path: root/format-for-hocr-pdf.sh
diff options
context:
space:
mode:
Diffstat (limited to 'format-for-hocr-pdf.sh')
-rw-r--r--format-for-hocr-pdf.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/format-for-hocr-pdf.sh b/format-for-hocr-pdf.sh
index 89d4dd8..0059f81 100644
--- a/format-for-hocr-pdf.sh
+++ b/format-for-hocr-pdf.sh
@@ -9,6 +9,10 @@ test $# -ne 2 && echo "$usage" && exit 1
# All possible training files to check for
TRAININGS="rescribealphav4 rescribealphav5"
+# Set image compression and dpi
+QUALITY=0
+DPI=600
+
if ! test -d "$1"; then
echo "Error: $1 does not exist"
exit 1
@@ -29,7 +33,7 @@ find "$1" -maxdepth 1 -type f -name '*.binarized.png' | while read i; do
continue
fi
- gm convert "$i" "$2/$b.jpg" || exit 1
+ gm convert -quality $QUALITY -density ${DPI}x${DPI} "$i" "$2/$b.jpg" || exit 1
cp "$hocr" "$2/$b.hocr" || exit 1
done