WideImage 1.0 branch (discontinued)

WideImage Wiki : opApplyFilter

MainPage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Support This Project SourceForge.net Logo
Important notice: the development of WideImage 1.0 branch is discontinued. Please visit http://wideimage.sourceforge.net for the new version of library and documentation.
This web site will remain accessible to serve as documentation for the old versions of the library. For help on migration, please refer to the migration guide.

wiImage::applyFilter()

See: List of operations

Signature

wiImage::applyFilter($filter, $arg1 = null, $arg2 = null, $arg3 = null)

Parameters



Description

This method applies a filter to an image. See imagefilter() for details.

Notes

Some filters don't work on transparent and alpha-channel images.

Meaning and ranges of arguments

(copied from php.net comment by PanuWorld 14-Jan-2007 03:55)

IMG_FILTER_BRIGHTNESS
-255 = min brightness, 0 = no change, +255 = max brightness

IMG_FILTER_CONTRAST
-100 = max contrast, 0 = no change, +100 = min contrast (note the direction!)

IMG_FILTER_COLORIZE
Adds (subtracts) specified RGB values to each pixel. The valid range for each color is -255...+255, not 0...255. The correct order is red, green, blue.
-255 = min, 0 = no change, +255 = max
This has not much to do with IMG_FILTER_GRAYSCALE.

IMG_FILTER_SMOOTH
Applies a 9-cell convolution matrix where center pixel has the weight arg1 and others weight of 1.0. The result is normalized by dividing the sum with arg1 + 8.0 (sum of the matrix).
any float is accepted, large value (in practice: 2048 or more) = no change

Examples

$img = wiImage::load('/path/to/an/image.png');

// another way of grayscaling
$new = $img->applyFilter(IMG_FILTER_GRAYSCALE);



CategoryDocApi

There are no comments on this page. [Add comment]

WideImage - an Object-Oriented PHP Image Library for Image manipulation
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 1.5941 seconds