PHP | imagebmp() Function Last Updated : 28 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The imagebmp() function is an inbuilt function in PHP which is used to return the output or save a BMP version of the given image. Syntax: bool imagebmp( resource $image, mixed $to, bool $compressed ) Parameters: This function accept three parameters as mentioned above and described below: $image: It specifies the image to be converted. $to (Optional): It specifies the path to save file to. $compressed (Optional): It specifies whether BMP should be compressed with run-length encoding or not. Return Value: This function returns TRUE on success. Exceptions: This function throws Exception on error. Below given programs illustrate the imagebmp() function in PHP: Program 1 (Creating a bmp image from scratch): php <?php // Create a blank image $im = imagecreatetruecolor(120, 100); // Add text in image $text_color = imagecolorallocate($im, 200, 240, 21); imagestring($im, 1, 5, 50, 'GeeksforGeeks', $text_color); // Output that image as bmp header("Content-Type: image/bmp"); imagebmp($im); ?> Output: Program 2 (Converting a image into bmp): php <?php // Create a image from URL $im = imagecreatefrompng( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Output that image as bmp header("Content-Type: image/bmp"); imagebmp($im); ?> Output: Reference: https://www.php.net/manual/en/function.imagebmp.php Comment More infoAdvertise with us Next Article PHP | imagebmp() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | imagewbmp() Function The imagewbmp() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser and convert any other image type to WBMP. Syntax: bool imagewbmp( resource $image, int $to, int $foreground ) Parameters: This fu 2 min read PHP | imagexbm() Function The imagexbm() function is an inbuilt function in PHP which is used to display image to browser a file. The main use of this function is to view an image in the browser and convert any other image type to XBM. Syntax: bool imagexbm( resource $image, int $to, int $foreground) Parameters: This functio 2 min read PHP | image2wbmp() function The image2wbmp() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser and convert any other image type to WBMP.Syntax:Â Â bool image2wbmp( resource $image, int $filename, int $foreground) Parameters: 2 min read PHP | imagewebp() Function The imagewebp() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser, convert any other image type to WebP and alter the quality of the image.Syntax:Â bool imagewebp( resource $image, int $to, int $q 2 min read PHP | imagepng() Function The imagepng() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser, convert any other image type to PNG and applying filters to the image. Syntax: bool imagepng( resource $image, int $to, int $qual 2 min read Like