在 image magick 中更改图像的背景
我正在使用 imagemagick 这个命令将图像和背景的大小扩展为白色。
convert input.png -extent 495X320 -gravity center -background white output.jpg
大小正在执行范围,但背景每次都是黑色的。我尝试了很多方法,但每次都是同样的黑色。所以有人可以帮助我如何解决这个问题。任何帮助和建议都将非常感激。
I am using this command for imagemagick to extend the size of an image and background to white
convert input.png -extent 495X320 -gravity center -background white output.jpg
The size is doing extent but the background is black every time. I tried many methods but the same black is coming every time.So can some one help me how to solve this. Any help and suggestions will be highly appreciable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里的顺序很重要,在
-extent
之前使用-background
:The order is important here, use
-background
before-extent
:把这个留给那些尝试过其他答案但仍然不起作用的人。
就我而言,我需要
在末尾添加
-flatten
选项,它应该可以工作。所以就像:Leaving this for people that have tried the other answer but it still does not work.
In my case I needed
Add the
-flatten
option at the end and it should work. So like: