Available on RapidAPI

Image & PDF
Transformation API

Chain thumbnail, resize, rotate, crop, flip, and watermark operations in a single REST call. Supports JPEG, PNG, GIF, WEBP, and multi-page PDFs.

POST /process
curl -X POST \
  https://api.example.com/process \
  -H "X-RapidAPI-Key: YOUR_KEY" \
  -F "file=@photo.jpg" \
  -F 'steps=[
    {"op":"rotate","args":[15]},
    {"op":"thumbnail","args":[800]}
  ]' \
  -F "format=JPEG" \
  --output result.jpg

Everything you need to process images at scale

A pipeline-based approach lets you compose multiple transforms in one round-trip.

  • Chainable Pipeline — Compose unlimited operations in a single request. Each step receives the output of the previous one.
  • PDF Support — Upload multi-page PDFs and render any page to an image at a configurable DPI.
  • Format Conversion — Output any uploaded image as JPEG, PNG, WEBP, or GIF — regardless of the source format.
  • In-Memory Processing — Upload and transform in a single /process call. No server-side storage — your image is processed and returned immediately.
  • Dry-Run Validation — Validate your pipeline steps before executing them with the /validate endpoint.
  • Plan-Based Limits — File size and step count limits are enforced per plan. BASIC and PRO tiers available.

Quickstart

Get a processed image in under a minute.

  1. Get your API key

    Subscribe on RapidAPI and copy your X-RapidAPI-Key.

  2. Process an image

    curl -X POST \
      https://api.example.com/process \
      -H "X-RapidAPI-Key: YOUR_KEY" \
      -F "file=@photo.jpg" \
      -F 'steps=[
        {"op": "rotate", "args": [90]},
        {"op": "thumbnail", "args": [400]}
      ]' \
      -F "format=JPEG" \
      --output out.jpg

Plans

All plans enforced via RapidAPI gateway.

Basic

Free

  • 10 free requests/month (Hard limit)
  • 5 MB max file size
  • 3 steps per request
  • JPEG, PNG, GIF, WEBP
  • PDF rendering
Get Started

API Reference

Authentication

All requests must include your RapidAPI key and subscription tier in the request headers:

HeaderRequiredDescription
X-RapidAPI-KeyYesYour RapidAPI API key
X-RapidAPI-SubscriptionNoPlan tier: BASIC (default) or PRO
X-RapidAPI-Proxy-SecretNoInjected automatically by the RapidAPI gateway — do not set manually

Endpoints

POST /process

Upload an image or PDF and apply pipeline steps in a single request. The image is processed in-memory and returned immediately — nothing is stored on the server.

Request multipart/form-data

FieldTypeRequiredDefaultDescription
fileFileYesJPEG, PNG, GIF, WEBP, or PDF
stepsstringYesJSON-encoded array of step objects
formatstringNoJPEGOutput format: JPEG, PNG, WEBP, GIF
pageintegerNo0PDF only. 0-indexed page number.
dpiintegerNo150PDF only. Render DPI.

Example (cURL)

curl -X POST https://api.example.com/process \
  -H "X-RapidAPI-Key: YOUR_KEY" \
  -F "file=@photo.jpg" \
  -F 'steps=[{"op":"cropULWH","args":[0,0,400,300]},{"op":"thumbnail","args":[200]}]' \
  -F "format=PNG" \
  --output cropped.png

Errors

StatusCondition
400Invalid file type, malformed steps JSON, or unknown operation
403Step count exceeds plan limit
413File exceeds plan size limit
POST /validate

Dry-run validation. Checks that all operations exist and arguments are well-formed without executing the pipeline or requiring an image.

Request Body application/json

FieldTypeRequiredDescription
stepsarrayYesList of step objects to validate

Response 200 OK — valid pipeline

{ "valid": true, "steps": 2 }

Response 400 — invalid steps

{
  "detail": [
    { "step": 0, "op": "bad_op", "error": "Unknown operation: 'bad_op'" }
  ]
}
GET /operations

List all available registered operations with their descriptions.

Response 200 OK

[
  { "name": "thumbnail", "description": "Create a thumbnail..." },
  { "name": "resize",    "description": "Resize the image..." },
  // ...
]
GET /hex_to_rgb

Utility: convert a hex color string to an RGB array usable in operation arguments like fillcolor.

Query Parameters

ParameterTypeRequiredDescription
hex_colorstringYesHex color, e.g. #FF5733 or FF5733

Response 200 OK

{ "rgb": [255, 87, 51] }

Errors

StatusCondition
400Invalid hex color format

Operations Reference

All operations are passed as objects in the steps array with op, args, and/or kwargs fields.

thumbnail Resize

Fit the image within a square of max_dimension × max_dimension pixels, preserving aspect ratio using high-quality Lanczos resampling. The image is modified in-place (never enlarged).

ArgumentTypePositionDescription
max_dimensionintargs[0]Maximum width or height in pixels
{ "op": "thumbnail", "args": [400] }
resize Resize

Resize to exact pixel dimensions. Does not preserve aspect ratio.

ArgumentTypePositionDescription
widthintargs[0]Target width in pixels
heightintargs[1]Target height in pixels
{ "op": "resize", "args": [1280, 720] }
rotate Transform

Rotate the image counter-clockwise by the given angle. Background fill color is applied to corners exposed by rotation.

ArgumentTypePosition / KeyDefaultDescription
anglefloatargs[0]Degrees to rotate (counter-clockwise)
expandboolkwargstrueExpand canvas to fit rotated image
fillcolor[R,G,B] or [R,G,B,A]kwargs[0,0,0,0]Color to fill exposed corners
{ "op": "rotate", "args": [45], "kwargs": { "fillcolor": [255, 255, 255] } }
cropLTRB Crop

Crop using absolute pixel coordinates: left, top, right, bottom.

ArgumentTypePositionDescription
leftintargs[0]Left edge (pixels from left)
topintargs[1]Top edge (pixels from top)
rightintargs[2]Right edge (pixels from left)
bottomintargs[3]Bottom edge (pixels from top)
{ "op": "cropLTRB", "args": [100, 50, 500, 400] }
cropULWH Crop

Crop using upper-left origin with explicit width and height.

ArgumentTypePositionDescription
xintargs[0]Upper-left x coordinate
yintargs[1]Upper-left y coordinate
widthintargs[2]Width of the crop region
heightintargs[3]Height of the crop region
{ "op": "cropULWH", "args": [0, 0, 400, 300] }
flip Transform

Mirror the image horizontally or vertically.

ArgumentTypePositionValues
directionstringargs[0]"horizontal" or "vertical"
{ "op": "flip", "args": ["horizontal"] }
fill_background_color Compositing

Flatten a transparent (RGBA) image onto a solid color background. Useful before converting to JPEG which has no alpha channel.

ArgumentTypePositionDescription
color[R,G,B]args[0]Background color as an RGB array
{ "op": "fill_background_color", "args": [[255, 255, 255]] }

Error Codes

StatusMeaning
400 Bad RequestInvalid file type, malformed JSON steps, unknown operation, or bad arguments
403 ForbiddenRequest didn't come through RapidAPI gateway, or step count exceeds plan limit
413 Payload Too LargeUploaded file exceeds the plan's maximum file size
422 UnprocessableOperation failed at runtime (e.g. incompatible image state)

All error responses return JSON with a detail field:

{ "detail": "File too large. Max size for your tier: 5MB" }