<?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);
imagepng($image, "original.png");
$source = imagecreatefrompng("original.png");
$small = imagescale($source, 4, 3, IMG_NEAREST_NEIGHBOUR);
imagewbmp($small, "legacy.wbmp");
$info = getimagesize("legacy.wbmp");
echo $info[0], "x", $info[1], "\n";
