【发布时间】:2019-07-24 00:31:18
【问题描述】:
我正在开发类似的 Imgix 服务,我正在使用 Sharp。
但是 webp 无损压缩 Imgix 得到的效果比 Sharp 好。在 Imgix 中具有相同宽度和高度的相同图像有 453 KB 和 Sharp 1.3 MB。
在不损失质量的情况下增加压缩率的一些建议?
我正在使用的代码:
https.get(url, function (response) {
let transform = sharp().toFormat('webp').resize(width, height);
return response.pipe(transform).webp({lossless:true}).pipe(res);
});
【问题讨论】:
-
您能否就您的问题与 Imgix 和 Sharp 共享两个压缩文件?
-
ic.imgix.net/1/5c473f5253098?format=webp&lossless=1 IMGIX lossless: 138kb 与Sharp webp lossless相同的图像有436kb