5 echo "Creating Directories …"
6 mkdir --parents resized/pngnqed/optipnged optimized
9 echo "Resizing image …"
10 convert -resize $resize_by% "$img" "resized/$img"
11 echo "Running pngnq …"
12 pngnq -s1 -f -d "resized/pngnqed" -e .png "resized/$img"
13 echo "Running optipng …"
14 optipng -force -out "resized/pngnqed/optipnged/$img" "resized/pngnqed/$img"
15 echo "Moving final image to directory 'optimized' …"
16 cp --verbose --interactive --target-directory=optimized/ "resized/pngnqed/optipnged/$img"
17 echo "Removing temporary images …"
18 #rm --verbose --interactive \
21 "resized/pngnqed/$img" \
22 "resized/pngnqed/optipnged/$img"
23 img2pdf --output $(basename $img .png).pdf optimized/${img}
25 rmdir --parents resized/pngnqed/optipnged