Back to Projects

Image Optimizer API

Convert and optimize images to WebP format with configurable quality settings. Reduce file sizes while maintaining visual quality.

Endpoint

POST/api/optimize-image

Upload an image to convert it to optimized WebP format. Max file size: 5MB.

Request (multipart/form-data)

imagefile (required)Image file to optimize. Supported: JPEG, PNG, GIF
widthnumber (optional)Target width for resizing (preserves aspect ratio if only one dimension provided)
heightnumber (optional)Target height for resizing

Response Headers

Content-Typeimage/webpOptimized image in WebP format
X-Original-Sizenumber (bytes)Original file size
X-Optimized-Sizenumber (bytes)Optimized file size
X-Size-ReductionstringPercentage reduction (e.g., "45%")
X-Image-WidthnumberOutput image width
X-Image-HeightnumberOutput image height

🧪 Try It Live

Upload an image to see the optimization in action.

Drop an image here or click to select

JPEG, PNG, GIF up to 5MB

Example Request

curl -X POST https://beanola.com/api/optimize-image \
  -F "image=@photo.jpg" \
  -o optimized.webp