Bỏ qua để đến nội dung
ViGrise Platform

URL Format & Parameters

Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.

PreviewProxy supports two request styles: path-style and query-style.

Parameters are embedded directly in the URL path, before the image URL:

http://your-host/<params>/<image_url>
http://your-host/w=400,h=300,format=webp/https://example.com/image.jpg

Multiple parameters are separated by commas. The image URL follows after a /.

If no transforms are needed, the params segment can be omitted entirely:

http://your-host/https://example.com/image.jpg

Parameters are passed as standard HTTP query string params to the /proxy endpoint:

http://your-host/proxy?url=<image_url>&param=value&...
http://your-host/proxy?url=https://example.com/image.jpg&w=400&h=300&format=webp

Path-style supports three equivalent syntaxes for each parameter. All can be freely mixed in the same request:

SyntaxExampleNotes
key=valuew=400,h=300Same keys as query-style
key:valuew:400,h:300Alternative separator
Shorthand400x300, q80, r90Compact notation for common params
ShorthandEquivalentDescription
WxHw=W,h=HWidth and height together (e.g. 300x200)
qNq=NQuality (e.g. q80)
rNrotate=NRotation (e.g. r90)
containfit=containFit mode
coverfit=coverFit mode
cropfit=cropFit mode
webpformat=webpOutput format (works for all formats)
fliphflip=hHorizontal flip
flipvflip=vVertical flip
grayscalegrayscale=1Enable grayscale
gif_animgif_anim=allEnable animated GIF (all frames)
gif_afgif_af=1Apply transforms to frame range only

These three requests are equivalent:

/300x200,webp,q80/https://example.com/image.jpg
/w=300,h=200,format=webp,q=80/https://example.com/image.jpg
/w:300,h:200,format:webp,q:80/https://example.com/image.jpg

SchemeExample
HTTP/HTTPShttps://example.com/image.jpg
S3s3:/path/to/image.jpg
Local filesystemlocal:/path/to/image.jpg
Aliasmycdn:/path/to/image.jpg

ParamTypeDescription
wintegerOutput width in pixels (max 8192)
hintegerOutput height in pixels (max 8192)
fitstringResize mode: contain, cover, or crop (default: contain)
formatstringOutput format: webp, jpeg, png, avif, gif, bmp, tiff, ico, jxl
qintegerQuality 1-100 for JPEG and WebP (default: encoder default)
rotateintegerClockwise rotation: 90, 180, or 270
flipstringFlip axis: h (horizontal) or v (vertical)
blurfloatGaussian blur radius 0-100
grayscaleboolConvert to grayscale: true or 1
brightintegerBrightness adjustment -255 to 255
contrastintegerContrast adjustment -255 to 255
wmstringWatermark image URL (supports http, https, s3:, local:)
sigstringHMAC-SHA256 signature (required when HMAC_KEY is set)
gif_animstringGIF frame range: all, N, N-M, -N (last N frames)
gif_afboolApply transforms to gif_anim range only, return all frames
seekstringVideo thumbnail seek: N (seconds), Nr (ratio 0-1), auto (middle)

/w=800,h=600/https://example.com/photo.jpg

Convert to WebP with quality (path-style shorthand)

Section titled “Convert to WebP with quality (path-style shorthand)”
/webp,q85/https://example.com/photo.jpg

Resize, convert format, and set quality (mixed shorthand)

Section titled “Resize, convert format, and set quality (mixed shorthand)”
/400x300,webp,q80/https://example.com/photo.jpg
/w=400,h=400,fit=cover/https://example.com/photo.jpg
/rotate=90,flip=h/https://example.com/photo.jpg
/blur=3,grayscale=1/https://example.com/photo.jpg

Brightness and contrast adjustment (path-style)

Section titled “Brightness and contrast adjustment (path-style)”
/bright=30,contrast=20/https://example.com/photo.jpg
/wm=https://example.com/watermark.png/https://example.com/photo.jpg
/proxy?url=https://example.com/photo.jpg&w=400&h=300&format=webp&q=80
/w=400,format=webp/s3:/images/photo.jpg

All transforms combined (path-style shorthand)

Section titled “All transforms combined (path-style shorthand)”
/800x600,cover,webp,q85,blur:1,bright:10/https://example.com/photo.jpg