Skip to content

Instantly share code, notes, and snippets.

@MadeAja
Forked from pleabargain/IMscript-png.sh
Created June 1, 2022 10:38
Show Gist options
  • Save MadeAja/de04f682e7641988af08fb3aef8c4546 to your computer and use it in GitHub Desktop.
Save MadeAja/de04f682e7641988af08fb3aef8c4546 to your computer and use it in GitHub Desktop.
this will write the file name on to the png image
for img in *.png; do
width=$(identify -format %W ${img})
width=$(( ${width} * 9 / 10 ))
convert \
-background '#0008' \
-gravity center \
-fill white \
-size ${width}x100 \
caption:"${img}" \
"${img}" \
+swap \
-gravity south \
-composite \
"${img}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment