<?php
declare(strict_types=1);

$photo = imagecreatetruecolor(20, 12);
imagefill($photo, 0, 0, imagecolorallocate($photo, 255, 255, 255));
$stamp = imagecreatetruecolor(6, 4);
imagefill($stamp, 0, 0, imagecolorallocate($stamp, 0, 0, 255));
imagecopymerge($photo, $stamp, 12, 6, 0, 0, 6, 4, 50);
$pixel = imagecolorsforindex($photo, imagecolorat($photo, 13, 7));
echo $pixel["blue"], "\n";
echo $pixel["red"] > 0 && $pixel["red"] < 255 ? "half blend\n" : "unexpected\n";
