POST /api/v1/resize resizes an image to fit inside a width and/or
height bounding box (at least one of them is required). The aspect ratio
is kept, the image is never upscaled, and the format stays the same:
curl -X POST https://glimpseimg.com/api/v1/resize \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"input\":{\"type\":\"BASE64\",\"data\":\"$(base64 -i photo.jpg)\"},\"width\":800}"
The response has the same shape as Convert, but
without the psnr field. The resized image is base64-encoded in
data.output.data. The final dimensions are in data.width and
data.height.
Resize and optimize in one call
Pass optimize: true to also run the optimizer on the resized image. The
result is never larger than the plain resize. You can add a quality
(1 to 100, default 85), and it needs optimize to be true.
If you want resize plus compression with good defaults for small images, Thumbnail does both in a single call.