imagecreatefromgd2
PHP function
Edit on GitHub ✎
(PHP 4 >= 4.0.7, PHP 5, PHP 7, PHP 8)
Create a new image from GD2 file or URL
Description
imagecreatefromgd2(string $filename): GdImage|false
Create a new image from GD2 file or URL.
Fopen-wrapper
Parameters
filenamePath to the GD2 image.
Return Values
Identifier
Changelog
| Version | Description |
|---|---|
| 8.0.0 | On success, this function returns a GDImage instance now; previously, a resource was returned. |
Examples
imagecreatefromgd2() example
php
<?php
// Load the gd2 image
$im = imagecreatefromgd2('./test.gd2');
// Apply an effect on the image, in this
// case negate the image
if(function_exists('imagefilter'))
{
imagefilter($im, IMG_FILTER_NEGATE);
}
// Save the image
imagegd2($im, './test_updated.gd2');
?>