randomFileW=$(identify -format "%w\n"
maxWidth=$(identify -format "%w\n" dir/* | sort -n -r | head -n 1) maxHeight=$(identify -format "%h\n" dir/* | sort -n -r | head -n 1)
-morphology thicken '1x3>:1,0,1'
-morphology thinning '1x3>:0,1,0' \
-gravity west -chop 300x0 +repage \
-gravity west -splice 200x0 +repage \
-colorspace gray -quantize gray +dither -colors 2 -depth 2 \
convert -verbose $limit $f \
-colorspace gray -auto-level -crop \
`convert $limit $f -fill white -fuzz 60% \
-draw 'color 0,0 replace' -flop -draw 'color 0,0 replace' -flip \
-draw 'color 0,0 replace' -flip -draw 'color 0,0 replace' -flop \
-fuzz 50% -trim -format '%wx%h%O' info:` \
+repage -threshold 50% out.jp2
convert image.tif -resize 575x823^> -gravity center -background white -extent 595x842 image.pdf
echo "a.jpg b.jpg c.jpg" | xargs -P 4 -n 50 mogrify ...
find dir/ -name "*.jp2" -type f -print | xargs -P 2 -n 100 mogrify ...
-fuzz 7% -fill white -opaque 'rgb(118,105,58)' \
awk 'NR > 1'
convert original.jpeg -define jpeg:extent=300kb output.jpg
imgWidth=$(echo "$imgWidth*ratio" | bc -l)
for f in ${@}; do
tmp=$(basename "$f")
# get file extension
ext="${tmp##*.}"
# Get file name without extension
name="${tmp%.*}"
# Strip leading zeros from file name: convert to number
page=$(echo $name | sed -E 's,^0+,,g')
if [ $(( $page % 2 )) -eq 0 ]; then
# even number
else
# odd number
fi
done
When make results in an (ld) error, exclude with --without-(DEPENDCY)
Enabbling OpenMP by installing gcc7 via hombrew (brew install gcc) and ./configure --with-quantum-depth=8 --enable-openmp CC=gcc-7 CFLAGS=-fopenmp CXX=g++-7 CXXFLAGS=-fpermissive
ve/bin/pip install --upgrade --force-reinstall --no-deps . \
&& ve/bin/img2pdf -o out.pdf -S 6inx9in -b 0.25in:0.25in -f into -C L in.jp2 && \
sleep 1 && \
open out.pdf