Image Delivery

Serve or transform an image

Fetch an image from the CDN — optionally transformed on the fly via query params — from img.pixelvault.dev (not the API host). No API call or auth for public images. Transforms are edge-cached; invalid params are ignored (the original is returned, never an error); SVG sources are served as-is (not transformed). filename is {image_id}.{ext} and may be preceded by a folder path (e.g. blog/img_abc123.png). The effect params (segment, gravity, zoom, blur, sharpen, rotate, flip, brightness, contrast, saturation) apply to your project images, not the anonymous playground. Response headers: X-PV-Transform echoes the applied operations; X-PV-Cache is HIT|MISS.

get/{project_id}/{filename}

Request

  • Base URL: https://img.pixelvault.dev
  • URL: https://img.pixelvault.dev/{project_id}/{filename}
  • Auth: none declared

Path parameters

project_idstring required

Project ID (omit on custom domains, where it is implied by the host).

filenamestring required

{image_id}.{ext}, optionally folder-prefixed (e.g. blog/img_abc123.png).

Query parameters

size's' | 'm' | 'l' | 'social'

Named preset (wins over w/h). s=256w, m=640w, l=1280w, social=1200×630 OG card.

winteger

Target width in px, snapped up to a discrete set (16–4000).

hinteger

Target height in px, snapped up to a discrete set (16–4000).

fit'scale-down' | 'contain' | 'cover' | 'crop' | 'pad'

Resize mode. scale-down (default) never enlarges a smaller source; the others fit the exact box and may upscale.

fmt'auto' | 'webp' | 'avif' | 'jpg' | 'png'

Output format. auto negotiates WebP/AVIF via the Accept header. Omit to keep the source format. format is accepted as an alias.

q'auto' | '60' | '75' | '85'

Output quality (discrete steps).

segment'foreground'

AI background removal → transparent cut-out. Forces PNG unless a solid background or fmt=webp/avif is set. Project images only.

backgroundstring

Fill behind a removed background (or the fit=pad area): hex (%23ffaa00), rgb()/rgba(), or a common CSS color name.

gravitystring

Crop gravity, with fit=cover/crop. face is face-aware. XxY = 0.0–1.0 coordinates.

zoomnumber

Face-crop tightness, with gravity=face.

blurinteger

Gaussian blur (0–250, snapped to a discrete set). 0 = off.

sharpennumber

Sharpen strength (0–10, snapped). 1 is a good default for downscaled images. 0 = off.

rotate90 | 180 | 270

Rotate in 90° steps.

flip'h' | 'v' | 'hv'

Mirror horizontally, vertically, or both.

brightnessnumber

Brightness multiplier, snapped to 0.5/0.75/1.25/1.5/2. 1 = no change.

contrastnumber

Contrast multiplier, snapped to 0.5/0.75/1.25/1.5/2. 1 = no change.

saturationnumber

Saturation multiplier, snapped to 0/0.5/1.5/2. 0 = grayscale; 1 = no change.

tilestring

Watermark: the filename of another RASTER image (png/jpg/webp/avif) in the SAME project (e.g. img_logo.png — optionally folder-prefixed), tiled edge-to-edge at its native size over the base. Bake opacity into the source PNG. Must be your own uploaded raster image — not an external URL and not SVG. A missing filename is ignored (the base is served).

tokenstring

HMAC signature for a signed (private) URL. When transform params are present they are bound into the signature.

expiresinteger

Unix timestamp (seconds) after which a signed URL is rejected.

Response

The image, transformed if params were supplied.

Changes

No recorded changes to this operation across all 1 revision of this API.