Image Filters

Apr 7, 2014

Jojo as of 1.3.3 supports php imagefilter both on uploaded images and on request via url.

On Upload

Filters can be applied to any uploaded image by including filters in the options for that upload field (using Edit Fielddata)

Add filters to the option, one per line, in the order they are to be executed, each filter comma separated with any arguments. 

eg

IMG_FILTER_GRAYSCALE
IMG_FILTER_BRIGHTNESS,-100
IMG_FILTER_COLORIZE,0,90,150

This permanently alters the uploaded image.

On Request

Filters to be used are added through Admin > Options > Images: Image Filters 

Each filter has a (url-firendly) name (a-z, lowercase, no spaces): followed by a semicolon-separated list of the filters to be applied when the name is used, in order of execution.

eg

blueduo:IMG_FILTER_BRIGHTNESS,-40;IMG_FILTER_DUOTONE,0,90,150
blue:IMG_FILTER_COLORIZE,0,90,150
grey:IMG_FILTER_GRAYSCALE
dark:IMG_FILTER_BRIGHTNESS,-100

Any image called through Jojo's image handler can then be filtered by adding the filter name after the size

images/s120/users/tom.jpg

images/s120blue/users/tom.jpg

images/s120blueduo/users/tom.jpg

images/s120grey/users/tom.jpg

Currently only resized images (i.e. not default) can be filtered. 

Jpgs are now also auto sharpened after resizing. The amount of sharpening can be controlled through the Image Sharpening Option.

PHP Imagefilter

For a list of available filters and their arguments see

www.php.net/manual/en/function.imagefilter.php

Jojo also includes a custom filter IMG_FILTER_DUOTONE which works similarly to grayscale + colorise, but preserves luminosity.

Your Comments

post a comment