Imagemagick 左右渐变
我想使用 Imagemagick 从左侧和右侧添加透明渐变以与图像组合。
我可以使用以下方式生成图像:
convert -size 100x100 gradient: -function Polynomial -4,4,0 -distort SRT 90 gradient.png
它看起来像:
我还可以将该图像合成在我的图像之上想要:
composite original.jpg -compose Multiply gradient.png final_image.jpg
所有这些都工作正常。我的问题是,如何更改该渐变的颜色?
谢谢!
I want to use Imagemagick to add a transparent gradient from the left and right to be composed with an image.
I can generate the image with:
convert -size 100x100 gradient: -function Polynomial -4,4,0 -distort SRT 90 gradient.png
And it looks like:
I can also compose that image on top of the image I want with:
composite original.jpg -compose Multiply gradient.png final_image.jpg
All of this works fine. My question is, how do I change the color of that gradient?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需在
gradient:
选项后添加逗号分隔的颜色即可:注意,
-function
也会转换通道,因此渐变中的颜色不会是原始颜色。Simply add comma-separated colors after
gradient:
option:Note, that
-function
converts channels too, so colors in gradient wont be original.方法找到了解决此问题的方法
通过执行适合我的情况的
,给我:
Found a way around this by doing
which works in my case, giving me: