Chuyển tới nội dung chính

Filters

PreviewProxy supports four image filters: blur, grayscale, brightness, and contrast. Filters can be combined with each other and with resize or format conversion in a single request.


Blur

Apply a Gaussian blur to soften the image.

ParamTypeRangeDescription
blurfloat0-100Gaussian blur radius

Higher values produce a stronger blur effect. A value of 0 means no blur.

/blur=5/https://example.com/img.jpg
ValueEffect
1-3Subtle softening
5-10Noticeable blur
20+Heavy blur / frosted glass effect
mẹo

Blur is useful for generating background placeholder images or creating a depth-of-field effect on thumbnails.


Grayscale

Convert the image to grayscale (black and white).

ParamTypeValuesDescription
grayscalebooltrue or 1Convert to grayscale
/grayscale=true/https://example.com/img.jpg

Both grayscale=true and grayscale=1 are equivalent.


Brightness

Adjust the brightness of the image.

ParamTypeRangeDescription
brightinteger-255 to 255Brightness adjustment (0 = no change)
  • Positive values make the image brighter
  • Negative values make the image darker
  • 0 applies no change
/bright=50/https://example.com/img.jpg
/bright=-80/https://example.com/img.jpg
ValueEffect
255Maximum brightness (near white)
50Moderately brighter
0No change
-50Moderately darker
-255Maximum darkness (near black)

Contrast

Adjust the contrast of the image.

ParamTypeRangeDescription
contrastinteger-255 to 255Contrast adjustment (0 = no change)
  • Positive values increase contrast (darks darker, lights lighter)
  • Negative values decrease contrast (flatter, washed-out appearance)
  • 0 applies no change
/contrast=30/https://example.com/img.jpg
/contrast=-40/https://example.com/img.jpg

Combining Filters

All four filters can be combined with each other and with any other transform parameters in a single request.

Grayscale with blur

/grayscale,blur=2/https://example.com/img.jpg

Brightness and contrast together

/bright=20,contrast=40/https://example.com/img.jpg

Resize, convert format, grayscale, and blur in one request

/w=400,webp,grayscale,blur=2/https://example.com/img.jpg

Full combination

/800x600,cover,webp,q85,grayscale,bright=10,contrast=20,blur=1/https://example.com/img.jpg
thông tin

Filters are applied after resize operations. The order of parameters does not affect the processing order.