Resize Image
POST
https://picnie.com/api/v1/resize-imageResize bulk images using height and width or by percentage. Options to maintain aspect ratio or prevent enlargement of smaller images.
Headers
| Name | Type | Description |
|---|---|---|
Authorization* | string | Pass api key in the authorization field Example: |
Body Parameters
| Name | Type | Description |
|---|---|---|
project_id* | integer | The ID of the project. Create one using Picnie's dashboard if needed. Example: |
image_url* | string | URL of the image to resize. Example: |
resize_type* | string | 1 for resizing with height and width, 2 for resizing by percentage. Example: |
height | string | Height in pixels. Required when resize_type is 1. Example: |
width | string | Width in pixels. Required when resize_type is 1. Example: |
resize_percentage | string | Percentage to resize. Required when resize_type is 2. Example: |
no_enlarge_on_smaller | string | Set to 1 to prevent enlarging smaller images. Example: |
is_maintain_aspect_ratio | string | Set to 1 to maintain aspect ratio, 0 to use exact dimensions. Example: |
Notes
⚠️ Authentication required
curl -X POST "https://picnie.com/api/v1/resize-image"
-H "Authorization: YOUR_API_KEY"
-H "Content-Type: application/json"
-d '{
"project_id": 1,
"image_url": "https://picnie.com/data/raw_images/demo_bg1.jpg",
"resize_type": "1",
"height": "500",
"width": "800",
"resize_percentage": "50",
"no_enlarge_on_smaller": "1",
"is_maintain_aspect_ratio": "1"
}'Responses
200200 OK
{
"error": false,
"message": "Success",
"url": "https://picnie.com/v1/data/rs_7986_230217110641.jpg"
}