imageistruecolor
Supported Versions: PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8
Finds whether an image is a truecolor image
imageistruecolor
(
GdImage $image
):
bool
Intervention/image
$color
=
imagecolorat
(
$image
->
getCore
(),
$x
,
$y
);
if ( !
imageistruecolor
(
$image
->
getCore
())) {
$color
=
imagecolorsforindex
(
$image
->
getCore
(),
$color
);
$color
[
'alpha'
] =
round
(
1
-
$color
[
'alpha'
] /
127
,
2
);
}
src/Intervention/Image/Gd/Commands/PickColorCommand.php
symfony/var-dumper
public static function
castGd
(
$gd
, array
$a
,
Stub $stub
,
bool $isNested
)
{
$a
[
'size'
] =
imagesx
(
$gd
).
'x'
.
imagesy
(
$gd
);
$a
[
'trueColor'
] =
imageistruecolor
(
$gd
);
return
$a
;
}
Caster/ResourceCaster.php