GD Graphics Library
   HOME

TheInfoList



OR:

The GD Graphics Library is a graphics
software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consist ...
library by Thomas Boutell and others for dynamically manipulating
image An image is a visual representation of something. It can be two-dimensional, three-dimensional, or somehow otherwise feed into the visual system to convey information. An image can be an artifact, such as a photograph or other two-dimensio ...
s. Its native
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
is ANSI C, but it has interfaces for many other programming languages. It can create GIFs,
JPEG JPEG ( ) is a commonly used method of lossy compression for digital images, particularly for those images produced by digital photography. The degree of compression can be adjusted, allowing a selectable tradeoff between storage size and imag ...
s, PNGs, and WBMPs. Support for drawing GIFs was dropped in 1999 when
Unisys Unisys Corporation is an American multinational information technology (IT) services and consulting company headquartered in Blue Bell, Pennsylvania. It provides digital workplace solutions, cloud, applications, and infrastructure solutions, ...
revoked the royalty-free
license A license (or licence) is an official permission or permit to do, use, or own something (as well as the document of that permission or permit). A license is granted by a party (licensor) to another party (licensee) as an element of an agreeme ...
granted to non-commercial software projects for the LZW compression method used by GIFs. When the Unisys
patent A patent is a type of intellectual property that gives its owner the legal right to exclude others from making, using, or selling an invention for a limited period of time in exchange for publishing an enabling disclosure of the invention."A ...
expired worldwide on July 7, 2004, GIF support was subsequently re-enabled. GD originally stood for "GIF Draw". However, since the revoking of the Unisys license, it has informally stood for "Graphics Draw". GD can create images composed of lines, arcs, text (using program-selected fonts), other images, and multiple colors. Version 2.0 adds support for truecolor images, alpha channels, resampling (for smooth resizing of truecolor images), and many other features. GD supports numerous programming languages including C, PHP,
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
, Python,
OCaml OCaml ( , formerly Objective Caml) is a general-purpose, multi-paradigm programming language Programming paradigms are a way to classify programming languages based on their features. Languages can be classified into multiple paradigms. ...
, Tcl, Lua,
Pascal Pascal, Pascal's or PASCAL may refer to: People and fictional characters * Pascal (given name), including a list of people with the name * Pascal (surname), including a list of people and fictional characters with the name ** Blaise Pascal, Frenc ...
,
GNU Octave GNU Octave is a high-level programming language primarily intended for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a lan ...
,
REXX Rexx (Restructured Extended Executor) is a programming language that can be interpreted or compiled. It was developed at IBM by Mike Cowlishaw. It is a structured, high-level programming language designed for ease of learning and reading. P ...
,
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
and Go. In addition, the "Fly" command line interpreter allows for image creation ("on the fly") using GD. GD scripts can thus be written in potentially any language and run using this tool. GD is extensively used with PHP, where a modified version supporting additional features is included by default as of PHP 4.3 and was an option before that. As of PHP 5.3, a system version of GD may be used as well, to get the additional features that were previously available only to the bundled version of GD.


Example

The following is an example which outputs a 3D looking pie chart (from the PHP GD documentation on th
imagefilledarc()
function). 50; $i--) imagefilledarc($image, 50, 50, 100, 50, 0, 45, $navy, IMG_ARC_PIE); imagefilledarc($image, 50, 50, 100, 50, 45, 75, $gray, IMG_ARC_PIE); imagefilledarc($image, 50, 50, 100, 50, 75, 360, $red, IMG_ARC_PIE); // Flush the image header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?>


See also

*
GDAL The Geospatial Data Abstraction Library (GDAL) is a computer software library for reading and writing raster and vector geospatial data formats (e.g. shapefile), and is released under the permissive X/MIT style free software license by the ...
- for geospatial images *
GraphicsMagick GraphicsMagick is a fork of ImageMagick, emphasizing stability of both programming API and command-line options. It was branched off ImageMagick's version 5.5.2 in 2002 after irreconcilable differences emerged in the developers' group. In addit ...
* ImageMagick * Netpbm * Python Imaging Library


References


External links


GD Graphics Library


archived
Image Functions (PHP)
support in PHP {{DEFAULTSORT:Gd Graphics Library Free software programmed in C Graphics libraries Software using the BSD license