Home » » imagefilter

imagefilter

Written By 1 on Sunday, September 30, 2012 | 7:19 PM

bool imagefilter ( resource $image , int $filtertype [, int $arg1 [, int $arg2 [, int $arg3 [, int $arg4 ]]]] )

Applies a filter to an image

imagefilter() applies the given filter filtertype on the image.


<?php
$im 
imagecreatefrompng('dave.png');

if(
$im && imagefilter($imIMG_FILTER_GRAYSCALE))
{
    echo 
'Image converted to grayscale.';

    
imagepng($im'dave.png');
}
else
{
    echo 
'Conversion to grayscale failed.';
}

imagedestroy($im);
?>

5.3.0 Pixelation support (IMG_FILTER_PIXELATE) was added. 5.2.5 Alpha support for IMG_FILTER_COLORIZE was added.


PHP Image Filter Name Rename Tutorial Upload jpg gif png On the Fly

0 Comment:

Post a Comment