Tinypng 官网
上传文件方式压缩
请求体
curl --data-binary @yourimg.png -i https://tinypng.deeplx.net/shrink
响应体
{
"input": {
"size": 45617,
"type": "image/png"
},
"output": {
"size": 7457,
"type": "image/png",
"width": 1546,
"height": 804,
"ratio": 0.1635,
"url": "https://api.tinify.com/output/8whzap85w78ypd2pexv2188jds46tvkt"
}
}
https://api.tinify.com/output/8whzap85w78ypd2pexv2188jds46tvkt
就是压缩后的文件地址,此地址不要作为生产地址。