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.
Request
- Base URL: https://img.pixelvault.dev
- URL: https://img.pixelvault.dev/{project_id}/{filename}
- Auth: none declared
Path parameters
Project ID (omit on custom domains, where it is implied by the host).
{image_id}.{ext}, optionally folder-prefixed (e.g. blog/img_abc123.png).
Query parameters
Named preset (wins over w/h). s=256w, m=640w, l=1280w, social=1200×630 OG card.
Target width in px, snapped up to a discrete set (16–4000).
Target height in px, snapped up to a discrete set (16–4000).
Resize mode. scale-down (default) never enlarges a smaller source; the others fit the exact box and may upscale.
Output format. auto negotiates WebP/AVIF via the Accept header. Omit to keep the source format. format is accepted as an alias.
Output quality (discrete steps).
AI background removal → transparent cut-out. Forces PNG unless a solid background or fmt=webp/avif is set. Project images only.
Fill behind a removed background (or the fit=pad area): hex (%23ffaa00), rgb()/rgba(), or a common CSS color name.
Crop gravity, with fit=cover/crop. face is face-aware. XxY = 0.0–1.0 coordinates.
Face-crop tightness, with gravity=face.
Gaussian blur (0–250, snapped to a discrete set). 0 = off.
Sharpen strength (0–10, snapped). 1 is a good default for downscaled images. 0 = off.
Rotate in 90° steps.
Mirror horizontally, vertically, or both.
Brightness multiplier, snapped to 0.5/0.75/1.25/1.5/2. 1 = no change.
Contrast multiplier, snapped to 0.5/0.75/1.25/1.5/2. 1 = no change.
Saturation multiplier, snapped to 0/0.5/1.5/2. 0 = grayscale; 1 = no change.
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).
HMAC signature for a signed (private) URL. When transform params are present they are bound into the signature.
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.