PHP.nl

imagepng

imagepng

Output a PNG image to either the browser or a file

bool **imagepng** GdImage $image  $file int $quality int $filters

Outputs or saves a image from the given . image

filegd.image.path

Opmerking: > null is invalid if the and arguments are not used. quality``filters

quality Compression level: from 0 (no compression) to 9. The default () uses the zlib compression default. For more information see the . -1zlib manual

filters Allows reducing the PNG file size. It is a bitmask field which may be set to any combination of the constants. or may also be used to respectively disable or activate all filters. The default value () disables filtering. PNG_FILTER_*``PNG_NO_FILTER``PNG_ALL_FILTERS``-1

Let op: > The parameter is ignored by system libgd. filters

return.success

Throws a if is invalid. ValueError``quality

<?php
$im = imagecreatefrompng("test.png");

header('Content-Type: image/png');

imagepng($im);
?>

imagegif``imagewbmp``imagejpeg``imagetypes``imagesavealpha