Home Tutorial Php Phpgd PHP GD image filter

 
 

Share on Google+Share on Google+
PHP GD image filter
Posted on: November 12, 2009 at 12:00 AM
Advertisement
This example shows how to filter an image in php gd.

<?php

$logo1 = imagecreatefromjpeg('images.jpg');

$logo2 = imagecreatefromjpeg('images.jpg');

$output = imagecreatetruecolor(imagesx($logo1) * 2, imagesy($logo1));

imagefilter($logo1, IMG_FILTER_PIXELATE, 3);

imagefilter($logo2, IMG_FILTER_PIXELATE, 3, true);

imagecopy($output, $logo1, 0, 0, 0, 0, imagesx($logo1) - 1, imagesy($logo1) - 1);

imagecopy($output, $logo2, imagesx($logo2), 0, 0, 0, imagesx($logo2) - 1, imagesy($logo2) - 1);

imagedestroy($logo1);

imagedestroy($logo2);

header('Content-Type: image/jpeg');

imagejpeg($output);

imagedestroy($output);

?>

After running the program you will get the following output

Advertisement

Related Tags for PHP GD image filter:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 12, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com