<?php
bool imagepolygon ( GdImage $image,
array $points,
int $num_points, int $color )
where,
$image = The image identifier
$points = An ARRAY containing the
coordinates of the polygon vertices
$num_points = The number of vertices of the polygon
$color = The color as returned by imagecolorallocate
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$base_img = "jpeg/JPEG 029 01 Mary.jpg";
$dest_img = "jpeg/JPEG 029 01 Mary imagepolygon.jpg";
echo 'Existing Image<br><br>' .
basename($base_img) . '<br><br>'; ?>
<img src="<?php echo $base_img; ?>"
alt="<?php echo $base_img; ?>" width="400"><br><br><br>
<?php
$id_polig = imagecreatefromjpeg($base_img);
$colorln = imagecolorallocate($id_polig, 255, 0, 0);
$unfstar = [191,90, 209,142, 264,143, 220,177,
236,230, 191,199, 146,231,
161,177, 119,143, 172,143];
$unfstarv = (count($unfstar)/2);
imageantialias($id_polig, 1);
$polystar =
imagepolygon($id_polig, $unfstar, $unfstarv, $colorln);
$quality = 90;
imagejpeg($id_polig, $dest_img, $quality);
echo basename($dest_img); ?><br><br><img src="<?php echo
$dest_img; ?>" alt="<?php echo $dest_img; ?>" width="400">