Graphics Draw (GD)

PHP also allows you to create and manipulate image files in a variety of different image formats, such as GIF, PNG, JPEG, WBMP, and XPM using the concept of GD Library.

What is GD Library?

Like Apache, PHP and MySQL, GD is also known as Open Source code Library.
It is not a program but it is just a collection of library functions that allows you to create and manipulate dynamic images.
It was developed in C Language and can be used with PHP.
It stands for Graphics Draw.

Use of GD Library

Using GD you can:
o Create images.
o Manipulate images.
o Export images in jpeg, gif or png file formats.
o You can draw line, rectangle, ellipse, arc, polygon etc…
o Using various functions of GD you can create various types of charts in your PHP application.
o You can also create images from already existing jpeg images and manipulate them as per your requirement.


How to enable GD?

For compiling PHP pages with GD, you first have to enable the GD support in PHP installation. In order to check weather GD supports enabled for your PHP or not follows the steps given below:
(1) In the internet explorer type following URL: http://localhost/
(2) Now click on phpinfo () hyperlink. It will display following information:
Enable GD
(3) If GD is not enabled in your PHP then follows the steps 4 onward.
(4) Locate the php.ini file in your system.
(5) Now search ; extension = php_gd2.dll
(6) Upon finding the above search text remove semicolon from the starting of the line.
(7) Save the php.ini file
(8) Restart your server.
(9) Now GD is enabled in your server.

Download Projects

Download Programs