回形针图像保存为白色背景JPG
-
24-09-2019 - |
题
我想知道如何PNG和GIF文件转换alpha通道到JPG与白色背景与纸夹
我试过,但,这是行不通的。
has_attached_file(
:photo,
:whiny => false,
:styles => {
:medium => ["300x300>", :jpg],
:thumb => ["100x100>", :jpg]
},
:convert_options => { :all => '-alpha white -background white'}
)
它节省与灰色背景的文件。
解决方案
-alpha remove -background white
是优选的。 white
不是-alpha
有效参数。
其他提示
这里的溶液
has_attached_file :photo,
:styles => {
:medium => ["300x300>",:jpg],
:thumb => ["100x100>", :jpg]
},
:convert_options => {
:all => '-background white -flatten +matte'
}
不隶属于 StackOverflow