This API uses a high-grade and adaptive image scaling algorithm and will preserve the aspect ratio of the original image.
You can also convert many image formats automatically, we currently support source images in these formats: GIF, ICO, JPEG, PNG, TIFF.
The URL or Base64 encoded Data URL for the source image. You can also upload an image file directly using multipart/form-data
width
yes
integer
The width to resize to (in px)
height
no
integer
The height to resize to (in px). If you don't set this field then the height will be automatic based on the requested width and image aspect ratio
format
no
string
png
The output image format, can be either png or jpg
resize-mode
no
string
scale
The resize mode to use, we support 3 main resizing modes:
scale Resize to within the width and height specified while preserving aspect ratio. In this mode the width or height will be automatically adjusted to fit the aspect ratio
pad Resize to exactly the width and height specified while preserving aspect ratio and pad any space left over. Any padded space will be filled in with the 'bg-color' value
crop Resize to exactly the width and height specified while preserving aspect ratio and crop any space which fall outside the area. The cropping window is centered on the original image
bg-color
no
string
transparent
The image background color in hexadecimal notation (e.g. #0000ff). For PNG output the special value of 'transparent' can also be used. For JPG output the default is black (#000000)
API Response
PNG
JPG
API Performance
Characteristic
Value
Description
Avg Latency
60ms
Average RTT for requests within the same data center/region
Max Rate
6/second
Maximum inbound request rate. Exceeding this will result in request throttling
Max Concurrency
50
Maximum concurrent/simultaneous requests. Exceeding this will result in error code 06 [TOO MANY CONNECTIONS]