/** * Blur effect * * @param resource $image Image GD resource * @param int $type BLUR_SEL|BLUR_GAUS * @param int $passes Number of times to apply the filter */ public static function blur($image, $passes = 1, $type = self::BLUR_SEL) { $passes = Helper::blur($passes); $filterType = IMG_FILTER_SELECTIVE_BLUR; if (self::BLUR_GAUS === $type) { $filterType = IMG_FILTER_GAUSSIAN_BLUR; } for ($i = 0; $i < $passes; $i++) { imagefilter($image, $filterType); } }