Skip to content
Browse all functions

Resize an Image

images/resizeimage

resizeimage (Resize an Image) is a 1001fx API function in the group Images: POST https://api.1001fx.com/images/resizeimage, 3 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

3 credits per callHTTP APIn8nMake

Resizes an image to the specified width and height.

  • Either a height or a width need to be specified

Try it in the 1001fx app

Run resizeimage in your browser with your API key – fill the form, click Run and get the answer or the file.

resizeimage in the 1001fx app: the form with example values
Resize an Image in the 1001fx app

Endpoint

POSThttps://api.1001fx.com/images/resizeimage
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
multipart/form-data

Parameters

  • widthnumberoptional

    The width to resize the image to.

    Min:
    1
    Max:
    10000
    Example:
    100
  • heightnumberoptional

    The height to resize the image to.

    Min:
    1
    Max:
    10000
    Example:
    100
  • filefilerequired

    Image file to be processed.

Examples

Resize to a width of 1200

The height follows the aspect ratio.

Input

Expects one image file named as file parameter: file
{
  "width": "1200",
  "files": [
    {
      "name": "1600x900.png",
      "type": "image/png",
      "path": "testdata/images/1600x900.png"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "image/png"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/images/resizeimage' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@1600x900.png' \
  -F 'width=1200'

Resize to a height of 700

The width follows the aspect ratio.

Input

Expects one image file named as file parameter: file
{
  "height": "700",
  "files": [
    {
      "name": "1600x900.png",
      "type": "image/png",
      "path": "testdata/images/1600x900.png"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "image/png"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/images/resizeimage' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@1600x900.png' \
  -F 'height=700'

Resize to 1200×700

Width and height given.

Input

Expects one image file named as file parameter: file
{
  "width": "1200",
  "height": "700",
  "files": [
    {
      "name": "1600x900.png",
      "type": "image/png",
      "path": "testdata/images/1600x900.png"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "image/png"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/images/resizeimage' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@1600x900.png' \
  -F 'width=1200' \
  -F 'height=700'

Use cases

Try resizeimage now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.013.02.2023created
Ask 1001fx