2. Introduction
• It is used to create and manipulate image files in a variety of different
image formats, including GIF, PNG, JPEG, WBMP, and XPM.
• Fonts in GD are identified by numbers.
For Reference: https://www.php.net/manual/en/book.image.php
3. GD supports a varity of formats, below is a list of
formats supported by GD.
4. Functions
• // Create the size of image or blank image
$image = imagecreate(500, 300);
or
$image=imagecreatetruecolor($w,$h);
• // Set the background color of image and Setting the text color of
image
• $color = imagecolorallocate($image, 255, 255, 255);
5. Functions
// Function to create image which contains string.
//bool imagestring( $image, $font, $x, $y, $string, $color )
• imagestring($image, 5, 50, 100, " A computer portal", $text_color);
or
• imagettftext($image,40,0,50,50,$blacktext,$font,$text);
• header("content-type: image/png");
• imagepng($image);
• imagedestroy($image);