imagepng

(PHP 3 >= 3.0.13, PHP 4, PHP 5)

imagepng -- Output a PNG image to either the browser or a file

Description

bool imagepng ( resource image [, string filename] )

imagepng() creates the PNG file in filename from the image image. The image argument is the return from the imagecreate() or imagecreatefrom* function.

The filename argument is optional, and if left off or filled with a NULL value, the raw image stream will be output directly.

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

See also imagegif(), imagewbmp(), imagejpeg(), imagetypes().