The Images API allows you to serve and transform images on-the-fly. You can resize, crop, apply effects, and optimize images for different use cases.
Access and serve an image, with optional transformations applied on-the-fly.
GET /file/:path
Parameter | Type | Description |
---|---|---|
path | String | The path to the image file |
Parameter | Type | Description |
---|---|---|
w | Integer | Width in pixels (1-5000) |
h | Integer | Height in pixels (1-5000) |
fit | String | Resize mode: cover, contain, fill, inside, outside |
q | Integer | Quality (1-100) |
blur | Number | Blur radius (0.3-1000) |
sharp | Boolean | Apply sharpening |
gray | Boolean | Convert to grayscale |
rot | Integer | Rotation angle (-360 to 360) |
border | String | Format: 'width_hexcolor' (e.g., '5_FF0000') |
crop | String | Format: 'x,y,width,height' |
curl https://api.getpronto.io/v1/file/image.jpg?w=800&h=600&fit=cover&q=90 \
-H "ApiKey: YOUR_API_KEY"
The response will be the image data with appropriate content-type headers.
Generate a URL for an image with specified transformations.
POST /file/:id/transform-url
Parameter | Type | Description |
---|---|---|
id | String | The unique identifier of the image |
Parameter | Type | Description |
---|---|---|
w | Integer | Width in pixels (1-5000) |
h | Integer | Height in pixels (1-5000) |
fit | String | Resize mode: cover, contain, fill, inside, outside |
q | Integer | Quality (1-100) |
blur | Number | Blur radius (0.3-1000) |
sharp | Boolean | Apply sharpening |
gray | Boolean | Convert to grayscale |
rot | Integer | Rotation angle (-360 to 360) |
border | String | Format: 'width_hexcolor' (e.g., '5_FF0000') |
crop | String | Format: 'x,y,width,height' |
format | String | Output format (jpg, png, webp, etc) |
curl -X POST https://api.getpronto.io/v1/file/123e4567-e89b-12d3-a456-426614174000/transform-url \
-H "ApiKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"w": 800,
"h": 600,
"fit": "cover",
"q": 90,
"format": "webp"
}'
{
"url": "https://api.getpronto.io/v1/file/image.webp?w=800&h=600&fit=cover&q=90",
"originalFile": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "image.jpg",
"mimetype": "image/jpeg"
},
"transformations": {
"w": 800,
"h": 600,
"fit": "cover",
"q": 90,
"format": "webp"
}
}
The following transformations can be applied to images either via URL parameters or through the transform URL endpoint:
Parameter | Type | Description |
---|---|---|
w, h | Integer | Target dimensions (1-5000px) |
fit | String | How image fits: cover (default), contain, fill, inside, outside |
Example: w=800&h=600&fit=cover
Parameter | Type | Description |
---|---|---|
q | Integer | JPEG/WebP quality (1-100) |
Example: q=90
Parameter | Type | Description |
---|---|---|
blur | Number | Gaussian blur (0.3-1000) |
sharp | Boolean | Sharpen the image |
gray | Boolean | Convert to grayscale |
Example: blur=5&sharp=true&gray=true
Parameter | Type | Description |
---|---|---|
rot | Integer | Rotation angle (-360 to 360) |
crop | String | Crop coordinates (x,y,width,height) |
Example: rot=90&crop=100,100,500,500
Note: Transformations are processed in the order they are specified. For example, if you apply both crop and resize, the image will be cropped first, then resized to the specified dimensions.
Continue exploring our documentation with these related topics: