ppauto inputfilename
Last active
August 25, 2017 05:40
-
-
Save SushilShrestha/1811def15fab0d15192eb73e333801b9 to your computer and use it in GitHub Desktop.
PP and auto size tile photo using imagemagick for a4 size printing
This file contains 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 | |
#-------------------------------------- | |
# A4 size image full of PP and auto size photo tiles | |
# Usage: ppauto input_file | |
# | |
# Requires: imagemagick | |
usage() { | |
echo "Usage: ppauto input_file" | |
} | |
input_file=$1 | |
output_file="ppauto_$input_file" | |
if [ -f "$input_file" ] | |
then | |
# a single row of pp size photo | |
montage -density 300 -tile 5x0 -geometry 366x450\^+5+10 $input_file +clone +clone +clone +clone "temp_pp_row$input_file"; | |
# full grid of PP size photoes | |
montage -density 300 -tile 0x7 -geometry +0+0 "temp_pp_row$input_file" +clone +clone +clone +clone +clone +clone "temp_final_pp_grid$input_file"; | |
# a column of auto size photo | |
montage -density 300 -tile 0x9 -geometry 295x331\^+7+14 $input_file +clone +clone +clone +clone +clone +clone +clone +clone "temp_final_auto_grid$input_file"; | |
# merge full PP grid and the column auto | |
convert "temp_final_pp_grid$input_file" "temp_final_auto_grid$input_file" +append $output_file; | |
rm "temp_pp_row$input_file" "temp_final_pp_grid$input_file" "temp_final_auto_grid$input_file"; | |
else | |
usage | |
echo "Couldn't find file $input_file"; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment