Skip to content

Instantly share code, notes, and snippets.

@hollanderbart
Created March 20, 2018 13:10
Show Gist options
  • Save hollanderbart/191d8ad9d64c4a98330bac99b055c795 to your computer and use it in GitHub Desktop.
Save hollanderbart/191d8ad9d64c4a98330bac99b055c795 to your computer and use it in GitHub Desktop.
Add a title to a image (PNG)
#!/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