imagecreatefrombmp
PHP function
Edit on GitHub ✎
(PHP 7 >= 7.2.0, PHP 8)
New
Description
imagecreatefrombmp(string $filename): GdImage|false
imagecreatefrombmp() returns an image identifier representing the image obtained from the given filename.
Fopen-wrapper
Parameters
filenamePath to the BMP 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
Convert an BMP image to a PNG image using imagecreatefrombmp()
php
<?php
// Load the BMP file
$im = imagecreatefrombmp('./example.bmp');
// Convert it to a PNG file with default settings
imagepng($im, './example.png');
?>