Output width. If you set only w or h, picturium calculates the other dimension from the source ratio or ar.
Docs / Quick reference
Quick reference v0.2.0
Every URL parameter, format and status code on one page. A request is
GET /<path-under-data-dir>?<params> and the response is the transformed file. The
Request model covers signing, caching, fallbacks, errors and
capacity in more detail.
Working in PHP? The official PHP library gives you typed builders
for every parameter, signed URLs, responsive srcset and <picture> markup.
Request shape
- The path selects the file. The query string describes the transforms.
- Named values are case-insensitive (
g=Center=g=center). - Most parameters have interchangeable short and long names (
w=width). Sub-parameter keys are case-sensitive. - Grouped parameters use
key:valuepairs joined by|— e.g.crop=w:400|h:300|g:attention. - A file picturium can’t process is served unchanged only if its extension is in
data.serve. Otherwise you get415.
URL parameters
No parameter matches that. The site search (/) covers every page.
Size & fit
Output height. A value of 0 or an empty value means no height was requested.
Custom ratio must be a fraction — ar=1 is rejected, ar=1/1 is not. Ignored when both w and h are set.
cover crops overflow, contain adds padding, and force stretches the image.
Chooses which part a cover crop keeps, or where a contained image sits. attention and entropy use smart cropping; animated sources use center.
Multiplies w and h before processing.
Multiplies w and h during processing.
Allows the output to be larger than the source. SVG, PDF, Office and vector sources default to true.
Resampling kernel.
Canvas & orientation
Adds space around the image. extend controls how that space is filled.
How padding / aspect-ratio fill is filled.
Colour for padding and flattened transparency.
Rotate by a fixed step or named direction.
Applies the EXIF orientation tag.
Format & quality
auto uses the Accept header and format priority, then falls back to webp. It never selects gif automatically. pdf and svg pass through supported documents.
Sets output quality using the selected format's quality curve.
Keep several metadata types by separating them with commas, for example meta=icc,exif.
Downloads the response as an attachment. The filename does not select or override f.
Documents & video
Resolution used to rasterise SVG, PDF, Office and vector sources. Under f=pdf with an SVG source it sets the page scale instead.
Extra CSS applied to an SVG source (and to f=pdf from SVG).
Selects up to pdf.max_pages (512) document pages. For animation, the first value selects the starting frame. For video, use t instead.
The only way to address a video frame. Seeks to the nearest keyframe.
Crop, effects & limits
Cut a region from the original before w / h / ar / fit / pad.
Image effects, applied left to right and combined with |.
Control an animation / extract a video clip.
Overlay an image or text mark.
Cap output pixels or bytes.
Cache & delivery
Returns the source unchanged, without transforms or a watermark.
Skips cached responses, regenerates the file, and replaces the cache entry. The response uses Cache-Control: no-store and never returns 304.
Changes the browser or CDN cache key without changing the server cache key.
Uses another source when the requested source is missing, or when a PDF exceeds a pdf.max_* limit. It does not catch other processing failures.
Required only when signature verification is enabled. Signed over "path?query" with token= removed.
Grouped parameters
crop
Set at least one of w, h, or ar. Cropping happens on the original before sizing,
fitting, or padding. Out-of-bounds areas are clamped instead of rejected. Smart gravity
(g=attention or g=entropy) ignores x and y. Cropping is skipped for f=pdf,
f=svg, and original.
See Cropping for region sizing, gravity, offsets, smart crop, and worked examples.
filter
Combine several effects in one value: filter=brightness:1.1|contrast:1.2|blur:2.
Gives a monochrome / duotone look.
See Filters & effects for composition order, examples, palettes, and animation behaviour.
anim · animate
Animated GIF, WebP, AVIF, HEIC, and multi-page TIFF sources keep their animation without an
anim parameter. Only webp and gif outputs can remain animated. Use anim=off (or
false, no, or 0) to return only the first frame. For video, anim extracts a clip:
t sets the start and frames sets its length.
Counts from the frame selected by page, up to output.max_animation_frames (300 by default).
Replaces the source frame delay.
Same control as a rate. Cannot be combined with timing.
Keeps every Nth frame.
See Animation & video for output-format behaviour, frame selection, video clip defaults, examples, and processing costs.
watermark
Each key falls back to its [watermark] configuration value. Use watermark=false to
disable it for one request. Watermarks are skipped for f=pdf, f=svg, and original;
otherwise they appear on every frame and document page. dpr scales pad, scale, and size.
Takes priority over text at the same level; request values take priority over configured sources.
Used when no image is given.
Also the gap between tiles under anchor:repeat.
Image mark only.
Text mark only.
Text mark only.
Text mark only.
See Watermarking for source precedence, path safety, placement, configuration, and worked examples.
limit · limits
Scales down while preserving the aspect ratio.
Re-encodes at a lower quality until the file fits.
thumb · thumbnail
thumb=page:1,2 still works, but its p, page, and pages keys are deprecated. Use
the top-level page parameter instead. It has the same syntax and takes priority when both
are present.
Formats
Input
- Photos
-
- jpeg
- png
- tiff
- webp
- gif
- heif · heic · avif
- jxl
- jp2k
- ico
- bmp
- Design & vector
-
- psd
- svg · svgz
- eps
- ai
- cdr · cmx · cdt
- dxf
- Documents
-
- doc
- docx
- odt
- rtf
- ppt
- pptx
- odp
- xls
- xlsx
- ods
- csv
- + macro & template variants
- Camera RAW
-
- raf
- rw2
- pef
- orf
- nrw
- nef
- dng
- cr2
- cr3
- crw
- arw
- Video
-
- mp4
- webm
- mkv
- avi
- av1
- 3gp
- m4v
- flv
- mov
- mpeg
- mts
- hevc
Output
- Images
-
- jpeg
- webp
- png
- gif
- avif
- jxl
- Animated
-
- webp
- gif
- Documents
-
- svg
pdf and svg are document passthrough: the document itself is served.
f=autopicks the first entry ofoutput.format_prioritythe client accepts, falling back towebp.gifis not in the default priority, soautonever picks it.- Only
webpandgifoutput can hold an animation; every other format gets the first frame. f=svgneeds an SVG or vector source;f=pdfneeds a PDF, office, SVG or vector source — otherwise415. See Documents & vectors for page selection and conversion details.
See Output format & quality for negotiation, quality curves, encoder options, metadata, limits, and download behaviour.
HTTP status codes
Returns the transformed file or an allowed passthrough file.
A client validator (ETag / If-Modified-Since) matched. Never returned with force=true.
A known query parameter is invalid, or a page selection lands on no existing page.
Signature verification is on and token is missing or wrong.
The source file was not found inside the data directory.
The source cannot be processed and its extension is not in data.serve — or f=pdf / f=svg was asked for a source that cannot produce one.
Processing, conversion, or encoding failed, for example because t is past the end of a video.
The request queue is full.
Response headers to check
Content-Type— the negotiated output MIME.Content-Disposition— set whendownload=is given.Cache-Control— fromcache.cache_control, orno-storewhenforce=true.ETag/Last-Modified— validators for conditional requests (drive the304).Vary: Accept— only when the format was negotiated (f=auto).
See HTTP caching for validator precedence and the
difference between cache= and force=true.
GET /health returns JSON with a status (healthy / warning / unhealthy). Worker and queue
counts and memory statistics are only added with a valid security.health_token. Thresholds and HTTP behaviour are in
Health & capacity.
Configuration
- File
config.toml(or the path inPICTURIUM_CONFIG). Every key is optional; an unknown key refuses to boot. - Any key can be an env var:
PICTURIUM__SECTION__KEY,__between levels, list values comma-separated. E.g.PICTURIUM__SERVER__PORT=8080.
# config.toml with every default below. Copy only the keys you change.
[server]
host = "0.0.0.0"
port = 20045
workers = 0 # 0 = 2× CPUs
queue_size = 100
log_level = "debug"
[security]
signature_enabled = false
signature_secret = ""
[cors]
allowed_origins = ["*"] # permissive
[data]
dir = "data" # stripped from the URL
serve = [] # ["*"] serves any file as-is
[cache]
dir = "cache" # one process per dir
cache_control = "public, max-age=604800, must-revalidate"
[cache.memory]
limit = 256 # MiB
[cache.disk]
limit = 1024 # MiB
[image]
fit = "cover"
gravity = "center"
upsize = false
auto_rotate = true
resample = "lanczos3"
extend = "bg"
[output]
quality = "medium"
format_priority = ["jxl", "avif", "webp", "jpeg", "png"]
metadata = ["none"]
max_width = 5000 # 0 = unlimited
max_height = 5000 # 0 = unlimited
max_size = "0" # 0 = unlimited
[watermark]
enabled = false
[video]
default_time = "1"
[svg]
allow_local_resources = false
See the config key reference for every key and its explanation. The
repository also includes config.toml.example with the same defaults and inline comments.