【发布时间】:2015-05-25 18:20:11
【问题描述】:
我正在处理来自 ImageMagick 的名为“Gel”效果的示例,用于 ImageMagick Example pages。
我不想在许多步骤中使用中间图像执行 ImageMagick 脚本,而是想在没有中间文件的情况下一步完成。
我的代码如下所示(与示例 95% 相同):
convert.exe -size 150x64 xc:none -fill green
-draw "roundrectangle 10,10 140,54 8,8"
( +clone -alpha extract -blur 0x12 -shade 110x0
-normalize -sigmoidal-contrast 16,60% -evaluate multiply .5
-roll +4+8 +clone -compose Screen -composite ) -compose In -composite
( +clone -alpha extract -blur 0x2 -shade 0x90 -normalize -blur 0x2
+level 60,100% -alpha On ) -compose Multiply -composite
-font Verdana-Bold -pointsize 20 -fill white -stroke black -gravity Center
-annotate 0 "Download" -trim -repage 0x0+7+7
( +clone -background navy -shadow 80x4+4+4 ) +swap -background none -flatten
ButtonTest.png"
这些步骤是示例中步骤的副本。
问题是最后一个克隆步骤:
( +clone -background navy -shadow 80x4+4+4 ) +swap -background none -flatten
使原本非常漂亮的图像变暗。 IE。没有添加阴影。在这一步之前,一个命令运行良好。
此外。如果我在最后一步之前保存图像,如下所示:
convert.exe -size 150x64 xc:none -fill green
-draw "roundrectangle 10,10 140,54 8,8"
( +clone -alpha extract -blur 0x12 -shade 110x0
-normalize -sigmoidal-contrast 16,60% -evaluate multiply .5
-roll +4+8 +clone -compose Screen -composite ) -compose In -composite
( +clone -alpha extract -blur 0x2 -shade 0x90 -normalize -blur 0x2
+level 60,100% -alpha On ) -compose Multiply -composite
-font Verdana-Bold -pointsize 20 -fill white -stroke black -gravity Center
-annotate 0 "Download" -trim -repage 0x0+7+7
tempbutton.png
然后在 tempbutton 上执行最后一个克隆,如下所示:
convert.exe tempbutton.png
( +clone -background navy -shadow 80x4+4+4 ) +swap -background none -flatten
downloadbutton.png
然后就可以了。
我怎样才能避免将图像保存为最后一步,并执行这个大命令?
【问题讨论】:
标签: imagemagick imagemagick-convert