DEV Community

Olly
Olly

Posted on

Resize, convert to WebP and compress images over HTTP (no Sharp, no ImageMagick)

Serverless functions and no-code tools often can't run native image libraries. ImageKit does the common jobs over HTTP: you pass an image URL and get the processed image back.

curl -G "https://imagekit-resize-convert-to-webp-compress-crop.p.rapidapi.com/resize" \
  --data-urlencode "url=https://example.com/photo.jpg" \
  -d width=800 -d fit=contain -d format=webp \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: imagekit-resize-convert-to-webp-compress-crop.p.rapidapi.com" \
  -o photo.webp
Enter fullscreen mode Exit fullscreen mode

Endpoints

  • /resize: fit modes contain, cover and fill. It never upscales by accident.
  • /convert: convert between JPEG, PNG, WebP, GIF, BMP, TIFF and ICO, with a quality setting.
  • /compress?quality=70&max_width=1600&modern=true: the fastest way to pass Lighthouse.
  • /thumbnail?size=200&square=true
  • /crop, /rotate (including flips) and /grayscale
  • /strip-exif: removes GPS and camera data before you publish user uploads.
  • /info: format, dimensions, alpha channel, animation and EXIF data.

Add output=base64 to get JSON instead of the image bytes, which is handy in Zapier or n8n. Images can be up to 15 MB and 40 MP.

MCP

For agents, the MCP server is at https://imagekit-resize-convert-to-webp-compress-crop.p.rapidapi.com/mcp.

There's a free plan. ImageKit on RapidAPI

Top comments (0)