<?php
declare(strict_types=1);

$image = imagecreatetruecolor(8, 6);
$red = imagecolorallocate($image, 255, 0, 0);
imagefilledrectangle($image, 0, 0, 7, 5, $red);
imagepng($image, "badge.png");
echo getimagesize("badge.png")["mime"], "\n";
