API Basics
Data Tools
WWW
Browser Bot
HTML Clean
URL Info
Telephony
Geolocation
Security and Networking
E-commerce
Imaging
Legacy APIs

Image Resize

Resize an image and output as either JPEG or PNG.

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.

End Point

https://neutrinoapi.net/image-resize
Test API
API Request
ParameterRequiredTypeDefaultDescription
image-urlyesstringThe URL or Base64 encoded Data URL for the source image. You can also upload an image file directly using multipart/form-data
widthyesintegerThe width to resize to (in px)
heightnointegerThe 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
formatnostringpngThe output image format, can be either png or jpg
resize-modenostringscaleThe 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-colornostringtransparentThe 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
API Performance
CharacteristicValueDescription
Avg Latency60msAverage RTT for requests within the same data center/region
Max Rate6/secondMaximum inbound request rate. Exceeding this will result in request throttling
Max Concurrency50Maximum concurrent/simultaneous requests. Exceeding this will result in error code 06 [TOO MANY CONNECTIONS]

API Example
curl https://neutrinoapi.net/image-resize \ --header "User-ID: <your-user-id>" \ --header "API-Key: <your-api-key>> \ --data-urlencode "resize-mode=scale" \ --data-urlencode "width=32" \ --data-urlencode "format=png" \ --data-urlencode "image-url=https://www.neutrinoapi.com/img/LOGO.png" \ --data-urlencode "bg-color=transparent" \ --data-urlencode "height=32" \ --output "image-resize.png"