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/process
Method:POST
Latency:~200ms

Try it out

POST/v1/image/process

Parameters

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

FieldTypeRequiredDescription
urlstringRequiredHTTPS URL of source image (max 10 MB)
operationsarrayRequiredArray of operations (max 10)
outputFormatstringOptionaljpeg, 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 image
X-Original-Size — Original image size in bytes
X-Processed-Size — Processed image size in bytes
X-Operations — Comma-separated list of applied operations

Rate Limits

PlanRequests/MonthRate Limit
Free5005 req/min
Starter5,00030 req/min
Professional50,000120 req/min
Business250,000500 req/min