I need to draw color filled rectangles in multiple images at the same time.
$path = "D:\Images\sample.png";
$result_path = "D:\Images\output\sample_output.png";
$image = imagecreatetruecolor(500, 700);
$image = imagecreatefrompng($path);
$color = imagecolorallocatealpha($image, 181, 255, 1, 75);
imagefilledrectangle($image, 15, 15, 30, 30, $color);
header('Content-Type: image/png');
imagepng($image, $result_path);
imagedestroy($image);
This code helped to draw a filled rectangle in a single image.
Is it possible to draw filled rectangles on multiple images at the given co-ordinates of x and y?