如何使用imagemagick创建像shutterstock这样的水印

问题描述 投票:0回答:1

我想创建像Shutterstock这样的图像水印。我试过但不能复制它。我尝试使用以下命令。问题是对我来说,我无法像Shutterstock那样向图像添加对角随机文本。我尝试过很多没有运气的选择。

infile="zoom.jpg"
ww=$(convert -ping "$infile" -format "%[fx:w-1]" info:)
hh=$(convert -ping "$infile" -format "%[fx:h-1]" info:)
convert "$infile" \
-fill "graya(100%,0.75)" \
-draw "line 0,0 $ww,$hh line $ww,0 0,$hh" -alpha off \
-fill "graya(50%,0.25)" \
tile_aqua_500_text_x_text.jpg

composite -dissolve 35 -gravity center logo.png tile_aqua_500_text_x_text.jpg tile_aqua_500_text_x_text.jpg

convert -background none -size 220x320 xc:none  -font DejaVu-Sans-Bold -pointsize 30 \
-gravity  North -draw "rotate -22 fill grey text 20,10 'knot9'"   \
-gravity  West -draw "rotate -27 fill grey text 5,15 '89898989'"   \
miff:- |\
composite -dissolve 70 -tile - tile_aqua_500_text_x_text.jpg  tile_aqua_500_text_x_text.jpg

width=`identify -format %w tile_aqua_500_text_x_text.jpg`; \

convert -background '#0008' -fill white -gravity center -size ${width}x30 -pointsize 10 -font DejaVu-Sans-Bold\
          caption:"\nThis image is Copyrighted by Knot9 \n www.knot9.com | Image Id: 89898989\n" \
          tile_aqua_500_text_x_text.jpg +swap -gravity south -composite  tile_aqua_500_text_x_text.jpg

我的输出是enter image description here

要求是enter image description here

imagemagick imagemagick-convert
1个回答
0
投票

在ImageMagick中,您可以执行以下操作。使用label:在透明背景上创建一个小文本图像。旋转它。用它来控制间距。将其拼凑出来以填充图像。然后将拼贴出的图像合成到背景图像上。

图片:

enter image description here

convert lena.png \
\( -size 100x -background none -fill white -gravity center \
label:"watermark" -trim -rotate -30 \
-bordercolor none -border 10 \
-write mpr:wm +delete \
+clone -fill mpr:wm  -draw 'color 0,0 reset' \) \
-compose over -composite \
lena_watermark.png

enter image description here

如果使用ImageMagick 7,则将转换为magick

请参阅https://imagemagick.org/Usage/canvas/#tile_memory进行平铺

© www.soinside.com 2019 - 2024. All rights reserved.