<?php
declare(strict_types=1);

$image = imagecreatetruecolor(8, 6);
$white = imagecolorallocate($image, 255, 255, 255);
imagefill($image, 0, 0, $white);
$black = imagecolorallocate($image, 0, 0, 0);
imagefilledrectangle($image, 1, 1, 4, 4, $black);
$red = imagecolorallocate($image, 220, 50, 45);
imagesetpixel($image, 6, 1, $red);
imagexbm($image, "picture.xbm", 0);
$loaded = imagecreatefromxbm("picture.xbm");
echo imagesx($loaded), "x", imagesy($loaded), "\n";
