Imaging

Image Resize

Resize an image and output as either JPEG or PNG

post/image-resize

Request

  • Base URL
    https://neutrinoapi.net
  • Auth
    API key in header user-id and API key in header api-key

Request body application/x-www-form-urlencoded

image-urlstring required

The URL or Base64 encoded Data URL for the source image. You can also upload an image file directly using multipart/form-data

widthinteger required

The width to resize to (in px)

heightinteger

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

formatstring

The output image format, can be either png or jpg

resize-modestring

The resize mode to use, we support 3 main resizing modes: <ul> <li><b>scale</b> <br> 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</li> <li><b>pad</b> <br> 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</li> <li><b>crop</b> <br> 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</li> </ul>

bg-colorstring

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)

Response

OK

string binary required

Changes

No recorded changes to this operation across all 4 revisions of this API.