Effects & Adjustments
This page documents all operations for applying visual effects, transformations, and spacing to images.
Blur
bl:%sigmaApplies a Gaussian blur to the image. Higher sigma values produce a stronger blur effect.
| Parameter | Type | Default | Allowed Values |
|---|---|---|---|
| sigma | float | disabled | Any positive float |
Examples:
# Light blur
bl:3
# Strong blur (good for background overlays)
bl:15
# Subtle blur
bl:1.5Rewrite rule example -- blurred hero backgrounds:
Regex: ^/hero-bg/(.*) Target: /_sx/img/_/rs:fill:1920:600/bl:15/q:70/plain/$1
A request to /hero-bg/media/banner.jpg delivers a 1920x600 blurred version of the image, perfect for placing text over.
Sharpen
sh:%sigmaApplies a sharpening filter to the image. Use this to enhance image detail, especially after resizing.
| Parameter | Type | Default | Allowed Values |
|---|---|---|---|
| sigma | float | disabled | Any positive float |
As an approximate guideline:
| Sigma | Use case |
|---|---|
0.5 | Screen display (~4 pixels/mm) |
1.0 | Print at 12 pixels/mm |
1.5 | Print at 300 DPI (16 pixels/mm) |
Examples:
# Light sharpening for web display
sh:0.5
# Moderate sharpening
sh:1.0Pixelate
pix:%sizeApplies a pixelation filter to the image. The size parameter defines the size of each pixel block in the output.
| Parameter | Type | Default | Allowed Values |
|---|---|---|---|
| size | integer | disabled | Any positive integer |
Examples:
# Moderate pixelation
pix:8
# Heavy pixelation (strong anonymization)
pix:20Rewrite rule example -- pixelated preview images:
Regex: ^/preview/(.*) Target: /_sx/img/_/rs:fit:400:400/pix:10/q:60/plain/$1
Rotate
rot:%angleRotates the image clockwise by the specified angle. Only 90-degree increments are supported. The EXIF orientation is applied before rotation unless auto-rotation is disabled.
| Parameter | Type | Default | Allowed Values |
|---|---|---|---|
| angle | integer | 0 | 0, 90, 180, 270 (multiples of 90) |
Examples:
# Rotate 90 degrees clockwise
rot:90
# Rotate 180 degrees (flip upside down)
rot:180
# Rotate 270 degrees clockwise (= 90 degrees counter-clockwise)
rot:270Auto Rotate
ar:%auto_rotateControls automatic rotation based on EXIF Orientation metadata. When enabled, smoxy reads the orientation tag from the image metadata and rotates the image accordingly. The orientation tag is always removed from the output regardless of this setting.
| Parameter | Type | Default | Allowed Values |
|---|---|---|---|
| auto_rotate | boolean | true | 1, t, true to enable; 0, f, false to disable |
Example:
# Disable auto-rotation
ar:falseBackground
bg:%R:%G:%B
bg:%hex_colorSets the background color used when converting images with transparency (e.g., PNG to JPEG), for padding, and for extend operations.
| Parameter | Type | Default | Allowed Values |
|---|---|---|---|
| R | integer | -- | 0-255 |
| G | integer | -- | 0-255 |
| B | integer | -- | 0-255 |
| hex_color | string | -- | Any valid hex color (e.g., ff0000, ffffff) |
With no arguments, background manipulation is disabled.
Examples:
# White background (RGB)
bg:255:255:255
# White background (hex)
bg:ffffff
# Red background
bg:ff0000
# Light gray background
bg:f5f5f5Rewrite rule example -- PNG to JPEG with white background:
Regex: ^/jpg/(.*\.png) Target: /_sx/img/_/bg:ffffff/f:jpg/q:85/plain/$1
Padding
pd:%top:%right:%bottom:%leftAdds padding around the image, filled with the background color. Uses CSS-style shorthand. Padding is applied after all other transformations (except watermarking) and increases the final image dimensions.
| Parameter | Type | Default | Allowed Values |
|---|---|---|---|
| top | integer | 0 | Any non-negative integer (pixels) |
| right | integer | 0 | Any non-negative integer (pixels) |
| bottom | integer | 0 | Any non-negative integer (pixels) |
| left | integer | 0 | Any non-negative integer (pixels) |
Shorthand behavior
| Format | Meaning |
|---|---|
pd:10 | 10px on all sides |
pd:10:20 | 10px top/bottom, 20px left/right |
pd:10:20:30 | 10px top, 20px left/right, 30px bottom |
pd:10:20:30:40 | 10px top, 20px right, 30px bottom, 40px left |
INFO
Note: Padding enlarges the final image beyond the requested dimensions. If you resize to 100x200 and apply pd:10, the result will be 120x220 pixels.
INFO
Note: Padding values are affected by the DPR setting and will be scaled accordingly.
Examples:
# 10px on all sides with white background
bg:ffffff/pd:10
# 20px top/bottom, 40px left/right
pd:20:40
# Asymmetric padding
pd:10:20:30:40Rewrite rule example -- product images with consistent padding:
Regex: ^/product/(\d+)x(\d+)/(.*) Target: /_sx/img/_/rs:fit:$1:$2/bg:ffffff/pd:10/q:85/plain/$3
This ensures all product images have the same dimensions with a white border, which is useful for grid layouts.
