代码: 全选
● cat test-compose.bash
#!/bin/bash
[ -z $1 ] && exit
cd /tmp/
rm *.png
INPUT=0001.png
COLOR=black
COLOR_COMPOSE=red
SIZE=80
FONT='/home/exp/安装/备份/●可用字体/英文字体/AMERSN__.ttf'
convert -background none -fill $COLOR -font """$FONT""" -pointsize $SIZE label:$1 $INPUT
for effect in clear src dst src-over dst-over src-in dst-in src-out dst-out src-atop dst-atop multiply screen overlay darken lighten linear-light color-dodge color-burn hard-light soft-light plus add minus subtract difference exclusion xor
do
convert $INPUT -matte \
\( +clone -channel A -separate +channel -negate \
-bordercolor black -border 5 -blur 0x2 -shade 120x30 \
-normalize -blur 0x1 -fill $COLOR_COMPOSE -tint 100 \) \
-gravity center -compose $effect -composite \
$effect.png
done
montage -label %f -pointsize 20 -font $FONT -background none -fill red -geometry +4+4 -tile 6 *.png ~/all-compose-effect.png