(PHP 7 >= 7.2.0, PHP 8)
imagebmp — Muestra o guarda una imagen BMP en el navegador o en un fichero
   Muestra o guarda una versión BMP de la image proporcionada.
  
imageUn objeto GdImage, retornado por una de las funciones de creación de imágenes, como imagecreatetruecolor().
fileThe path or an open stream resource (which is automatically closed after this function returns) to save the file to. If not set or null, the raw image stream will be output directly.
Nota:
nullno es válido si el argumentocompressedno se utiliza.
compressed
       Si el BMP debe ser comprimido con run-length encoding (RLE), o no.
      
   Esta función retorna true en caso de éxito o false si ocurre un error.
  
However, if libgd fails to output the image, this function returns true.
| Versión | Descripción | 
|---|---|
| 8.0.0 | imageexpects a GdImage
  instance now; previously, a validgdresource was expected. | 
| 8.0.0 | El tipo de compressedes ahora booleano;
       anteriormente era entero. | 
Ejemplo #1 Guardar un fichero BMP
<?php
// Crear una imagen en blanco y añadir texto
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  'BMP con PHP', $text_color);
// Guardar la imagen
imagebmp($im, 'php.bmp');
?>