Allocate image color : imagecolorallocate « Graphics Image « PHP






Allocate image color

 
<?php
    $image = imagecreatefrompng("button.png");
    $hotpink = imagecolorallocate($image, 255, 110, 221);
    $rotated_image = imagerotate($image, 50, $hotpink);

    header("content-type: image/png");
    imagepng($rotated_image);
    imagedestroy($image);
    imagedestroy($rotated_image);
?>
  
  








Related examples in the same category

1.A simple image using a single color (red)
2.Creating and Using Colors