PHP/Graphics Image/imagefilter — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 10:05, 26 мая 2010
Содержание
- 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
<source lang="html4strict">
<?php
$image = imagecreatefrompng("space.png"); imagefilter($image, IMG_FILTER_COLORIZE, 100, 0, 100); header("content-type: image/png"); imagepng($image); imagedestroy($image);
?>
</source>
IMG_FILTER_CONTRAST
<source lang="html4strict">
<?php
$image = imagecreatefrompng("space.png"); imagefilter($image, IMG_FILTER_CONTRAST, 20); header("content-type: image/png"); imagepng($image); imagedestroy($image);
?>
</source>
IMG_FILTER_EDGEDETECT and IMG_FILTER_EMBOSS filters
<source lang="html4strict">
<?php
$image = imagecreatefrompng("space.png"); imagefilter($image, IMG_FILTER_EDGEDETECT); imagefilter($image, IMG_FILTER_EMBOSS); header("content-type: image/png"); imagepng($image); imagedestroy($image);
?>
</source>
IMG_FILTER_GAUSSIAN_BLUR and IMG_FILTER_SELECTIVE_BLUR
<source lang="html4strict">
<?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);
?>
</source>
IMG_FILTER_GRAYSCALE and IMG_FILTER_NEGATE
<source lang="html4strict">
<?php
$image = imagecreatefrompng("space.png"); imagefilter($image, IMG_FILTER_GRAYSCALE); imagefilter($image, IMG_FILTER_NEGATE); header("content-type: image/png"); imagepng($image); imagedestroy($image);
?>
</source>
smooths the picture just a little
<source lang="html4strict">
<?php
$image = imagecreatefrompng("space.png"); imagefilter($image, IMG_FILTER_SMOOTH, 6); header("content-type: image/png"); imagepng($image); imagedestroy($image);
?>
</source>
Special Effects Using imagefilter( ): lighten picture just a little:
<source lang="html4strict">
<?php
$image = imagecreatefrompng("space.png"); imagefilter($image, IMG_FILTER_BRIGHTNESS, 50); header("content-type: image/png"); imagepng($image); imagedestroy($image);
?>
</source>