0

I wrote this script and it's working fine, but I would like to do all of it in one step on the fly, without the extra temp image.

explanation: i have a lot of broken image files and i want to draw a circle underneath each image. for this i have to create a temporary image circle.png and then use "image DstOver" to place it below each of the images:

convert -size 200x200 xc:transparent -fill red -draw 'translate 100,100 circle 0,0 100,0' circle.png
mogrify -draw "image DstOver 0,0 0,0 'circle.png'" images/*.png

Something along the lines of:

mogrify -fill red -draw "DstOver translate 100,100 circle 0,0 100,0" images/*.png

But this is always giving me an error, no matter where i place the DstOver:

mogrify: non-conforming drawing primitive definition `DstOver' @ error/draw.c/DrawImage/3169.
4

2 回答 2

1

像“DstOver”这样的合成操作符只与“-draw”的“image”原语一起使用。只是省略它。请参阅 ImageMagick命令行文档中的“-draw”条目。

您可以有多个“-draw”选项,一些绘图图形如“circle ...”和其他如“image DstOver ...”。

于 2016-07-17T00:44:12.077 回答
1

我不确定您要做什么,但总的来说,使用ormogrify做任何事情都会遇到麻烦。我知道的唯一例外是操作员,因此您需要预先创建图像,然后使用它:multi-image operatorsstack operators-draw image

# Blue rectangle with transparent centre
convert -size 200x200 xc:none -bordercolor blue -border 50 start.png

在此处输入图像描述

# Your circle
convert -size 200x200 xc:white -fill red -draw 'translate 100,100 circle 0,0 100,0' circle.png

在此处输入图像描述

# Now underlay
mogrify -draw "image DstOver 0,0 0,0 'circle.png'" start.png

在此处输入图像描述

于 2016-07-17T15:36:09.323 回答