П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3513 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 6115 раз(а).

Учебник HTML.
Просмотров 3271 раз(а).

Руководство по PHP5.
Просмотров 5492 раз(а).

Хостинг через призму DNS.
Просмотров 4129 раз(а).

Подборка текстов стандартных документов.
Просмотров 55769 раз(а).

Учебник PHP - Самоучитель
Просмотров 3085 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 5646 раз(а).

Внешние атаки...
Просмотров 3835 раз(а).

Учебник PHP.
Просмотров 2822 раз(а).

SSI в примерах.
Просмотров 37459 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. След.

imagefilter

(PHP 5)

imagefilter --  Applies a filter to an image

Description

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.

Замечание: Эта функция доступна только в том случае, если PHP был скомпилирован со встроенной библиотекой GD.

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки.

Пример 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.';
}

imagedestroy($im);
?>

Пример 2. imagefilter() brightness example

<?php
$im
= imagecreatefrompng('sean.png');
if (
$im && imagefilter($im, IMG_FILTER_BRIGHTNESS, 20)) {
    echo
'Image brightness changed.';
    
imagepng($im, 'sean.png');
} else {
    echo
'Image brightness change failed.';
}

imagedestroy($im);
?>

Пример 3. imagefilter() colorize example

<?php
$im
= imagecreatefrompng('philip.png');

/* R, G, B, so 0, 255, 0 is green */
if ($im && imagefilter($im, IMG_FILTER_COLORIZE, 0, 255, 0)) {
    echo
'Image successfully shaded green.';
    
imagepng($im, 'philip.png');
} else {
    echo
'Green shading failed.';
}

imagedestroy($im);
?>


Пред. Начало След.
imagefilltoborder Уровень выше imagefontheight


Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru