Gratulacje, kretor Mój egrafik został zakończony. Jeżeli rejestrowałeś się w tym kreatorze, pamiętaj aby kliknąć w link potwierdzający, wysłany na Twój adres email. Jeżeli tego nie zrobisz, nie będziesz mógł się zalogować, a dodane przez Ciebie wpisy nie zostaną opublikowane.
bool imagefilter ( resource src_im, int filtertype [, int arg1 [, int arg2 [, int arg3]]] )
imagefilter() applies the filter
filtertype to the image, using
arg1, arg2 and
arg3 where necessary.
filtertype can be one of the following:
IMG_FILTER_NEGATE: Reverses all colors of
the image.
IMG_FILTER_GRAYSCALE: Converts the image into
grayscale.
IMG_FILTER_BRIGHTNESS: Changes the brightness
of the image. Use arg1 to set the level of
brightness.
IMG_FILTER_CONTRAST: Changes the contrast of
the image. Use arg1 to set the level of
contrast.
IMG_FILTER_COLORIZE: Like
IMG_FILTER_GRAYSCALE, except you can specify the
color. Use arg1, arg2 and
arg3 in the form of
red, blue,
green. The range for each color is 0 to 255.
IMG_FILTER_EDGEDETECT: Uses edge detection to
highlight the edges in the image.
IMG_FILTER_EMBOSS: Embosses the image.
IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using
the Gaussian method.
IMG_FILTER_SELECTIVE_BLUR: Blurs the image.
IMG_FILTER_MEAN_REMOVAL: Uses mean removal to
achieve a "sketchy" effect.
IMG_FILTER_SMOOTH: Makes the image smoother.
Use arg1 to set the level of smoothness.
Notatka: Ta funkcja jest dostępna tylko jeśli
PHP zostało skompilowane z dołączoną wersją biblioteki GD.
Zwraca TRUE w przypadku sukcesu, FALSE w
przypadku porażki.
Przykład 1. imagefilter() grayscale example
<?php $im = imagecreatefrompng('dave.png'); if ($im && imagefilter($im, IMG_FILTER_GRAYSCALE)) { echo 'Image converted to grayscale.'; imagepng($im, 'dave.png'); } else { echo 'Conversion to grayscale failed.'; }