imagefilter
Intervention/image
Supported Versions: PHP 5, PHP 7, PHP 8
Applies a filter to an image
imagefilter
(
GdImage $image
,
int $filter
, array|
int
|
float
|
bool
...
$args
):
bool
$amount
=
$this
->
argument
(
0
)->
between
(
0
,
100
)->
value
(
1
);
for (
$i
=
0
;
$i
<
intval
(
$amount
);
$i
++) {
imagefilter
(
$image
->
getCore
(),
IMG_FILTER_GAUSSIAN_BLUR
);
}
return
true
;
src/Intervention/Image/Gd/Commands/BlurCommand.php
{
$level
=
$this
->
argument
(
0
)->
between
(-
100
,
100
)->
required
()->
value
();
return
imagefilter
(
$image
->
getCore
(),
IMG_FILTER_BRIGHTNESS
, (
$level
*
2.55
));
}
}
src/Intervention/Image/Gd/Commands/BrightnessCommand.php
$blue
=
round
(
$blue
*
2.55
);
return
imagefilter
(
$image
->
getCore
(),
IMG_FILTER_COLORIZE
,
$red
,
$green
,
$blue
);
}
}
src/Intervention/Image/Gd/Commands/ColorizeCommand.php
{
$level
=
$this
->
argument
(
0
)->
between
(-
100
,
100
)->
required
()->
value
();
return
imagefilter
(
$image
->
getCore
(),
IMG_FILTER_CONTRAST
, (
$level
* -
1
));
}
}
src/Intervention/Image/Gd/Commands/ContrastCommand.php
public function
execute
(
$image
)
{
return
imagefilter
(
$image
->
getCore
(),
IMG_FILTER_GRAYSCALE
);
}
}
src/Intervention/Image/Gd/Commands/GreyscaleCommand.php
public function
execute
(
$image
)
{
return
imagefilter
(
$image
->
getCore
(),
IMG_FILTER_NEGATE
);
}
}
src/Intervention/Image/Gd/Commands/InvertCommand.php
if ( !
$mask_w_alpha
) {
imagefilter
(
$mask
->
getCore
(),
IMG_FILTER_GRAYSCALE
);
}
src/Intervention/Image/Gd/Commands/MaskCommand.php
{
$size
=
$this
->
argument
(
0
)->
type
(
'digit'
)->
value
(
10
);
return
imagefilter
(
$image
->
getCore
(),
IMG_FILTER_PIXELATE
,
$size
,
true
);
}
}
src/Intervention/Image/Gd/Commands/PixelateCommand.php