【发布时间】:2021-08-07 00:18:36
【问题描述】:
如何组合以下两个 imagemagick convert 命令?
convert inverted.png -transparent white -negate temp.pngconvert standard.png temp.png -composite final.png
我无法弄清楚语法,但我确定当我看到答案时我会踢自己。
【问题讨论】:
标签: image-processing imagemagick
如何组合以下两个 imagemagick convert 命令?
convert inverted.png -transparent white -negate temp.pngconvert standard.png temp.png -composite final.png我无法弄清楚语法,但我确定当我看到答案时我会踢自己。
【问题讨论】:
标签: image-processing imagemagick
你有几个选择。
首先,你可以先加载倒置的图像并将其取反,然后再加载第二个并交换顺序:
convert inverted.png -transparent white -negate standard.png +swap -composite result.png
或者,您可以按正确的顺序加载它们,但使用括号确保只有第二个被否定:
convert standard.png \
\( inverted.png -transparent white -negate \) \
-composite result.png
顺便说一句,这是旧的 v6 语法,您现在应该使用 v7,它是:
magick inverted.png -transparent white -negate standard.png +swap -composite result.png
【讨论】: