如何在 imageMagick 中更改带有水印的图像背景
How to change image background with watermark in imageMagick
我正在尝试将三张图片转换为一张图片。
pattern.png(http://tap2search.com/images/pattern.png)
shirt.png(http://tap2search.com/images/shirt.png)
logo.jpg(http://tap2search.com/images/logo.jpg)
convert \( -size 500x500 tile:pattern.png \) \( shirt.png -alpha extract \) -compose copy_opacity -composite png:-
上面的命令组合了前两个图像(pattern.png和shirt.png),结果是。
但是如何把logo.jpg作为水印放在图片的东南边呢
我不确定您希望水印如何显示。所以这里有 3 个变体。我正在使用 IM 6.9.10.28 Q16 Mac OSX.
黑色水印:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -channel a -negate +channel \
-fill white -colorize 100 \) \
-compose over -composite \
\( logo.jpg -resize 50x50 \
-negate -alpha copy \
-fill black -colorize 100 \) \
-gravity southeast \
-compose over \
-composite \
result1.png
白色水印:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -channel a -negate +channel \
-fill white -colorize 100 \) \
-compose over -composite \
\( logo.jpg -resize 50x50
-negate -alpha copy \
-fill white -colorize 100 \) \
-gravity southeast \
-compose over \
-composite \
result2.png
部分透明白色:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -channel a -negate +channel \
-fill white -colorize 100 \) \
-compose over -composite \
\( logo.jpg -resize 50x50 \
-negate -alpha copy \
-fill white -colorize 100 \
-channel a -evaluate multiply 0.5 +channel \) \
-gravity southeast \
-compose over \
-composite \
result3.png
如果您不希望背景透过 T 恤显示,请执行以下操作,例如,对于白色徽标。
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -alpha extract -negate \
-alpha copy \
-channel a -threshold 0% +channel \) \
-compose over -composite \
\( logo.jpg -resize 50x50 \
-negate -alpha copy \
-fill white -colorize 100 \) \
-gravity southeast \
-compose over \
-composite \
result4.png
补充:关于您的新彩色 PNG 透明徽标,请尝试以下操作:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -alpha extract -negate \
-alpha copy \
-channel a -threshold 0% +channel \) \
-compose over -composite \
\( logo1.png -resize 50x50 \) \
-gravity southeast \
-compose over \
-composite \
result5.png
我正在尝试将三张图片转换为一张图片。
pattern.png(http://tap2search.com/images/pattern.png) shirt.png(http://tap2search.com/images/shirt.png) logo.jpg(http://tap2search.com/images/logo.jpg)
convert \( -size 500x500 tile:pattern.png \) \( shirt.png -alpha extract \) -compose copy_opacity -composite png:-
上面的命令组合了前两个图像(pattern.png和shirt.png),结果是
但是如何把logo.jpg作为水印放在图片的东南边呢
我不确定您希望水印如何显示。所以这里有 3 个变体。我正在使用 IM 6.9.10.28 Q16 Mac OSX.
黑色水印:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -channel a -negate +channel \
-fill white -colorize 100 \) \
-compose over -composite \
\( logo.jpg -resize 50x50 \
-negate -alpha copy \
-fill black -colorize 100 \) \
-gravity southeast \
-compose over \
-composite \
result1.png
白色水印:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -channel a -negate +channel \
-fill white -colorize 100 \) \
-compose over -composite \
\( logo.jpg -resize 50x50
-negate -alpha copy \
-fill white -colorize 100 \) \
-gravity southeast \
-compose over \
-composite \
result2.png
部分透明白色:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -channel a -negate +channel \
-fill white -colorize 100 \) \
-compose over -composite \
\( logo.jpg -resize 50x50 \
-negate -alpha copy \
-fill white -colorize 100 \
-channel a -evaluate multiply 0.5 +channel \) \
-gravity southeast \
-compose over \
-composite \
result3.png
如果您不希望背景透过 T 恤显示,请执行以下操作,例如,对于白色徽标。
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -alpha extract -negate \
-alpha copy \
-channel a -threshold 0% +channel \) \
-compose over -composite \
\( logo.jpg -resize 50x50 \
-negate -alpha copy \
-fill white -colorize 100 \) \
-gravity southeast \
-compose over \
-composite \
result4.png
补充:关于您的新彩色 PNG 透明徽标,请尝试以下操作:
convert \( -size 500x500 tile:pattern.png \) \
\( shirt.png -alpha extract -negate \
-alpha copy \
-channel a -threshold 0% +channel \) \
-compose over -composite \
\( logo1.png -resize 50x50 \) \
-gravity southeast \
-compose over \
-composite \
result5.png