Improve luma*-to-png with support for multiple filename arguments :D

This commit is contained in:
Danielle McLean 2018-02-13 14:50:53 +11:00
parent 59d8a75135
commit 6ee96690b6
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,4 @@
#!/bin/zsh #!/bin/zsh
date=${1%_*.bmp} for date in ${(u)argv[@]%_*.bmp}; do
magick ${date}_top.bmp ${date}_bot.bmp -alpha set -gravity Center -background 'rgba(0,0,0,0)' -append ${date}.png magick ${date}_top.bmp ${date}_bot.bmp -alpha set -gravity Center -background 'rgba(0,0,0,0)' -append ${date}.png || exit $?
done

View file

@ -1,2 +1,6 @@
#!/bin/zsh #!/bin/zsh
magick $1 -alpha set -fill 'rgba(0,0,0,0)' -draw 'color 0,0 point' $1:r.png for src in $argv; do
dest=$src:r.png
[[ $src = *.png ]] && dest=${src:r}_twitter.png
magick $src -alpha set -fill 'rgba(0,0,0,0)' -draw 'color 0,0 point' $dest || exit $?
done