V1 Image Transformations - Resize, Fit and Align

You can adjust the image size by setting the width and/or height in pixels and specify the alignment and fit.

Crop and Resize: If you are trying to combine crop and resize parameters, you need to add the crop_first=true parameter in order to ensure the crop happens before the resize.

Filepicker has a limit to how large the images it will accept for conversions can be. The maximum accepted image size is 100,000,000 pixels, so an image with this many pixels could have width and height combinations like 10,000 x 10,000 or 5,000 x 20,000, etc.

Syntax

https://www.filestackapi.com/api/file/<handle>/convert?[options]
w Resize the image to this width.
h Resize the image to this height.
fit

Specifies how to resize the image. Possible values are:

clip Resizes the image to fit within the specified parameters without distorting, cropping, or changing the aspect ratio.
crop Resizes the image to fit the specified parameters exactly by removing any parts of the image that don't fit within the boundaries.
scale Resizes the image to fit the specified parameters exactly by scaling the image to the desired size.
max Resizes the image to fit within the parameters, but as opposed to 'clip' will not scale the image if the image is smaller than the output size.

Default value set to "clip".

align

Using align, you can choose the position of the cropped area.

Possible values:

top bottom left right faces

By default, it crops from the center. You can also specify pairs e.g. 'top,left'.

Examples

Original image

width = 400px, height = 300px

the original image before being resized

Image resized to the specific width

width=200px

the image resized to a width of 200 pixels

Image resized to the specific height

height = 200px

the image resized to a height of 200 pixels

Image resized to the specific width and height

width=160px, height=120px

the image with both the width and height altered

You can also increase the size, but be aware that it can affect the quality of the image

width=500px

the image resized beyond its original proportions


Image resized to specific width and height and cropped to fit these parameters

width = 200px, height = 100px, fit = crop

image resized to a specific size by removing a portion of the image

Image resized to specific width and height and scaled to fit these parameters

width = 200px, height = 100px, fit = scale

image resized to a specific size by scaling the image

Image resized to specific width and height without scaling if the image is smaller than the output size

width = 1500px, height = 500px, fit = max

image resized to a specific size without scaling the image

Image resized to specific width and height and cropped to fit these parameters with set aligment

width = 380px, height = 60px, fit = crop, align = bottom

image resized to a specific size by removing part of the image and changing the focus to the bottom of the image