Media
Image Processing API
Powerful image manipulation pipeline powered by sharp. Chain up to 10 operations including resize, crop, rotate, flip, grayscale, blur, sharpen, and compress. Supports JPEG, PNG, WebP, and AVIF output formats.
Endpoint:
/v1/image/processMethod:POST
Latency:~200ms
Try it out
POST
/v1/image/processParameters
Code
curl
curl -X POST "https://khaleejiapi.dev/api/v1/image/process?url=https%3A%2F%2Fpicsum.photos%2F800%2F600&outputFormat=jpeg" \ -H "X-API-Key: your_api_key"Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| url | string | Required | HTTPS URL of source image (max 10 MB) |
| operations | array | Required | Array of operations (max 10) |
| outputFormat | string | Optional | jpeg, png, webp, or avif (default: jpeg) |
Available Operations
resize
Resize image. Params: width (1–8192), height (1–8192) — at least one required
crop
Crop image. Params: width, height (required), x, y (optional offset)
rotate
Rotate image. Params: angle (0–360 degrees)
flip
Flip image. Params: direction ('horizontal' or 'vertical')
grayscale
Convert to grayscale. No additional parameters
blur
Apply Gaussian blur. Params: sigma (0.3–100)
sharpen
Sharpen image. No additional parameters
compress
Compress image. Params: quality (1–100)
Response
Returns the processed image as a binary response with informational headers:
Content-Type — MIME type of the output imageX-Original-Size — Original image size in bytesX-Processed-Size — Processed image size in bytesX-Operations — Comma-separated list of applied operationsRate Limits
| Plan | Requests/Month | Rate Limit |
|---|---|---|
| Free | 500 | 5 req/min |
| Starter | 5,000 | 30 req/min |
| Professional | 50,000 | 120 req/min |
| Business | 250,000 | 500 req/min |