PHP/Graphics Image/imagefilter
Содержание
- 1 IMG_FILTER_COLORIZE
- 2 IMG_FILTER_CONTRAST
- 3 IMG_FILTER_EDGEDETECT and IMG_FILTER_EMBOSS filters
- 4 IMG_FILTER_GAUSSIAN_BLUR and IMG_FILTER_SELECTIVE_BLUR
- 5 IMG_FILTER_GRAYSCALE and IMG_FILTER_NEGATE
- 6 smooths the picture just a little
- 7 Special Effects Using imagefilter( ): lighten picture just a little:
IMG_FILTER_COLORIZE
<?php
$image = imagecreatefrompng("space.png");
imagefilter($image, IMG_FILTER_COLORIZE, 100, 0, 100);
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
IMG_FILTER_CONTRAST
<?php
$image = imagecreatefrompng("space.png");
imagefilter($image, IMG_FILTER_CONTRAST, 20);
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
IMG_FILTER_EDGEDETECT and IMG_FILTER_EMBOSS filters
<?php
$image = imagecreatefrompng("space.png");
imagefilter($image, IMG_FILTER_EDGEDETECT);
imagefilter($image, IMG_FILTER_EMBOSS);
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
IMG_FILTER_GAUSSIAN_BLUR and IMG_FILTER_SELECTIVE_BLUR
<?php
$image = imagecreatefrompng("space.png");
imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR);
imagefilter($image, IMG_FILTER_SELECTIVE_BLUR);
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
IMG_FILTER_GRAYSCALE and IMG_FILTER_NEGATE
<?php
$image = imagecreatefrompng("space.png");
imagefilter($image, IMG_FILTER_GRAYSCALE);
imagefilter($image, IMG_FILTER_NEGATE);
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
smooths the picture just a little
<?php
$image = imagecreatefrompng("space.png");
imagefilter($image, IMG_FILTER_SMOOTH, 6);
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>
Special Effects Using imagefilter( ): lighten picture just a little:
<?php
$image = imagecreatefrompng("space.png");
imagefilter($image, IMG_FILTER_BRIGHTNESS, 50);
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>