如何使用 imagemagick 将透明 png 旋转 45 度并保持新图像透明?
我有一个 16x16 透明 png,我做了
convert -rotate -45 a.png b.png
这个旋转它并创建了一个新图像 b.png,其大小为 22x22,当我在背景上使用时,它显示原始图像(16x16)随底层背景旋转,但新填充出现时以白色背景出现。
怎么可能让新填充物也变得透明呢?
如果这是不可能的,那么我怎样才能让新图像的所有背景都是一种颜色?
I have a 16x16 transparent png and I did
convert -rotate -45 a.png b.png
This rotated it and created a new image b.png which is of size 22x22 and which when I use against a background shows the original image (16x16) rotated with the underlying background but the new filling that came about shows up with a white background.
How is it possible to have the new filling too be transparent?
If that is not possible, than how can I have all the background of the new image be one color?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
使用 -background 选项指定透明度设置为零的透明颜色:
convert -background 'rgba(0,0,0,0)' -rotate 45 a.png b.png
Use the -background option to specify a transparent color with alpha set to zero:
convert -background 'rgba(0,0,0,0)' -rotate 45 a.png b.png
您还可以使用这些选项:
You can also use these options:
我也遇到了同样的问题,但是我使用的命令如下:
它需要是:
所以,这实际上有一点帮助,谢谢:)
I was also having the same issue, however I was using the command like so:
It needed to be:
So, this actually helped a little, thanks :)
对我来说效果很好
works well for me
我用C#来旋转它
I used C# to rotate it