Last active
October 12, 2018 12:15
-
-
Save dazld/7c30165df4d088266cca08406cb28e71 to your computer and use it in GitHub Desktop.
imagemagick.. magic
This file contains hidden or 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
#!/usr/local/bin/bash | |
shopt -s globstar nullglob | |
in="" | |
out="" | |
process () { | |
local in=$1 | |
local out=$2 | |
convert "$in" -intent relative -black-point-compensation -colorspace RGB -bordercolor white -border 5\% -thumbnail "1000000@>" -gravity center -bordercolor "rgba(64,64,64,0.3)" -border 1 \( +clone -background black -shadow 30x16-10+20 \) +swap -background "#F5F5F5" -layers merge +repage -extent 1350x1350+15+0 "$out" | |
} | |
for file in **/*.jpg; do | |
[[ -f $file ]] || continue | |
[[ $file = *"_P1.jpg"* ]] && continue | |
out_file=${file%.jpg}_P1.jpg | |
echo "Creating $out_file ..." | |
process "$file" "$out_file" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment