Filters
Filters /filters:NAME(ARGS):NAME(ARGS):.../ is a pipeline of image operations that will be sequentially applied to the image. Examples:
/filters:fill(white):format(jpeg)/
/filters:hue(290):saturation(100):fill(yellow):format(jpeg):quality(80)/
/filters:fill(white):watermark(raw.githubusercontent.com/cshum/imagor/master/testdata/gopher-front.png,repeat,bottom,10):format(jpeg)/
Processing Filters
imagor supports the following filters:
background_color(color)sets the background color of a transparent imagecolorthe color name or hexadecimal rgb expression without the "#" character
blur(sigma)applies gaussian blur to the imagebrightness(amount)increases or decreases the image brightnessamount-100 to 100, the amount in % to increase or decrease the image brightness
contrast(amount)increases or decreases the image contrastamount-100 to 100, the amount in % to increase or decrease the image contrast
crop(left,top,width,height)crops the image after resizing- Absolute pixels:
crop(10,20,200,150)- crop 200x150 box starting at (10,20) - Relative (0.0-1.0):
crop(0.1,0.1,0.8,0.8)- crop using percentages
- Absolute pixels:
draw_detections()draws color-coded bounding boxes on detected regions. Each class name is automatically assigned a distinct colour via hash-based palette. For use with detection plugins such as imagorface. No-op when no Detector is configured.pixelate(block_size)applies a pixelate effect to the whole image by downscaling to 1/block_sizethen upscaling back with nearest-neighbour interpolationblock_sizepixel block size in pixels, defaults to 10
fill(color)fill the missing area or transparent image with the specified color:color- color name or hexadecimal rgb expression without the "#" character- If color is "blur" - missing parts are filled with blurred original image
- If color is "auto" - the top left image pixel will be chosen as the filling color
- If color is "none" - the filling would become fully transparent
focal(AxB:CxD)orfocal(X,Y)adds a focal region or focal point for custom transformations:- Coordinated by a region of left-top point
AxBand right-bottom pointCxD, or a pointX,Y. - Also accepts float values between 0 and 1 that represents percentage of image dimensions.
- Coordinated by a region of left-top point
format(format)specifies the output format of the imageformataccepts jpeg, png, gif, webp, avif, jxl, tiff, jp2
grayscale()changes the image to grayscalehue(angle)increases or decreases the image hueanglethe angle in degree to increase or decrease the hue rotation
image(imagorpath, x, y[, alpha[, blend_mode]])composites a processed image onto the current image with full imagor transformation support, enabling recursive image composition:imagorpath- an imagor path with transformations e.g./200x200/filters:grayscale()/photo.jpg- The nested path supports all imagor operations: resizing, cropping, filters, etc.
- Enables recursive nesting - images can load other processed images
- Use
full(orf) in theWxHdimension segment to inherit the parent image's width or height.fullmeans the full parent dimension;full-NNNmeans the parent dimension minus NNN pixels. Examples:fullxfull/overlay.png(orfxf) — overlay fills the parent canvas exactlyfit-in/full-20xfull-20/overlay.png(orfit-in/f-20xf-20) — overlay fits within the parent canvas with a 20px inset on each sidefullx200/banner.png— overlay inherits parent width, fixed 200px height
x- horizontal position (defaults to 0 if not specified):- Positive number indicates position from the left, negative from the right
- Number followed by
pe.g.20pmeans percentage of image width leftorl,rightorr,centerfor alignment, optionally with pixel offset e.g.left-20,r-10repeatto tile horizontally- Float between 0-1 represents percentage e.g.
0.5for center
y- vertical position (defaults to 0 if not specified):- Positive number indicates position from the top, negative from the bottom
- Number followed by
pe.g.20pmeans percentage of image height toport,bottomorb,centerfor alignment, optionally with pixel offset e.g.top-10,b-20repeatto tile vertically- Float between 0-1 represents percentage e.g.
0.5for center
alpha- transparency level, 0 (fully opaque) to 100 (fully transparent)blend_mode- compositing blend mode, defaults tonormal. Supported modes:normal,multiply,screen,overlay,darken,lighten,color-dodge,color-burn,hard-light,soft-light,difference,exclusion,add,mask,mask-out
max_bytes(amount)automatically degrades the quality of the image until the image is under the specifiedamountof bytesmax_frames(n)limit maximum number of animation framesnto be loadedno_upscale()prevents the image from being upscaled beyond its original dimensionsorient(angle)rotates the image before resizing and cropping, according to the angle valueangleaccepts 0, 90, 180, 270
page(num)specify page number for PDF, or frame number for animated image, starts from 1dpi(num)specify the dpi to render at for PDF and SVGproportion(percentage)scales image to the proportion percentage of the image dimensionquality(amount)changes the overall quality of the image, does nothing for pngamount0 to 100, the quality level in %
rgb(r,g,b)amount of color in each of the rgb channels in %. Can range from -100 to 100rotate(angle)rotates the given image according to the angle valueangleaccepts 0, 90, 180, 270
round_corner(rx [, ry [, color]])adds rounded corners to the image with the specified color as backgroundrx,ryamount of pixel to use as radius. ry = rx if ry is not providedcolorthe color name or hexadecimal rgb expression without the "#" character
saturation(amount)increases or decreases the image saturationamount-100 to 100, the amount in % to increase or decrease the image saturation
redact([mode[, strength]])obscures all detected regions for privacy/anonymisation (e.g. GDPR face blurring, legal document redaction). Requires a detection plugin such as imagorface. No-op when no Detector is configured or no regions are detected. Skips animated images.mode—blur(default),pixelate, or any color name/hex for solid fill (e.g.black,white,ff0000)strength— blur sigma (default 15) or pixelate block size in pixels (default 10). Not used for solid color mode.- Examples:
redact(),redact(blur,20),redact(pixelate),redact(pixelate,15),redact(black),redact(white),redact(ff0000)
redact_oval([mode[, strength]])identical toredactbut applies an elliptical mask to each region, producing a rounded/oval redaction shape. This is the most natural shape for face anonymisation as it closely follows the contour of a face. Same arguments and defaults asredact.- Examples:
redact_oval(),redact_oval(blur,20),redact_oval(pixelate),redact_oval(pixelate,15),redact_oval(black),redact_oval(white),redact_oval(ff0000)
- Examples:
sharpen(sigma)sharpens the imagestrip_exif()removes Exif metadata from the resulting imagestrip_icc()removes ICC profile information from the resulting image. The image is first converted to sRGB color space to preserve correct colors before the profile is removed.text(text, x, y[, font[, color[, alpha[, blend_mode[, width[, align[, justify[, wrap[, spacing[, dpi]]]]]]]]]])renders a text overlay onto the image with full multi-line and Pango font support:textthe text to render. Supports URL query-encoding andb64:prefix for base64url encoding to safely pass arbitrary unicode or multi-word strings.fontPango font description with hyphens as space separators, e.g.sans-bold-24forsans bold 24,monospace-18formonospace 18. Font size is in points; at the default 72 DPI, 1pt = 1px.xhorizontal position:- Positive number indicates position from the left, negative from the right
- Number followed by
pe.g.20pmeans percentage of image width leftorl,rightorr,centerfor alignment, optionally with pixel offset e.g.left-20,r-10- Float between 0-1 represents percentage e.g.
0.5for center
yvertical position:- Positive number indicates position from the top, negative from the bottom
- Number followed by
pe.g.20pmeans percentage of image height toport,bottomorb,centerfor alignment, optionally with pixel offset e.g.top-10,b-20- Float between 0-1 represents percentage e.g.
0.5for center
colorcolor name or hexadecimal rgb expression without the#character, defaults to blackalphatransparency, 0 (fully opaque) to 100 (fully transparent), defaults to 0blend_modecompositing blend mode, defaults tonormal. Supported modes:normal,multiply,screen,overlay,darken,lighten,color-dodge,color-burn,hard-light,soft-light,difference,exclusion,add,mask,mask-outwidthwrap width — text wraps when a line exceeds this width. Supports the same conventions as image dimensions:- Plain integer for pixel count, e.g.
300 - Number followed by
pfor percentage of canvas width, e.g.80p - Float between 0-1 as fraction of canvas width, e.g.
0.75 forfullfor full canvas width;f-N/full-Nfor canvas width minus N pixels0or omitted means unconstrained (Pango wraps only on explicit newlines)
- Plain integer for pixel count, e.g.
alignhorizontal alignment of lines within the text box:low(default, left),centre/center,high/rightjustifyjustify text:trueor1wrapline wrapping mode:word(default),char,wordchar,nonespacingadditional line spacing in pixelsdpirender DPI, defaults to 72 (where 1pt = 1px)
to_colorspace(profile)converts the image to the specified ICC color profileprofilethe target color profile, defaults tosrgbif not specified. Common values:srgb,p3,cmyk
upscale()enables upscaling forfit-inandadaptive-fit-inmodeswatermark(image, x, y, alpha [, w_ratio [, h_ratio]])adds a watermark to the image. It can be positioned inside the image with the alpha channel specified and optionally resized based on the image size by specifying the ratioimagewatermark image URI, using the same image loader configured for imagor. Useb64:prefix to encode image URLs with special characters as base64url.xhorizontal position that the watermark will be in:- Positive number indicate position from the left, negative number from the right.
- Number followed by a
pe.g. 20p means calculating the value from the image width as percentage left,right,centerpositioned left, right or centered respectivelyrepeatthe watermark will be repeated horizontally
yvertical position that the watermark will be in:- Positive number indicate position from the top, negative number from the bottom.
- Number followed by a
pe.g. 20p means calculating the value from the image height as percentage top,bottom,centerpositioned top, bottom or centered respectivelyrepeatthe watermark will be repeated vertically
alphawatermark image transparency, a number between 0 (fully opaque) and 100 (fully transparent).w_ratiopercentage of the width of the image the watermark should fit-inh_ratiopercentage of the height of the image the watermark should fit-in
Utility Filters
These filters do not manipulate images but provide useful utilities to the imagor pipeline:
attachment(filename)returns attachment in theContent-Dispositionheader, and the browser will open a "Save as" dialog withfilename. Whenfilenamenot specified, imagor will get the filename from the image sourceexpire(timestamp)adds expiration time to the content.timestampis the unix milliseconds timestamp, e.g. if content is valid for 30s then timestamp would beDate.now() + 30*1000in JavaScript.preview()skips the result storage even if result storage is enabled, and opts the request into the in-memory cache when configured. Useful for preview contexts where the same source image is served at multiple transformations.raw()response with a raw unprocessed and unchecked source image. Image still loads from loader and storage but skips the result storage