(PHP 7 >= 7.2.0, PHP 8)
imagebmp — Output a BMP image to browser or file
   Outputs or saves a BMP version of the given image.
  
imageОб'єкт GdImage, що повертається однією з функцій створення зображення, такою як imagecreatetruecolor().
fileШлях або відкритий ресурс потоку (котрий автоматично закривається після повернення з цієї функції) для збереження файла. Якщо не встановлено або дорівнює null, буде виведено двійковий код зображення.
Зауваження:
nullis invalid if thecompressedarguments is not used.
compressedWhether the BMP should be compressed with run-length encoding (RLE), or not.
   Повертає true у разі успіху або false в разі помилки.
  
Проте, якщо libgd не може вивести зображення, ця функція повертає true.
| Версія | Опис | 
|---|---|
| 8.0.0 | Тепер imageмає бути примірником
  GdImage. Раніше очікувавсяgd-resource. | 
| 8.0.0 | The type of compressedis bool now; formerly it was int. | 
Приклад #1 Saving a BMP file
<?php
// Create a blank image and add some text
$im = imagecreatetruecolor(120, 20);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,  'BMP with PHP', $text_color);
// Save the image
imagebmp($im, 'php.bmp');
?>