IMAGEPNG(3) 1 IMAGEPNG(3)imagepng - Output a PNG image to either the browser or a fileSYNOPSIS
bool imagepng (resource $image, [string $filename], [int $quality], [int $filters])
DESCRIPTION
Outputs or saves a PNG image from the given $image.
PARAMETERS
o $
image -An image resource, returned by one of the image creation functions, such as imagecreatetruecolor(3).
o $filename
-The path to save the file to. If not set or NULL, the raw image stream will be outputted directly.
Note
NULL is invalid if the $quality and $filters arguments are not used.
o $quality
- Compression level: from 0 (no compression) to 9.
o $filters
- Allows reducing the PNG file size. It is a bitmask field which may be set to any combination of the PNG_FILTER_XXX constants.
PNG_NO_FILTER or PNG_ALL_FILTERS may also be used to respectively disable or activate all filters.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
CHANGELOG
+--------+--------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+--------------------------------+
| 5.1.3 | |
| | |
| | Added the $filters parameter. |
| | |
| 5.1.2 | |
| | |
| | Added the $quality parameter. |
| | |
+--------+--------------------------------+
EXAMPLES
<?php
$im = imagecreatefrompng("test.png");
header('Content-Type: image/png');
imagepng($im);
imagedestroy($im);
?>
SEE ALSO imagegif(3), imagewbmp(3), imagejpeg(3), imagetypes(3), imagesavealpha(3).
PHP Documentation Group IMAGEPNG(3)
Check Out this Related Man Page
IMAGECREATE(3) 1 IMAGECREATE(3)imagecreate - Create a new palette based imageSYNOPSIS
resource imagecreate (int $width, int $height)
DESCRIPTION imagecreate(3) returns an image identifier representing a blank image of specified size.
In general, we recommend the use of imagecreatetruecolor(3) instead of imagecreate(3) so that image processing occurs on the highest qual-
ity image possible. If you want to output a palette image, then imagetruecolortopalette(3) should be called immediately before saving the
image with imagepng(3) or imagegif(3).
PARAMETERS
o $width
- The image width.
o $height
- The image height.
RETURN VALUES
Returns an image resource identifier on success, FALSE on errors.
EXAMPLES
Example #1
Creating a new GD image stream and outputting an image.
<?php
header("Content-Type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
The above example will output something similar to:[NOT DISPLAYABLE MEDIA]Output of example : Creating a new GD image stream and
outputting an image.
SEE ALSO imagedestroy(3), imagecreatetruecolor(3).
PHP Documentation Group IMAGECREATE(3)
Hi
I am a newbie to Unix . I am just trying to understand the difference between various filters for ps. Can someoen pelase explain me whta is the difference between using /usr/bin/ps -ef | grep <PID> or <Process name> and /usr/bin/ps -auxwww| grep <PID> or <Process Name>. (1 Reply)
I'm trying to convert a file with the following command:
convert -verbose image.eps -resize 500x image.jpg
The problem is that the output image loses it's quality and gets all blurred when resized. It shouldn't happen since I'm working with a vector.
I'm pretty sure that I'm missing a... (0 Replies)
Hi Everyone,
I am a Ph.D student working on some image processing tasks and I have run into an interesting problem that I thought someone on here might have an idea about. This paper discusses a method to compare two images based upon the amount they can be compressed. Sorry, since this is my... (3 Replies)