imagepng
Intervention/image
Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Output a PNG image to either the browser or a file
imagepng
(
GdImage $image
,
resource
|
string
|
null $file
=
null
,
int $quality
= -
1
,
int $filters
= -
1
):
bool
$resource
=
$this
->
image
->
getCore
();
imagealphablending
(
$resource
,
false
);
imagesavealpha
(
$resource
,
true
);
imagepng
(
$resource
,
null
, -
1
);
$this
->
image
->
mime
=
image_type_to_mime_type
(
IMAGETYPE_PNG
);
$buffer
=
ob_get_contents
();
ob_end_clean
();
src/Intervention/Image/Gd/Encoder.php