Skip to main content

Resize

Request a resized image that fits in a rectangle of given width and height without changing the aspect ratio.

TransformationExamplesDescription
resize=width,heightresize=100,100request a resized image that fits in a rectangle of given width, height
resize=width,height,fill:colorresize=100,150,fill:red resize=100,100,fill:blueresize and fill any gaps with given color

The transformation parameters are described below:-

ParameterDescription
widthwidth of the transformation requested. Specify 0 (zero) for original source image width or the maximum allowed (2048)
heightheight of the transformation requested. Specify 0(zero) for original source image height or the maximum allowed (1536)
fill:color(optional) fill color to fit to the specified size when preserving aspect ratio. color can be auto, transparent or HTML color name such as red or hexadecimal color code such as FF0000

Examples​

Resize parameters go on the asset's on-demand image URL, like every other transformation, and combine with other options using &:

https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?resize=100,100

URLResult
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?resize=100,100fits inside 100x100, keeping the aspect ratio
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?resize=300,300,fill:whiteexactly 300x300, with any gap filled white
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?resize=100,150,fill:redexactly 100x150, with any gap filled red