回形针将图像保存为白色背景的 jpg
我想知道如何将带有 alpha 通道的 png 和 gif 文件转换为带有回形针的白色背景的 jpg
我尝试过这个,但是它不起作用
has_attached_file(
:photo,
:whiny => false,
:styles => {
:medium => ["300x300>", :jpg],
:thumb => ["100x100>", :jpg]
},
:convert_options => { :all => '-alpha white -background white'}
)
它保存了带有灰色背景的文件。
I'd like to know how to convert png and gif files with alpha channel to jpg with white background with paperclip
I tried this but, it doesn't work
has_attached_file(
:photo,
:whiny => false,
:styles => {
:medium => ["300x300>", :jpg],
:thumb => ["100x100>", :jpg]
},
:convert_options => { :all => '-alpha white -background white'}
)
It saves the file with the gray background.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是解决方案
here the solution
-alpha remove -background White
更可取。white
不是-alpha
的有效参数。-alpha remove -background white
is preferable.white
is not a valid argument for-alpha
.