<?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, "picture.png", 6);
$loaded = imagecreatefrompng("picture.png");
$small = imagescale($loaded, 4);
imagepng($small, "thumb.png");
$info = getimagesize("thumb.png");
echo $info[0], "x", $info[1], "\n";
