This example shows how to do Color Transparency Using Alpha Blending in php gd.
This example shows how to do Color Transparency Using Alpha Blending in php gd.<?php
define(
"WIDTH", 300);define(
"HEIGHT", 300);imagefill(
$img, 1, 1, $black);imageline(
$img, 0,0, WIDTH-1, HEIGHT-1, $blue_t);imagefilledrectangle(
$img, (WIDTH/2)-50, (HEIGHT/2)-50, (WIDTH/2)+50, (HEIGHT/2)+50, $yellow);imagefilledrectangle(
$img, (WIDTH/2)-30, (HEIGHT/2)-30, (WIDTH/2)+30, (HEIGHT/2)+30, $red);imagefilledrectangle(
$img, 10, 10, WIDTH-11, HEIGHT-11, $blue_t);header(
"Content-Type: image/png");imagepng(
$img);?>
After running the program you will get the following output