imagemagick中从png到jpg的透明背景
我在 image magick 中将一些 png 图像制作成圆角。但是当我尝试将所有 png 图像制作成 JPG 格式时,圆角背景转换为白色,我希望圆角应该是透明的。我正在使用这些命令使它们透明,但没有得到任何好的结果。
1. convert image.png -background white -flatten -alpha off image.jpg
2. convert image.png -background none -flatten -alpha off image.jpg
任何帮助和建议都将非常感激。
I made some png images into round corner in image magick .But when I tried to make all the png images into JPG format, the round corner background is converting into white and I want the round corner should be in transparent.I am using these commands to make them transparent but not getting any good results.
1. convert image.png -background white -flatten -alpha off image.jpg
2. convert image.png -background none -flatten -alpha off image.jpg
Any help and suggestions will be highly appreciable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Jpg 不能是透明的,只能是 gif 和 png(也可以是 svgs),因此它将用白色像素填充透明区域。
Jpgs cannot be transparent, only gifs and pngs (ok svgs too) so it will fill with white pixels in for transparent areas.
简单的答案是你做不到。 JPEG 格式根本不支持透明度。您必须将图像保留为 PNG 格式(或将它们转换为 GIF - 但为什么要这样做呢?)
The simple answer is you cannot do it. JPEG format simply does not support transparency. You have to leave the images in PNG format (or conver them to GIF - but why would you do that?)
JPG 不支持任何形式的透明度。如果您想要透明度,则必须使用 PNG。
JPG does not support transparency in any form whatsoever. If you want transparency, you'll have to use PNG.