php8.5
Home/ Manual/ image / functions/ imagecreatefromxbm

imagecreatefromxbm

PHP function Edit on GitHub ✎

(PHP 4 >= 4.0.1, PHP 5, PHP 7, PHP 8)

New

Description

imagecreatefromxbm(string $filename): GdImage|false

imagecreatefromxbm() returns an image identifier representing the image obtained from the given filename.

Fopen-wrapper

Parameters

filename

Path to the XBM image.

Return Values

Identifier

Changelog

VersionDescription
8.0.0On success, this function returns a GDImage instance now; previously, a resource was returned.

Examples

Convert an XBM image to a png image using imagecreatefromxbm()

php
<?php
// Load the xbm file
$xbm = imagecreatefromxbm('./example.xbm');

// Convert it to a png file
imagepng($xbm, './example.png');
?>

Source: reference/image/functions/imagecreatefromxbm.xml · from the official PHP manual (php/doc-en)