<?php
declare(strict_types=1);

$source = imagecreatetruecolor(4, 4);
imagefill($source, 0, 0, imagecolorallocate($source, 255, 0, 0));
$white = imagecolorallocate($source, 255, 255, 255);
imagefilledrectangle($source, 0, 0, 1, 1, $white);
$image = imagecreatetruecolor(8, 6);
imagecopyresized($image, $source, 2, 1, 0, 0, 3, 3, 4, 4);
imagepng($image, "composition.png");
echo getimagesize("composition.png")[0], "x", getimagesize("composition.png")[1], "\n";
