Amit Dhamu

Writes Code

GD Image Filters

$image = imagecreatefrompng("demo.png");

// Black and White
imagefilter($image, IMG_FILTER_GRAYSCALE);
imagepng($image, "demo-blackandwhite.png");
imagedestroy($image);

// Negative
imagefilter($image, IMG_FILTER_NEGATE);
imagepng($image, "demo-negative.png");
imagedestroy($image);

// Sepia
imagefilter($image, IMG_FILTER_GRAYSCALE);
imagefilter($image, IMG_FILTER_COLORIZE,100,50,0);
imagepng($image, "demo-sepia.png");
imagedestroy($image);


gd library / images / filters / php

← iOS and Android Detection TextArea Remaining Characters →