<?php
declare(strict_types=1);

$image = imagecreatetruecolor(8, 6);
$background = imagecolorallocate($image, 238, 238, 238);
imagefill($image, 0, 0, $background);
$red = imagecolorallocate($image, 220, 60, 50);
$blue = imagecolorallocate($image, 20, 110, 190);
imagefilledrectangle($image, 1, 1, 4, 3, $red);
imagefilledrectangle($image, 4, 3, 6, 4, $blue);
imagesetpixel($image, 1, 2, $blue);
$result = imageaffine($image, [1.0, 0.0, 0.0, 1.0, 0.0, 0.0]);
echo imagesx($result), "x", imagesy($result), "\n";
