9 echo "Processing ${img} ..."
10 # mostly to remove the alpha channel so ocrmypdf can work with it
11 # does not seem to work all the time, so 'convert' is used as well below
12 # still nice to optimize
20 # and remove alpha channel so ocrmypdf can work with it
21 # ocrmypdf does the quantization of the png which reduces size drastically
22 convert -resize $resize_by% -alpha off "$img" - \
23 | ocrmypdf - "$(basename $img .png).pdf"
26 echo "convert or ocrmypdf failed"