| Type | Supported Formats | Supported Types | |
|---|---|---|---|
| Library Template | png jpg jpeg webp pdf | base64 url binary |
Automate this template using integrations
You can generate Dynamic Image Resizer renders using Rest API and Orshot SDKs
await fetch("https://api.orshot.com/v1/generate/images", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer <ORSHOT_API_KEY>",
},
body: JSON.stringify({
"templateId": "dynamic-image-resizer",
"response": {
"format": "png",
"type": "base64"
"scale": 1
},
"modifications": {
"imageUrl": "",
"aspectRatio": "auto",
"width": "800",
"height": "800",
"resizeType": "",
"padding": "0",
"backgroundImageUrl": "",
"backgroundColor": "#fff",
"backgroundPosition": "center",
"backgroundBlur": "0"
}
}),
});You can customize the template using following modifications
| Key | Description | Type |
|---|---|---|
| imageUrl | URL of the image to resize | string |
| aspectRatio | Aspect ratio for the resized image | string |
| width | Width of output image in pixels | number |
| height | Height of output image in pixels | number |
| resizeType | How the image should be resized to fit the container(cover: cover available space, contain: fit in available space, fill: fill available space) | select |
| padding | Padding around the image in pixels | number |
| backgroundImageUrl | Link to background image | string |
| backgroundColor | Hex or CSS color of background | string |
| backgroundPosition | Position of background image | string |
| backgroundBlur | Blur amount for background image in pixels | number |