WebP is a new image format introduced by Google. WebP supports both lossy and lossless image compression. According to Google, WebP lossless images are 26% smaller in size compared to PNGs and WebP lossy images are 25-34% smaller in size compared to JPEG images. This is a great result and we recommend to use WebP if it’s possible in your project.
To recompress your JPEG, PNG or GIF files into WebP format simply set "web_p": true
flag in your request JSON:
{
"compression":"lossy",
"keep_exif":1,
"web_p":true,
"url":"https://example.com/image_path.jpg",
"wait":true,
"quality":50
}
This is cURL example:
curl --location --request POST 'https://api.cheetaho.com/api/v2/media/optimization' \
--header 'Accept: application/json' \
--header 'key: api_key' \
--header 'Content-Type: application/json' \
--data-raw '{
"compression":"lossy",
"keep_exif":1,
"web_p":true,
"files":"https://example.com/image_path.jpg",
"wait":true,
"quality":50
}'