# Dynamic Imaging
Dynamic imaging is a feature that allows your client applications to dynamic transform and apply filter effects on uploaded images.
All generated image urls pointing to your application domain (mostly local
and protected
urls) may be dynamically manipulated on demand.
The below options has be implemented as such to be mostly compatible with cloudimage API (opens new window).
Example
/media/img/apple-2.jpg?h=300&bright=15&contrast=30&func=grey
# Image resizing
The following resize options dynamically transforms images on-the-fly.
Operation | Syntax | Description |
---|---|---|
width | width=X | w=X | Sets the image width to X pixels |
height | height=X | h=X | Sets the image height to X pixels |
sharpen | sharp=1 | Sharpen image with values between 0 and 100 |
circle | circle=D,X,Y | Draw a circle at given x, y, coordinates with given diameter. |
crop | func=crop:W,H,X,Y | Use the provided width and height to crop image |
crop=W,H,X,Y | W and H sets of the rectangular cutout. While X and Y sets the coordinate of the top-left corner if the rectangular cutout. | |
fit | func=fit:W,H,P | Sets the resize to fit mode |
fit=W,H,P | W and H sets of the rectangular fit and position "P" . Valid positions top-left , top , top-right , left , center , right , bottom-left , bottom , bottom-right | |
flip | flip=v | Flip the image vertically ("v" ) or horizontally ("h" ) |
trim | func=trim:B,A,T,F trim=B,A,T,F | Trim away image space in given color with optional parameters B - Base: Define the the point from where the trimming color is pickedA - Away: Border(s) that should be trimmed away. Valid values top , bottom , left , right T - Tolerance: Define a percentage tolerance level between 0 and 100F - Feather: Uses to leave a untouched "border" around an object while trimming. You can expand (positive value) or contract (negative value) the space around the trimed object by a certain amount of pixels |
quality | quality=X | q=X | Set the resize quality with values between 0 and 100 |
# Image filters
The following filters allow dynamically editing images on-the-fly by applying different effects.
Operation | Syntax | Description |
---|---|---|
brightness | bright=X | func=bright:X | Adjust the brightness of the image |
convert | convert=T | Convert the image to different format. Valid values are jpg , png , gif , tif , bmp , ico , psd , webp , data-url |
contrast | contrast=X | func=contrast:X | Adjust the contrast of the image |
greyscale | func=grey | func=gray | Convert the image to black and white |
pixelate | pixelate=X | func=pixelate:X pixellate=X | func=pixellate:X | Pixelate the image into X-pixel-sized blocks |
blur | blur=X | func=blur:X | Apply a gaussian blur filter with a optional amount |
sharpen | sharp=X | func=sharp:X | Sharpen the image |
background | background=ffffff | bg_colour=ffffff | Fills the image with a specified hex colour. Currently only used by the circle operation. |
border | border=P,C | Apply border effects on the images. Currently only used by the circle operation. |
text | text=T,X,Y | Write a text string to the current image at an optional x,y basepoint position |