PHP | imagecreatefromxbm() function Last Updated : 30 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The imagecreatefromxbm() function is an inbuilt function in PHP which is used to create a new image from XBM file or URL. XBM file extension is an X Bitmap Graphics file used for Graphical UI systems. This loaded image can be further worked upon in the program. This function is usually used when you want to edit your images after loading them from an XBM file. An image can be converted into XBM using imagexbm() function. Syntax: resource imagecreatefromxbm( string $filename ) Parameters:This function accepts a single parameter $filename which holds the name of image. Return Value: This function returns an image resource identifier on success, FALSE on errors. Below given programs illustrate the imagecreatefromxbm() function in PHP: Program 1: php <?php // Load an XBM image from local folder // You can convert any image to XBM using // imagexbm() function or online convertors $im = imagecreatefromxbm('./geeksforgeeks.xbm'); // View the loaded image in browser imagexbm($im); imagedestroy($im); ?> Output: This will load the content into browser in the form of unsupported text as browsers don't support XBM. Program 2: php <?php // Load an XBM image from local folder // You can convert any image to XBM using // imagexbm() function or online convertors $im = imagecreatefromxbm('./geeksforgeeks.xbm'); // Output the image by converting it into PNG header('Content-type: image/png'); imagepng($im); imagedestroy($im); ?> Output: Reference: https://www.php.net/manual/en/function.imagecreatefromxbm.php Create Quiz Comment G gurrrung Follow 0 Improve G gurrrung Follow 0 Improve Article Tags : Web Technologies PHP PHP-function Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like