【发布时间】:2018-05-28 19:54:39
【问题描述】:
我正在使用 Nodejs Sharp 将 png 图像转码/调整大小为 jpg。有没有办法用白色(或其他浅色)而不是黑色代替透明?我找到了旧库的解决方案,但 Sharp 似乎是最快和最好的。
.background 不起作用
.then( data => Sharp(data.Body)
.resize(SIZES[resize_type].width, SIZES[resize_type].height)
.max()
.withoutEnlargement()
.background("white")
.toFormat('jpeg')
.toBuffer()
)
【问题讨论】:
-
大声笑我想要相反
标签: node.js jpeg transparency sharp