Resize
Request a resized image that fits in a rectangle of given width and height without changing the aspect ratio.
| Transformation | Examples | Description |
|---|---|---|
resize=width,height | resize=100,100 | request a resized image that fits in a rectangle of given width, height |
resize=width,height,fill:color | resize=100,150,fill:red resize=100,100,fill:blue | resize and fill any gaps with given color |
The transformation parameters are described below:-
| Parameter | Description |
|---|---|
width | width of the transformation requested. Specify 0 (zero) for original source image width or the maximum allowed (2048) |
height | height 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
| URL | Result |
|---|---|
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?resize=100,100 | fits inside 100x100, keeping the aspect ratio |
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?resize=300,300,fill:white | exactly 300x300, with any gap filled white |
https://cdn.filespin.io/api/v1/assets/{ASSET_ID}/conversions?resize=100,150,fill:red | exactly 100x150, with any gap filled red |