<?php
declare(strict_types=1);

$image = imagecreatetruecolor(8, 6);
imagefill($image, 0, 0, imagecolorallocate($image, 64, 64, 64));
imagegammacorrect($image, 1.0, 2.2);
$level = imagecolorsforindex($image, imagecolorat($image, 0, 0))["red"];
echo $level > 64 ? "lighter\n" : "not lighter\n";
