Created
March 20, 2018 13:10
-
-
Save hollanderbart/191d8ad9d64c4a98330bac99b055c795 to your computer and use it in GitHub Desktop.
Add a title to a image (PNG)
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/zsh | |
if [[ ! -e output ]] | |
then | |
echo creating output directory | |
mkdir output | |
else | |
echo clearing output folder | |
rm -rf output | |
echo creating output directory | |
mkdir output | |
fi | |
for file (**/*.png(ND.)) { | |
echo adding label to file: $file | |
width=`identify -format %w ${file}`; | |
newHeight=$(($width * 0.2)); | |
convert -background Plum -fill white -gravity center -size ${width}x${newHeight} caption:"DEBUG" $file +swap -gravity south -composite output/$file; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment