{
    "mode": "man",
    "parameter": "GD",
    "section": "3",
    "url": "https://www.chedong.com/phpMan.php/man/GD/3/json",
    "generated": "2026-10-22T13:11:47Z",
    "synopsis": "use GD;\n# create a new image\n$im = GD::Image->new(100,100);\n# allocate some colors\n$white = $im->colorAllocate(255,255,255);\n$black = $im->colorAllocate(0,0,0);\n$red = $im->colorAllocate(255,0,0);\n$blue = $im->colorAllocate(0,0,255);\n# make the background transparent and interlaced\n$im->transparent($white);\n$im->interlaced('true');\n# Put a black frame around the picture\n$im->rectangle(0,0,99,99,$black);\n# Draw a blue oval\n$im->arc(50,50,95,75,0,360,$blue);\n# And fill it with red\n$im->fill(50,50,$red);\n# make sure we are writing to a binary stream\nbinmode STDOUT;\n# Convert the image to PNG and print it on standard output\nprint $im->png;",
    "sections": {
        "NAME": {
            "content": "GD.pm - Interface to Gd Graphics Library\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use GD;\n\n# create a new image\n$im = GD::Image->new(100,100);\n\n# allocate some colors\n$white = $im->colorAllocate(255,255,255);\n$black = $im->colorAllocate(0,0,0);\n$red = $im->colorAllocate(255,0,0);\n$blue = $im->colorAllocate(0,0,255);\n\n# make the background transparent and interlaced\n$im->transparent($white);\n$im->interlaced('true');\n\n# Put a black frame around the picture\n$im->rectangle(0,0,99,99,$black);\n\n# Draw a blue oval\n$im->arc(50,50,95,75,0,360,$blue);\n\n# And fill it with red\n$im->fill(50,50,$red);\n\n# make sure we are writing to a binary stream\nbinmode STDOUT;\n\n# Convert the image to PNG and print it on standard output\nprint $im->png;\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "GD.pm is a Perl interface to Thomas Boutell's gd graphics library (version 2.01 or higher;\nsee below). GD allows you to create color drawings using a large number of graphics\nprimitives, and emit the drawings as PNG files.\n\nGD defines the following four classes:\n\n\"GD::Image\"\nAn image class, which holds the image data and accepts graphic primitive method calls.\n\n\"GD::Font\"\nA font class, which holds static font information and used for text rendering.\n\n\"GD::Polygon\"\nA simple polygon object, used for storing lists of vertices prior to rendering a polygon\ninto an image.\n\n\"GD::Simple\"\nA  \"simple\"  class  that  simplifies  the  GD::Image  API and then adds a set of object-\noriented drawing methods using turtle graphics, simplified  font  handling,  ability  to\nwork  in  polar  coordinates,  HSV  color  spaces,  and  human-readable color names like\n\"lightblue\". Please see GD::Simple for a description of these methods.\n\nA Simple Example:\n\n#!/usr/bin/perl\n\nuse GD;\n\n# create a new image\n$im = GD::Image->new(100,100);\n\n# allocate some colors\n$white = $im->colorAllocate(255,255,255);\n$black = $im->colorAllocate(0,0,0);\n$red = $im->colorAllocate(255,0,0);\n$blue = $im->colorAllocate(0,0,255);\n\n# make the background transparent and interlaced\n$im->transparent($white);\n$im->interlaced('true');\n\n# Put a black frame around the picture\n$im->rectangle(0,0,99,99,$black);\n\n# Draw a blue oval\n$im->arc(50,50,95,75,0,360,$blue);\n\n# And fill it with red\n$im->fill(50,50,$red);\n\n# make sure we are writing to a binary stream\nbinmode STDOUT;\n\n# Convert the image to PNG and print it on standard output\nprint $im->png;\n\nNotes:\n\n1. To create a new, empty image, send a new() message to GD::Image, passing it the width and\nheight of the image you want to create.  An image object will be returned.  Other class\nmethods allow you to initialize an image from a preexisting JPG, PNG, GD, GD2, XBM or other\nsupported image files.\n2. Next you will ordinarily add colors to the image's color table. colors are added using a\ncolorAllocate() method call.  The three parameters in each call are the red, green and blue\n(rgb) triples for the desired color.  The method returns the index of that color in the\nimage's color table.  You should store these indexes for later use.\n3. Now you can do some drawing!  The various graphics primitives are described below.  In\nthis example, we do some text drawing, create an oval, and create and draw a polygon.\n4. Polygons are created with a new() message to GD::Polygon.  You can add points to the\nreturned polygon one at a time using the addPt() method. The polygon can then be passed to an\nimage for rendering.\n5. When you're done drawing, you can convert the image into PNG format by sending it a png()\nmessage (or any other supported image format).  It will return a (potentially large) scalar\nvalue containing the binary data for the image.  Ordinarily you will print it out at this\npoint or write it to a file.  To ensure portability to platforms that differentiate between\ntext and binary files, be sure to call binmode() on the file you are writing the image to.\n",
            "subsections": []
        },
        "Object Constructors: Creating Images": {
            "content": "See GD::Image for the current list of supported Image formats.\n\nThe following class methods allow you to create new GD::Image objects.\n",
            "subsections": [
                {
                    "name": "$image = GD::Image->new([$width,$height],[$truecolor])",
                    "content": "$image = GD::Image->new(*FILEHANDLE)"
                },
                {
                    "name": "$image = GD::Image->new($filename)",
                    "content": ""
                },
                {
                    "name": "$image = GD::Image->new($data)",
                    "content": "The new() method is the main constructor  for  the  GD::Image  class.   Called  with  two\ninteger  arguments,  it  creates a new blank image of the specified width and height. For\nexample:\n\n$myImage = GD::Image->new(100,100) || die;\n\nThis will create an image that is 100 x 100  pixels  wide.   If  you  don't  specify  the\ndimensions, a default of 64 x 64 will be chosen.\n\nThe  optional  third  argument,  $truecolor,  tells new() to create a truecolor GD::Image\nobject.  Truecolor images have 24 bits of color data (eight bits each in the  red,  green\nand blue channels respectively), allowing for precise photograph-quality color usage.  If\nnot  specified, the image will use an 8-bit palette for compatibility with older versions\nof libgd.\n\nAlternatively, you may create a GD::Image object based on an existing image by  providing\nan   open  filehandle,  a  filename,  or  the  image  data  itself.   The  image  formats\nautomatically recognized and accepted are: GIF, PNG, JPEG,  XBM,  XPM,  BMP,  GD2,  TIFF,\nWEBP, HEIF or AVIF. Other formats, including WBMP, and GD version 1, cannot be recognized\nautomatically at this time.\n\nIf something goes wrong (e.g. insufficient memory), this call will return undef.\n"
                },
                {
                    "name": "$image = GD::Image->trueColor([0,1])",
                    "content": "For backwards compatibility with scripts previous versions of GD, new images created from\nscratch  (width,  height) are palette based by default.  To change this default to create\ntrue color images use:\n\nGD::Image->trueColor(1);\n\nbefore creating new images.  To switch back to palette based by default, use:\n\nGD::Image->trueColor(0);\n"
                },
                {
                    "name": "$image = GD::Image->newPalette([$width,$height])",
                    "content": ""
                },
                {
                    "name": "$image = GD::Image->newTrueColor([$width,$height])",
                    "content": "The newPalette() and newTrueColor() methods can be used to explicitly create  an  palette\nbased or true color image regardless of the current setting of trueColor().\n"
                },
                {
                    "name": "$image = GD::Image->newFromPng($file, [$truecolor])",
                    "content": ""
                },
                {
                    "name": "$image = GD::Image->newFromPngData($data, [$truecolor])",
                    "content": "The newFromPng() method will create an image from a PNG file read in through the provided\nfilehandle  or file path.  The filehandle must previously have been opened on a valid PNG\nfile or pipe.  If successful, this call will return an initialized image  which  you  can\nthen  manipulate  as  you please.  If it fails, which usually happens if the thing at the\nother end of the filehandle is not a valid PNG file, the call returns undef.  Notice that\nthe call  doesn't  automatically  close  the  filehandle  for  you.   But  it  does  call\nbinmode(FILEHANDLE) for you, on platforms where this matters.\n\nYou may use any of the following as the argument:\n\n1) a simple filehandle, such as STDIN\n2) a filehandle glob, such as *PNG\n3) a reference to a glob, such as \\*PNG\n4) an IO::Handle object\n5) the pathname of a file\n\nIn  the  latter case, newFromPng() will attempt to open the file for you and read the PNG\ninformation from it.\n\nExample1:\n\nopen (PNG,\"barnswallow.png\") || die;\n$myImage = GD::Image->newFromPng(\\*PNG) || die;\nclose PNG;\n\nExample2:\n$myImage = GD::Image->newFromPng('barnswallow.png');\n\nTo get information about the size and color usage of the information, you  can  call  the\nimage  query  methods  described  below.  Images  created  by  reading PNG images will be\ntruecolor if the image file itself is truecolor. To force the image to be  palette-based,\npass a value of 0 in the optional $truecolor argument.\n\nThe  newFromPngData()  method will create a new GD::Image initialized with the PNG format\ndata contained in $data.\n"
                },
                {
                    "name": "$image = GD::Image->newFromJpeg($file, [$truecolor])",
                    "content": ""
                },
                {
                    "name": "$image = GD::Image->newFromJpegData($data, [$truecolor])",
                    "content": "These methods will create an image from a JPEG file.  They work  just  like  newFromPng()\nand newFromPngData(), and will accept the same filehandle and pathname arguments.\n\nImages created by reading JPEG images will always be truecolor.  To force the image to be\npalette-based, pass a value of 0 in the optional $truecolor argument.\n"
                },
                {
                    "name": "$image = GD::Image->newFromGif($file, [$truecolor])",
                    "content": ""
                },
                {
                    "name": "$image = GD::Image->newFromGifData($data)",
                    "content": "These methods will create an image from a GIF file.  They work just like newFromPng() and\nnewFromPngData(), and will accept the same filehandle and pathname arguments.\n\nImages  created  from  GIFs are always 8-bit palette images. To convert to truecolor, you\nmust create a truecolor image and then perform a copy.\n"
                },
                {
                    "name": "$image = GD::Image->newFromXbm($file, [$truecolor])",
                    "content": "This works in exactly the same way as \"newFromPng\", but reads the contents of an X Bitmap\n(black & white) file:\n\nopen (XBM,\"coredump.xbm\") || die;\n$myImage = GD::Image->newFromXbm(\\*XBM) || die;\nclose XBM;\n\nThere is no newFromXbmData() function, because there is no corresponding function in  the\ngd library.\n"
                },
                {
                    "name": "$image = GD::Image->newFromWBMP($file)",
                    "content": "This  works in exactly the same way as \"newFromPng\", but reads the contents of a Wireless\nApplication Protocol Bitmap (WBMP) file:\n\nopen (WBMP,\"coredump.wbmp\") || die;\n$myImage = GD::Image->newFromWBMP(\\*WBMP) || die;\nclose WBMP;\n\nThere is no newFromWBMPData() function, because there is no corresponding function in the\ngd library.\n"
                },
                {
                    "name": "$image = GD::Image->newFromBmp($file)",
                    "content": "This works in exactly the same way as \"newFromPng\", but reads the contents of  a  Windows\nBitmap (BMP) file:\n\nopen (BMP,\"coredump.bmp\") || die;\n$myImage = GD::Image->newFromBmp(\\*BMP) || die;\nclose BMP;\n\nThere  is no newFromBmpData() function, because there is no corresponding function in the\ngd library.\n"
                },
                {
                    "name": "$image = GD::Image->newFromGd($file)",
                    "content": ""
                },
                {
                    "name": "$image = GD::Image->newFromGdData($data)",
                    "content": "NOTE: GD and GD2 support was dropped witn libgd 2.3.2.\n\nThese methods initialize a GD::Image from a Gd file, filehandle,  or  data.   Gd  is  Tom\nBoutell's disk-based storage format, intended for the rare case when you need to read and\nwrite  the image to disk quickly.  It's not intended for regular use, because, unlike PNG\nor JPEG, no image compression is performed and these files can become BIG.\n\n$myImage = GD::Image->newFromGd(\"godzilla.gd\") || die;\nclose GDF;\n"
                },
                {
                    "name": "$image = GD::Image->newFromGd2($file)",
                    "content": ""
                },
                {
                    "name": "$image = GD::Image->newFromGd2Data($data)",
                    "content": "NOTE: GD and GD2 support was dropped witn libgd 2.3.2.\n\nThis works in exactly the same way as newFromGd() and  newFromGdData,  but  use  the  new\ncompressed GD2 image format.\n"
                },
                {
                    "name": "$image = GD::Image->newFromGd2Part($file,srcX,srcY,width,height)",
                    "content": "This  class method allows you to read in just a portion of a GD2 image file.  In addition\nto a filehandle, it accepts the top-left corner  and  dimensions  (width,height)  of  the\nregion of the image to read.  For example:\n\nopen (GDF,\"godzilla.gd2\") || die;\n$myImage = GD::Image->newFromGd2Part(\\*GDF,10,20,100,100) || die;\nclose GDF;\n\nThis reads a 100x100 square portion of the image starting from position (10,20).\n"
                },
                {
                    "name": "$image = GD::Image->newFromXpm($filename)",
                    "content": "This  creates  a new GD::Image object starting from a filename.  This is unlike the other\nnewFrom() functions because it does not take a filehandle.  This difference comes from an\ninconsistency in the underlying gd library.\n\n$myImage = GD::Image->newFromXpm('earth.xpm') || die;\n\nThis function is only available if libgd was compiled with XPM support.\n\nNOTE: The libgd library is unable to read certain XPM files, returning an all-black image\ninstead.\n"
                },
                {
                    "name": "$bool = GD::supportsFileType($filename, $is_writing)",
                    "content": "This returns a TRUE or FALSE value, if libgd supports reading or when the 2nd argument is\n1, if libgd supports writing the given filetype, depending  on  the  filename  extension.\nOnly with libgd versions >= gd-2.1.1.\n\nAssuming  LibGD  is compiled with support for these image types, the following extensions\nare supported:\n\n.gif\n.gd, .gd2\n.wbmp\n.bmp\n.xbm\n.tga\n.png\n.jpg, .jpeg\n.tiff, .tif\n.webp\n.heic, .heix\n.avif\n.xpm\n\nFilenames are parsed  case-insensitively.   .avifs  is  not  yet  suppurted  upstream  in\nlibavif.\n\nGD::Image Methods\nOnce  a  GD::Image  object  is  created, you can draw with it, copy it, and merge two images.\nWhen you are finished manipulating the object, you can convert it into a standard image  file\nformat to output or save to a file.\n"
                },
                {
                    "name": "Image Data Output Methods",
                    "content": "The following methods convert the internal drawing format into standard output file formats.\n"
                },
                {
                    "name": "$pngdata = $image->png([$compression_level])",
                    "content": "This  returns  the image data in PNG format.  You can then print it, pipe it to a display\nprogram, or write it to a file.  Example:\n\n$pngdata = $myImage->png;\nopen (DISPLAY,\"| display -\") || die;\nbinmode DISPLAY;\nprint DISPLAY $pngdata;\nclose DISPLAY;\n\nNote the use of binmode().  This is crucial for portability to DOSish platforms.\n\nThe optional $compressionlevel argument controls the amount of compression to  apply  to\nthe  output  PNG  image.   Values  range  from 0-9, where 0 means no compression (largest\nfiles, highest quality) and 9 means maximum compression (smallest files, worst  quality).\nA  compression  level  of  -1  uses  the default compression level selected when zlib was\ncompiled on your system, and is the same as calling png() with no argument.   Be  careful\nnot  to  confuse  this argument with the jpeg() quality argument, which ranges from 0-100\nand has the opposite meaning from compression (higher numbers give higher quality).\n"
                },
                {
                    "name": "$gifdata = $image->gifanimbegin([$GlobalCM [, $Loops]])",
                    "content": "For libgd version 2.0.33 and higher, this call begins an animated GIF  by  returning  the\ndata  that  comprises  animated  gif image file header.  After you call this method, call\ngifanimadd() one or more times to add the frames of the image.  Then  call  gifanimend().\nEach frame must be the same width and height.\n\nA typical sequence will look like this:\n\nmy $gifdata = $image->gifanimbegin;\n$gifdata   .= $image->gifanimadd;    # first frame\nfor (1..100) {\n# make a frame of right size\nmy $frame  = GD::Image->new($image->getBounds);\naddframedata($frame);              # add the data for this frame\n$gifdata   .= $frame->gifanimadd;     # add frame\n}\n$gifdata   .= $image->gifanimend;   # finish the animated GIF\nprint $gifdata;                     # write animated gif to STDOUT\n\nIf you do not wish to store the data in memory, you can print it to stdout or a file.\n\nThe  image  that you call gifanimbegin on is used to set the image size, color resolution\nand color map.  If argument $GlobalCM is 1, the image color map becomes the GIF89a global\ncolor map.  If $Loops is given  and  >=  0,  the  NETSCAPE2.0  application  extension  is\ncreated, with looping count.  Looping count 0 means forever.\n"
                },
                {
                    "name": "$gifdata = $image->gifanimadd([$LocalCM [, $LeftOfs [, $TopOfs [, $Delay [, $Disposal [,",
                    "content": ""
                },
                {
                    "name": "$previm]]]]]])",
                    "content": "Returns  the  data  that  comprises one animated gif image frame.  You can then print it,\npipe it to a display program, or write it to a file.  With $LeftOfs and $TopOfs  you  can\nplace  this  frame in different offset than (0,0) inside the image screen.  Delay between\nthe previous frame and this frame is in 1/100s units.  Disposal is usually and by default\n1.  Compression is activated by giving the previous image as a parameter.  This  function\nthen  compares  the  images  and  only  writes  the  changed  pixels  to the new frame in\nanimation.  The Disposal parameter for optimized animations must be set to  1,  also  for\nthe first frame.  $LeftOfs and $TopOfs parameters are ignored for optimized frames.\n"
                },
                {
                    "name": "$gifdata = $image->gifanimend()",
                    "content": "Returns  the  data  for  end segment of animated gif file.  It always returns string ';'.\nThis string must be printed to an animated gif file after all image  frames  to  properly\nterminate  it  according  to  GIF  file  syntax.  Image object is not used at all in this\nmethod.\n"
                },
                {
                    "name": "$jpegdata = $image->jpeg([$quality])",
                    "content": "This returns the image data in JPEG format.  You can then print it, pipe it to a  display\nprogram,  or  write  it  to  a file.  You may pass an optional quality score to jpeg() in\norder to control the JPEG quality.  This should be an integer between 0 and 100.   Higher\nquality  scores  give  larger  files  and better image quality.  If you don't specify the\nquality, jpeg() will choose a good default.\n\n$gifdata = $image->gif().\nThis returns the image data in GIF format.  You can then print it, pipe it to  a  display\nprogram, or write it to a file.\n"
                },
                {
                    "name": "$gddata = $image->gd",
                    "content": "This  returns  the  image data in GD format.  You can then print it, pipe it to a display\nprogram, or write it to a file.  Example:\n\nbinmode MYOUTFILE;\nprint MYOUTFILE $myImage->gd;\n"
                },
                {
                    "name": "$gd2data = $image->gd2",
                    "content": "Same as gd(), except that it returns the data in compressed GD2 format.\n"
                },
                {
                    "name": "$bmpdata = $image->bmp([$compression])",
                    "content": "This returns the image data in BMP format, which is a Windows Bitmap.  If compression  is\nset  to 1, it will use RLE compression on the pixel data; otherwise, setting it to 0 (the\ndefault) will leave the BMP pixel data uncompressed.\n"
                },
                {
                    "name": "$wbmpdata = $image->wbmp([$foreground])",
                    "content": "This returns the image data in WBMP format, which  is  a  black-and-white  image  format.\nProvide  the index of the color to become the foreground color.  All other pixels will be\nconsidered background.\n"
                },
                {
                    "name": "$tiffdata = $image->tiff()",
                    "content": "This returns the image data in TIFF format.\n"
                },
                {
                    "name": "$webpdata = $image->webp([$quality])",
                    "content": "This returns the image data in WEBP format, with  the  optional  quality  argument.   The\ndefault  is  80,  also  chosen  by the value -1.  A quality value of >= 101 is considered\nLossless.\n"
                },
                {
                    "name": "$webpdata = $image->heif([$quality])",
                    "content": "This returns the truecolor image data in HEIF format, with the optional quality and speed\narguments.  If truecolor is not set, this fails.  The default quality is 80, also  chosen\nby the value -1.  A quality value of 200 is considered Lossless.\n"
                },
                {
                    "name": "$webpdata = $image->avif([$quality,$speed])",
                    "content": "This  returns  the  truecolor  image  data  in AVIF format, with the AVif encoder and 444\nchroma, and the optional quality argument.  If truecolor is not  set,  this  fails.   The\ndefault compression quality 1-100 is -1, the default speed 0-10 is 6.\n"
                },
                {
                    "name": "$success = $image->_file($filename)",
                    "content": "Writes an image to a file in the format indicated by the filename, with libgd versions >=\ngd-2.1.1.\n\nFile type is determined by the extension of the file name.  See \"supportsFiletype\" for an\noverview of the parsing.\n\nFor file types that require extra arguments, \"file\" attempts to use sane defaults:\n\nC<gdImageGd2> chunk size = 0, compression is enabled.\nC<gdImageJpeg>        quality = -1 (i.e. the reasonable default)\nC<gdImageWBMP>        foreground is the darkest available color\nC<gdImageWEBP>        quality default\nC<gdImageHEIF>        quality default, codes = HEVC, chroma = 444\nC<gdImageAVIF>        quality default, speed = 6\n\nEverything  else  is  called  with  the two-argument function and so will use the default\nvalues.\n\n\"file\" and the underlying libgd \"gdImageFile\" has some rudimentary error  detection  and\nwill  return FALSE (0) if a detectable error occurred.  However, the image loaders do not\nnormally return their error status so a result of TRUE (1) does not mean the file was\nsaved successfully.\n"
                },
                {
                    "name": "Color Control",
                    "content": "These methods allow you to control and manipulate the GD::Image color table for palette, non-\ntruecolor images.\n"
                },
                {
                    "name": "$index = $image->colorAllocate(red,green,blue)",
                    "content": "This allocates a color with the specified red, green and blue components and returns  its\nindex  in  the  color table, if specified.  The first color allocated in this way becomes\nthe image's background color.  (255,255,255) is white (all pixels on).  (0,0,0) is  black\n(all pixels off).  (255,0,0) is fully saturated red.  (127,127,127) is 50% gray.  You can\nfind plenty of examples in /usr/X11/lib/X11/rgb.txt.\n\nIf no colors are allocated, then this function returns -1.\n\nExample:\n\n$black = $myImage->colorAllocate(0,0,0); #background color\n$white = $myImage->colorAllocate(255,255,255);\n$peachpuff = $myImage->colorAllocate(255,218,185);\n"
                },
                {
                    "name": "$index = $image->colorAllocateAlpha(reg,green,blue,alpha)",
                    "content": "This  allocates  a  color  with  the  specified red, green, and blue components, plus the\nspecified alpha channel.  The alpha value may range from 0 (opaque) to 127 (transparent).\nThe \"alphaBlending\" function changes the way this alpha  channel  affects  the  resulting\nimage.\n"
                },
                {
                    "name": "$image->colorDeallocate(colorIndex)",
                    "content": "This  marks  the  color  at the specified index as being ripe for reallocation.  The next\ntime colorAllocate is used, this entry will  be  replaced.   You  can  call  this  method\nseveral times to deallocate multiple colors.  There's no function result from this call.\n\nExample:\n\n$myImage->colorDeallocate($peachpuff);\n$peachy = $myImage->colorAllocate(255,210,185);\n"
                },
                {
                    "name": "$index = $image->colorClosest(red,green,blue)",
                    "content": "This  returns the index of the color closest in the color table to the red green and blue\ncomponents specified.  If no colors have yet been allocated, then this call returns -1.\n\nExample:\n\n$apricot = $myImage->colorClosest(255,200,180);\n"
                },
                {
                    "name": "$index = $image->colorClosestAlpha(red,green,blue,alpha)",
                    "content": "This returns the index of the color closest in the color table to the red green blue  and\nalpha components specified.  If no colors have yet been allocated, then this call returns\n-1.\n\nExample:\n\n$apricot = $myImage->colorClosestAlpha(255,200,180,0);\n"
                },
                {
                    "name": "$index = $image->colorClosestHWB(red,green,blue)",
                    "content": "This  also  attempts  to return the color closest in the color table to the red green and\nblue components specified. It uses a Hue/White/Black color  representation  to  make  the\nselected color more likely to match human perceptions of similar colors.\n\nIf no colors have yet been allocated, then this call returns -1.\n\nExample:\n\n$mostred = $myImage->colorClosestHWB(255,0,0);\n"
                },
                {
                    "name": "$index = $image->colorExact(red,green,blue)",
                    "content": "This  returns  the index of a color that exactly matches the specified red green and blue\ncomponents.  If such a color is not in the color table, this call returns -1.\n\n$rosey = $myImage->colorExact(255,100,80);\nwarn \"Everything's coming up roses.\\n\" if $rosey >= 0;\n"
                },
                {
                    "name": "$index = $image->colorExactAlpha(red,green,blue,alpha)",
                    "content": "This returns the index of a color that exactly matches the specified red green  blue  and\nalpha components.  If such a color is not in the color table, this call returns -1.\n\n$rosey = $myImage->colorExactAlpha(255,100,80,0);\nwarn \"Everything's coming up roses.\\n\" if $rosey >= 0;\n"
                },
                {
                    "name": "$index = $image->colorResolve(red,green,blue)",
                    "content": "This  returns  the index of a color that exactly matches the specified red green and blue\ncomponents.  If such a color is not in the color table  and  there  is  room,  then  this\nmethod allocates the color in the color table and returns its index.\n\n$rosey = $myImage->colorResolve(255,100,80);\nwarn \"Everything's coming up roses.\\n\" if $rosey >= 0;\n"
                },
                {
                    "name": "$index = $image->colorResolveAlpha(red,green,blue,alpha)",
                    "content": "This  returns  the index of a color that exactly matches the specified red green blue and\nalpha components.  If such a color is not in the color table and there is room, then this\nmethod allocates the color in the color table and returns its index.\n\n$rosey = $myImage->colorResolveAlpha(255,100,80,0);\nwarn \"Everything's coming up roses.\\n\" if $rosey >= 0;\n\n$colorsTotal = $image->colorsTotal object method\nThis returns the total number of colors allocated in the object.\n\n$maxColors = $myImage->colorsTotal;\n\nIn the case of a TrueColor image, this call will return undef.\n\n$index = $image->getPixel(x,y) object method\nThis returns the color table index underneath the specified point.  It  can  be  combined\nwith rgb() to obtain the rgb color underneath the pixel.\n\nExample:\n\n$index = $myImage->getPixel(20,100);\n($r,$g,$b) = $myImage->rgb($index);\n"
                },
                {
                    "name": "($red,$green,$blue) = $image->rgb($index)",
                    "content": "This  returns a list containing the red, green and blue components of the specified color\nindex.\n\nExample:\n\n@RGB = $myImage->rgb($peachy);\n"
                },
                {
                    "name": "($alpha) = $image->alpha($index)",
                    "content": "This returns an item containing the alpha component of the specified color index.\n\nExample:\n\n@RGB = $myImage->rgb($peachy);\n"
                },
                {
                    "name": "$image->transparent($colorIndex)",
                    "content": "This marks the color at the specified index as being transparent.  Portions of the  image\ndrawn  in  this color will be invisible.  This is useful for creating paintbrushes of odd\nshapes, as well as for making PNG backgrounds transparent  for  displaying  on  the  Web.\nOnly  one  color  can be transparent at any time. To disable transparency, specify -1 for\nthe index.\n\nIf you call this method without any parameters, it will return the current index  of  the\ntransparent color, or -1 if none.\n\nExample:\n\nopen(PNG,\"test.png\");\n$im = GD::Image->newFromPng(PNG);\n$white = $im->colorClosest(255,255,255); # find white\n$im->transparent($white);\nbinmode STDOUT;\nprint $im->png;\n"
                },
                {
                    "name": "Special Colors",
                    "content": "GD  implements  a number of special colors that can be used to achieve special effects.  They\nare constants defined in the GD:: namespace, but automatically exported into  your  namespace\nwhen the GD module is loaded.\n"
                },
                {
                    "name": "$image->setBrush($image)",
                    "content": "You  can  draw  lines  and  shapes  using a brush pattern.  Brushes are just palette, not\nTrueColor, images that you can create and manipulate in the usual way. When you draw with\nthem, their contents are used for the color and shape of the lines.\n\nTo make a brushed line, you must create or load the brush first, then assign  it  to  the\nimage  using  setBrush().   You can then draw in that with that brush using the gdBrushed\nspecial color.  It's often useful to set the background of the brush  to  transparent  so\nthat the non-colored parts don't overwrite other parts of your image.\n\nExample:\n\n# Create a brush at an angle\n$diagonalbrush = GD::Image->new(5,5);\n$white = $diagonalbrush->colorAllocate(255,255,255);\n$black = $diagonalbrush->colorAllocate(0,0,0);\n$diagonalbrush->transparent($white);\n$diagonalbrush->line(0,4,4,0,$black); # NE diagonal\n\n# Set the brush\n$myImage->setBrush($diagonalbrush);\n\n# Draw a circle using the brush\n$myImage->arc(50,50,25,25,0,360,gdBrushed);\n"
                },
                {
                    "name": "$image->setThickness($thickness)",
                    "content": "Lines  drawn  with line(), rectangle(), arc(), and so forth are 1 pixel thick by default.\nCall setThickness() to change the line drawing width.\n"
                },
                {
                    "name": "$image->setStyle(@colors)",
                    "content": "Styled lines consist of an arbitrary  series  of  repeated  colors  and  are  useful  for\ngenerating dotted and dashed lines.  To create a styled line, use setStyle() to specify a\nrepeating series of colors.  It accepts an array consisting of one or more color indexes.\nThen  draw using the gdStyled special color.  Another special color, gdTransparent can be\nused to introduce holes in the line, as the example shows.\n\nExample:\n\n# Set a style consisting of 4 pixels of yellow,\n# 4 pixels of blue, and a 2 pixel gap\n$myImage->setStyle($yellow,$yellow,$yellow,$yellow,\n$blue,$blue,$blue,$blue,\ngdTransparent,gdTransparent);\n$myImage->arc(50,50,25,25,0,360,gdStyled);\n\nTo combine the \"gdStyled\" and \"gdBrushed\" behaviors, you can  specify  \"gdStyledBrushed\".\nIn  this  case,  a  pixel  from  the current brush pattern is rendered wherever the color\nspecified in setStyle() is neither gdTransparent nor 0.\n"
                },
                {
                    "name": "gdTiled",
                    "content": "Draw filled shapes and flood fills using a pattern.  The pattern is just  another  image.\nThe  image  will  be  tiled  multiple times in order to fill the required space, creating\nwallpaper effects.  You must call \"setTile\"  in  order  to  define  the  particular  tile\npattern you'll use for drawing when you specify the gdTiled color.  details.\n"
                },
                {
                    "name": "gdStyled",
                    "content": "The  gdStyled  color  is  used  for  creating dashed and dotted lines.  A styled line can\ncontain any series of colors and is created using the setStyled() command.\n"
                },
                {
                    "name": "gdAntiAliased",
                    "content": "The \"gdAntiAliased\" color  is  used  for  drawing  lines  with  antialiasing  turned  on.\nAntialiasing  will  blend  the  jagged  edges  of  lines  with the background, creating a\nsmoother look.  The actual color drawn is set with setAntiAliased().\n"
                },
                {
                    "name": "$image->setAntiAliased($color)",
                    "content": "\"Antialiasing\" is a process by which jagged edges associated with  line  drawing  can  be\nreduced  by  blending  the  foreground  color  with  an  appropriate  percentage  of  the\nbackground, depending on how much of  the  pixel  in  question  is  actually  within  the\nboundaries of the line being drawn. All line-drawing methods, such as line() and polygon,\nwill  draw  antialiased  lines  if the special \"color\" gdAntiAliased is used when calling\nthem.\n\nsetAntiAliased() is used to specify the actual foreground color to be used  when  drawing\nantialiased  lines.  You  may  set  any  color  to be the foreground, however as of libgd\nversion 2.0.12 an alpha channel component is not supported.\n\nAntialiased lines can be drawn on  both  truecolor  and  palette-based  images.  However,\nattempts  to  draw  antialiased lines on highly complex palette-based backgrounds may not\ngive satisfactory results, due to the limited number of colors available in the  palette.\nAntialiased  line-drawing  on  simple  backgrounds  should  work  well with palette-based\nimages; otherwise create or fetch a truecolor image  instead.  When  using  palette-based\nimages, be sure to allocate a broad spectrum of colors in order to have sufficient colors\nfor the antialiasing to use.\n"
                },
                {
                    "name": "$image->setAntiAliasedDontBlend($color,[$flag])",
                    "content": "Normally,  when  drawing  lines with the special gdAntiAliased \"color,\" blending with the\nbackground to reduce jagged edges is the desired behavior. However, when  it  is  desired\nthat  lines  not  be  blended  with  one  particular  color when it is encountered in the\nbackground, the setAntiAliasedDontBlend() method can be  used  to  indicate  the  special\ncolor that the foreground should stand out more clearly against.\n\nOnce turned on, you can turn this feature off by calling setAntiAliasedDontBlend() with a\nsecond argument of 0:\n\n$image->setAntiAliasedDontBlend($color,0);\n"
                },
                {
                    "name": "Drawing Commands",
                    "content": "These  methods  allow  you  to  draw  lines,  rectangles, and ellipses, as well as to perform\nvarious special operations like flood-fill.\n"
                },
                {
                    "name": "$image->setPixel($x,$y,$color)",
                    "content": "This sets the pixel at (x,y) to the specified color index.  No  value  is  returned  from\nthis  method.  The coordinate system starts at the upper left at (0,0) and gets larger as\nyou go down and to the right.  You can use a real color, or one  of  the  special  colors\ngdBrushed, gdStyled and gdStyledBrushed can be specified.\n\nExample:\n\n# This assumes $peach already allocated\n$myImage->setPixel(50,50,$peach);\n"
                },
                {
                    "name": "$image->line($x1,$y1,$x2,$y2,$color)",
                    "content": "This  draws  a  line  from (x1,y1) to (x2,y2) of the specified color.  You can use a real\ncolor, or one of the special colors gdBrushed, gdStyled and gdStyledBrushed.\n\nExample:\n\n# Draw a diagonal line using the currently defined\n# paintbrush pattern.\n$myImage->line(0,0,150,150,gdBrushed);\n"
                },
                {
                    "name": "$image->dashedLine($x1,$y1,$x2,$y2,$color)",
                    "content": "DEPRECATED: The libgd library provides this method solely for backward compatibility with\nlibgd version 1.0, and there have been reports that  it  no  longer  works  as  expected.\nPlease use the setStyle() and gdStyled methods as described below.\n\nThis draws a dashed line from (x1,y1) to (x2,y2) in the specified color.  A more powerful\nway  to  generate  arbitrary  dashed  and  dotted  lines  is to use the setStyle() method\ndescribed below and to draw with the special color gdStyled.\n\nExample:\n\n$myImage->dashedLine(0,0,150,150,$blue);\n"
                },
                {
                    "name": "$image->rectangle($x1,$y1,$x2,$y2,$color)",
                    "content": "This draws a rectangle with the specified color.  (x1,y1) and (x2,y2) are the upper  left\nand  lower  right  corners  respectively.  Both real color indexes and the special colors\ngdBrushed, gdStyled and gdStyledBrushed are accepted.\n\nExample:\n\n$myImage->rectangle(10,10,100,100,$rose);\n\n$image->filledRectangle($x1,$y1,$x2,$y2,$color) =item $image->setTile($otherimage)\nThis draws a rectangle filled with the specified color.  You can use a real color, or the\nspecial fill color gdTiled to fill the polygon with a pattern.\n\nExample:\n\n# read in a fill pattern and set it\n$tile = GD::Image->newFromPng('happyface.png');\n$myImage->setTile($tile);\n\n# draw the rectangle, filling it with the pattern\n$myImage->filledRectangle(10,10,150,200,gdTiled);\n"
                },
                {
                    "name": "$image->openPolygon($polygon,$color)",
                    "content": "This draws a polygon with the specified color.  The polygon must be  created  first  (see\nbelow).  The polygon must have at least three vertices.  If the last vertex doesn't close\nthe  polygon,  the method will close it for you.  Both real color indexes and the special\ncolors gdBrushed, gdStyled and gdStyledBrushed can be specified.\n\nExample:\n\n$poly = GD::Polygon->new;\n$poly->addPt(50,0);\n$poly->addPt(99,99);\n$poly->addPt(0,99);\n$myImage->openPolygon($poly,$blue);\n"
                },
                {
                    "name": "$image->unclosedPolygon($polygon,$color)",
                    "content": "This draws a sequence of connected lines with the specified color, without connecting the\nfirst and last point to a closed polygon.  The polygon must be created first (see below).\nThe polygon must have at least three vertices.  Both real color indexes and  the  special\ncolors gdBrushed, gdStyled and gdStyledBrushed can be specified.\n\nYou need libgd 2.0.33 or higher to use this feature.\n\nExample:\n\n$poly = GD::Polygon->new;\n$poly->addPt(50,0);\n$poly->addPt(99,99);\n$poly->addPt(0,99);\n$myImage->unclosedPolygon($poly,$blue);\n"
                },
                {
                    "name": "$image->filledPolygon($poly,$color)",
                    "content": "This  draws  a polygon filled with the specified color.  You can use a real color, or the\nspecial fill color gdTiled to fill the polygon with a pattern.\n\nExample:\n\n# make a polygon\n$poly = GD::Polygon->new;\n$poly->addPt(50,0);\n$poly->addPt(99,99);\n$poly->addPt(0,99);\n\n# draw the polygon, filling it with a color\n$myImage->filledPolygon($poly,$peachpuff);\n"
                },
                {
                    "name": "$image->ellipse($cx,$cy,$width,$height,$color)",
                    "content": ""
                },
                {
                    "name": "$image->filledEllipse($cx,$cy,$width,$height,$color)",
                    "content": "These methods() draw ellipses. ($cx,$cy) is the center of the arc,  and  ($width,$height)\nspecify  the  ellipse  width and height, respectively.  filledEllipse() is like Ellipse()\nexcept that the former produces filled versions of the ellipse.\n"
                },
                {
                    "name": "$image->arc($cx,$cy,$width,$height,$start,$end,$color)",
                    "content": "This draws arcs and ellipses.  (cx,cy) are the center  of  the  arc,  and  (width,height)\nspecify  the  width  and height, respectively.  The portion of the ellipse covered by the\narc are controlled by start and end, both of which are given in degrees from  0  to  360.\nZero  is  at  the  right end of the ellipse, and angles increase clockwise.  To specify a\ncomplete ellipse, use 0 and 360 as the starting and ending angles.  To draw a circle, use\nthe same value for width and height.\n\nYou can specify a normal color or one of  the  special  colors  gdBrushed,  gdStyled,  or\ngdStyledBrushed.\n\nExample:\n\n# draw a semicircle centered at 100,100\n$myImage->arc(100,100,50,50,0,180,$blue);\n"
                },
                {
                    "name": "$image->filledArc($cx,$cy,$width,$height,$start,$end,$color [,$arc_style])",
                    "content": "This method is like arc() except that it colors in the pie wedge with the selected color.\n$arcstyle is optional.  If present it is a bitwise OR of the following constants:\n\ngdArc           connect start & end points of arc with a rounded edge\ngdChord         connect start & end points of arc with a straight line\ngdPie           synonym for gdChord\ngdNoFill        outline the arc or chord\ngdEdged         connect beginning and ending of the arc to the center\n\ngdArc  and gdChord are mutually exclusive.  gdChord just connects the starting and ending\nangles with a straight line, while gdArc produces a rounded edge. gdPie is a synonym  for\ngdArc.  gdNoFill indicates that the arc or chord should be outlined, not filled. gdEdged,\nused together with gdNoFill, indicates that the beginning and  ending  angles  should  be\nconnected to the center; this is a good way to outline (rather than fill) a \"pie slice.\"\n\nExample:\n\n$image->filledArc(100,100,50,50,0,90,$blue,gdEdged|gdNoFill);\n"
                },
                {
                    "name": "$image->fill($x,$y,$color)",
                    "content": "This  method flood-fills regions with the specified color.  The color will spread through\nthe image, starting at point (x,y), until it is stopped by a pixel of a  different  color\nfrom  the  starting  pixel  (this is similar to the \"paintbucket\" in many popular drawing\ntoys).  You can specify a normal color, or the special color gdTiled, to flood-fill  with\npatterns.\n\nExample:\n\n# Draw a rectangle, and then make its interior blue\n$myImage->rectangle(10,10,100,100,$black);\n$myImage->fill(50,50,$blue);\n"
                },
                {
                    "name": "$image->fillToBorder($x,$y,$bordercolor,$color)",
                    "content": "Like  \"fill\",  this  method  flood-fills  regions  with  the specified color, starting at\nposition (x,y).  However, instead of stopping when it hits a pixel of a  different  color\nthan  the  starting  pixel,  flooding  will only stop when it hits the color specified by\nbordercolor.  You must specify a normal indexed color for the bordercolor.  However,  you\nare free to use the gdTiled color for the fill.\n\nExample:\n\n# This has the same effect as the previous example\n$myImage->rectangle(10,10,100,100,$black);\n$myImage->fillToBorder(50,50,$black,$blue);\n"
                },
                {
                    "name": "Image Copying Commands",
                    "content": "Two  methods  are  provided  for copying a rectangular region from one image to another.  One\nmethod copies a region without resizing it.  The other  allows  you  to  stretch  the  region\nduring the copy operation.\n\nWith  either of these methods it is important to know that the routines will attempt to flesh\nout the destination image's color table to match the colors that are being  copied  from  the\nsource.   If the destination's color table is already full, then the routines will attempt to\nfind the best match, with varying results.\n"
                },
                {
                    "name": "$image->copy($sourceImage,$dstX,$dstY,$srcX,$srcY,$width,$height)",
                    "content": "This is the simplest of the several copy operations, copying the  specified  region  from\nthe  source  image  to  the  destination  image  (the  one  performing  the method call).\n(srcX,srcY) specify the upper left corner  of  a  rectangle  in  the  source  image,  and\n(width,height)  give  the  width  and  height of the region to copy.  (dstX,dstY) control\nwhere in the destination image to stamp the copy.  You can use the same  image  for  both\nthe  source  and the destination, but the source and destination regions must not overlap\nor strange things will happen.\n\nExample:\n\n$myImage = GD::Image->new(100,100);\n... various drawing stuff ...\n$srcImage = GD::Image->new(50,50);\n... more drawing stuff ...\n# copy a 25x25 pixel region from $srcImage to\n# the rectangle starting at (10,10) in $myImage\n$myImage->copy($srcImage,10,10,0,0,25,25);\n"
                },
                {
                    "name": "$image->clone()",
                    "content": "Make a copy of the image and return it  as  a  new  object.   The  new  image  will  look\nidentical.   However,  it  may  differ  in  the  size  of  the  color  palette  and other\nnonessential details.\n\nExample:\n\n$myImage = GD::Image->new(100,100);\n... various drawing stuff ...\n$copy = $myImage->clone;\n"
                },
                {
                    "name": "$image->copyMerge($sourceImage,$dstX,$dstY,",
                    "content": "$srcX,$srcY,$width,$height,$percent)\n\nThis copies the indicated rectangle from the  source  image  to  the  destination  image,\nmerging  the  colors  to  the extent specified by percent (an integer between 0 and 100).\nSpecifying 100% has the same effect as copy() -- replacing the  destination  pixels  with\nthe  source  image.   This  is most useful for highlighting an area by merging in a solid\nrectangle.\n\nExample:\n\n$myImage = GD::Image->new(100,100);\n... various drawing stuff ...\n$redImage = GD::Image->new(50,50);\n... more drawing stuff ...\n# copy a 25x25 pixel region from $srcImage to\n# the rectangle starting at (10,10) in $myImage, merging 50%\n$myImage->copyMerge($srcImage,10,10,0,0,25,25,50);\n"
                },
                {
                    "name": "$image->copyMergeGray($sourceImage,$dstX,$dstY,",
                    "content": "$srcX,$srcY,$width,$height,$percent)\n\nThis is identical to copyMerge() except that it  preserves  the  hue  of  the  source  by\nconverting all the pixels of the destination rectangle to grayscale before merging.\n"
                },
                {
                    "name": "$image->copyResized($sourceImage,$dstX,$dstY,",
                    "content": "$srcX,$srcY,$destW,$destH,$srcW,$srcH)\n\nThis  method is similar to copy() but allows you to choose different sizes for the source\nand destination  rectangles.   The  source  and  destination  rectangle's  are  specified\nindependently  by (srcW,srcH) and (destW,destH) respectively.  copyResized() will stretch\nor shrink the image to accommodate the size requirements.\n\nExample:\n\n$myImage = GD::Image->new(100,100);\n... various drawing stuff ...\n$srcImage = GD::Image->new(50,50);\n... more drawing stuff ...\n# copy a 25x25 pixel region from $srcImage to\n# a larger rectangle starting at (10,10) in $myImage\n$myImage->copyResized($srcImage,10,10,0,0,50,50,25,25);\n"
                },
                {
                    "name": "$image->copyResampled($sourceImage,$dstX,$dstY,",
                    "content": "$srcX,$srcY,$destW,$destH,$srcW,$srcH)\n\nThis method is similar to copyResized() but provides \"smooth\" copying from a large  image\nto  a  smaller one, using a weighted average of the pixels of the source area rather than\nselecting one representative pixel. This method is identical to  copyResized()  when  the\ndestination image is a palette image.\n"
                },
                {
                    "name": "$image->copyRotated($sourceImage,$dstX,$dstY,",
                    "content": "$srcX,$srcY,$width,$height,$angle)\n\nLike  copyResized()  but  the $angle argument specifies an arbitrary amount to rotate the\nimage counter clockwise (in degrees).  In addition, $dstX and $dstY species the center of\nthe destination image, and not the top left corner.\n"
                },
                {
                    "name": "$image->trueColorToPalette([$dither], [$colors])",
                    "content": "This method converts a truecolor image to a palette image. The code for this function was\noriginally drawn from the Independent JPEG Group library code, which  is  excellent.  The\ncode  has  been modified to preserve as much alpha channel information as possible in the\nresulting palette, in addition to preserving colors as well as possible.  This  does  not\nwork  as  well as might be hoped. It is usually best to simply produce a truecolor output\nimage instead, which guarantees the highest output quality.   Both  the  dithering  (0/1,\ndefault=0)  and  maximum  number  of  colors  used  (<=256, default = gdMaxColors) can be\nspecified.\n"
                },
                {
                    "name": "$image = $sourceImage->createPaletteFromTrueColor([$dither], [$colors])",
                    "content": "Creates a new palette image from a truecolor image. Same as  above,  but  returns  a  new\nimage.\n\nDon't  use  these function -- write real truecolor PNGs and JPEGs. The disk space gain of\nconversion to palette is not great (for small images it can be negative) and the  quality\nloss is ugly.\n"
                },
                {
                    "name": "$error = $image->colorMatch($otherimage)",
                    "content": "Bring  the  palette  colors  in $otherimage to be closer to truecolor $image.  A negative\nreturn value is a failure.\n\n-1 image must be True Color\n-2 otherimage must be indexed\n-3 the images are meant to be the same dimensions\n-4 At least 1 color in otherimage must be allocated\n\nThis method is only available with libgd >= 2.1.0\n"
                },
                {
                    "name": "$image = $sourceImage->neuQuant($maxcolor=256,$samplefactor=5)",
                    "content": "Creates a new palette image from a truecolor image.\n\nsamplefactor   The quantization precision between 1 (highest quality) and 10 (fastest).\nmaxcolor  The number of desired palette entries.\n\nThis  is  the  same  as   createPaletteFromTrueColor   with   the   quantization   method\nGDQUANTNEUQUANT.  This  does not support dithering.  This method is only available with\nlibgd >= 2.1.0\n"
                },
                {
                    "name": "Image Transformation Commands",
                    "content": "Gd provides these simple image transformations, non-interpolated.\n"
                },
                {
                    "name": "$image = $sourceImage->copyRotate90()",
                    "content": ""
                },
                {
                    "name": "$image = $sourceImage->copyRotate180()",
                    "content": ""
                },
                {
                    "name": "$image = $sourceImage->copyRotate270()",
                    "content": ""
                },
                {
                    "name": "$image = $sourceImage->copyFlipHorizontal()",
                    "content": ""
                },
                {
                    "name": "$image = $sourceImage->copyFlipVertical()",
                    "content": ""
                },
                {
                    "name": "$image = $sourceImage->copyTranspose()",
                    "content": ""
                },
                {
                    "name": "$image = $sourceImage->copyReverseTranspose()",
                    "content": "These methods can be used to rotate, flip, or transpose an  image.   The  result  of  the\nmethod is a copy of the image.\n"
                },
                {
                    "name": "$image->rotate180()",
                    "content": ""
                },
                {
                    "name": "$image->flipHorizontal()",
                    "content": ""
                },
                {
                    "name": "$image->flipVertical()",
                    "content": "These methods are similar to the copy* versions, but instead modify the image in place.\n"
                },
                {
                    "name": "Image Interpolation Methods",
                    "content": "Since libgd 2.1.0 there are better transformation methods, with these interpolation methods:\n\nGDBELL                - Bell\nGDBESSEL              - Bessel\nGDBILINEARFIXED      - fixed point bilinear\nGDBICUBIC             - Bicubic\nGDBICUBICFIXED       - fixed point bicubic integer\nGDBLACKMAN            - Blackman\nGDBOX                 - Box\nGDBSPLINE             - BSpline\nGDCATMULLROM          - Catmullrom\nGDGAUSSIAN            - Gaussian\nGDGENERALIZEDCUBIC   - Generalized cubic\nGDHERMITE             - Hermite\nGDHAMMING             - Hamming\nGDHANNING             - Hannig\nGDMITCHELL            - Mitchell\nGDNEARESTNEIGHBOUR   - Nearest neighbour interpolation\nGDPOWER               - Power\nGDQUADRATIC           - Quadratic\nGDSINC                - Sinc\nGDTRIANGLE            - Triangle\nGDWEIGHTED4           - 4 pixels weighted bilinear interpolation\nGDLINEAR              - bilinear interpolation\n"
                },
                {
                    "name": "$image->interpolationMethod( [$method] )",
                    "content": "Gets  or sets the interpolation methods for all subsequent interpolations.  See above for\nthe valid values.  Only available since libgd 2.2.0\n"
                },
                {
                    "name": "$image->copyScaleInterpolated( width, height )",
                    "content": "Returns a copy, using interpolation.\n"
                },
                {
                    "name": "$image->copyRotateInterpolated( angle, bgcolor )",
                    "content": "Returns a copy, using interpolation.\n"
                },
                {
                    "name": "Image Filter Commands",
                    "content": "Gd also provides some common image filters, they modify the image in place and return TRUE if\nmodified or FALSE if not.  Most of them need  libgd  >=  2.1.0,  with  older  versions  those\nfunctions are undefined.\n"
                },
                {
                    "name": "$ok = $image->scatter($sub, $plus)",
                    "content": "if $sub and $plus are 0, nothing is changed, TRUE is returned.  if $sub >= $plus, nothing\nis changed, FALSE is returned.  else random pixels are changed.\n"
                },
                {
                    "name": "$ok = $image->scatterColor($sub, $plus, @colors)",
                    "content": "Similar to scatter, but using the given array of colors, i.e. palette indices.\n"
                },
                {
                    "name": "$ok = $image->pixelate($blocksize, $mode)",
                    "content": "if  $blocksize  <= 0, nothing is changed, FALSE is returned.  if $blocksize == 1, nothing\nis changed, TRUE is returned.  else the following modes are observed:\nGDPIXELATEUPPERLEFT\nGDPIXELATEAVERAGE\n"
                },
                {
                    "name": "$ok = $image->negate()",
                    "content": ""
                },
                {
                    "name": "$ok = $image->grayscale()",
                    "content": ""
                },
                {
                    "name": "$ok = $image->brightness($add)",
                    "content": "$add: -255..255\n"
                },
                {
                    "name": "$ok = $image->contrast($contrast)",
                    "content": "$contrast: a double value. The  contrast  adjustment  value.  Negative  values  increase,\npositive  values  decrease  the contrast. The larger the absolute value, the stronger the\neffect.\n"
                },
                {
                    "name": "$ok = $image->color($red,$green,$blue,$alpha)",
                    "content": "Change channel values of an image.\n\n$red   - The value to add to the red channel of all pixels.\n$green - The value to add to the green channel of all pixels.\n$blue  - The value to add to the blue channel of all pixels.\n$alpha - The value to add to the alpha channel of all pixels.\n"
                },
                {
                    "name": "$ok = $image->selectiveBlur()",
                    "content": ""
                },
                {
                    "name": "$ok = $image->edgeDetectQuick()",
                    "content": ""
                },
                {
                    "name": "$ok = $image->gaussianBlur()",
                    "content": ""
                },
                {
                    "name": "$ok = $image->emboss()",
                    "content": ""
                },
                {
                    "name": "$ok = $image->meanRemoval()",
                    "content": ""
                },
                {
                    "name": "$ok = $image->smooth($weight)",
                    "content": ""
                },
                {
                    "name": "$image = $sourceImage->copyGaussianBlurred($radius, $sigma)",
                    "content": "$radius: int, the blur radius (*not* diameter--range is 2*radius + 1)  a  radius,  not  a\ndiameter  so  a radius of 2 (for example) will blur across a region 5 pixels across (2 to\nthe center, 1 for the center itself and another 2 to the other edge).\n\n$sigma: the sigma value or a value <= 0.0 to use the computed  default.   represents  the\n\"fatness\" of the curve (lower == fatter).\n\nThe result is always truecolor.\n"
                },
                {
                    "name": "Character and String Drawing",
                    "content": "GD  allows  you  to  draw  characters and strings, either in normal horizontal orientation or\nrotated 90 degrees.  These routines use a GD::Font object, described in  more  detail  below.\nThere  are  four  built-in  monospaced  fonts, available in the global variables gdGiantFont,\ngdLargeFont, gdMediumBoldFont, gdSmallFont and gdTinyFont.\n\nIn addition, you can use the load() method to load GD-formatted bitmap font files at runtime.\nYou can create these bitmap files from X11 BDF-format files using the bdf2gd.pl script, which\nshould have been installed with GD (see the bdfscripts directory if it wasn't).  The  format\nhappens  to  be  identical  to the old-style MSDOS bitmap \".fnt\" files, so you can use one of\nthose directly if you happen to have one.\n\nFor writing proportional scalable fonts, GD offers the stringFT() method, which allows you to\nload and render any TrueType font on your system.\n"
                },
                {
                    "name": "$image->string($font,$x,$y,$string,$color)",
                    "content": "This method draws a string starting at position (x,y) in the specified  font  and  color.\nYour  choices  of  fonts  are  gdSmallFont, gdMediumBoldFont, gdTinyFont, gdLargeFont and\ngdGiantFont.\n\nExample:\n\n$myImage->string(gdSmallFont,2,10,\"Peachy Keen\",$peach);\n"
                },
                {
                    "name": "$image->stringUp($font,$x,$y,$string,$color)",
                    "content": "Just like the previous call, but draws the text rotated counterclockwise 90 degrees.\n"
                },
                {
                    "name": "$image->char($font,$x,$y,$char,$color)",
                    "content": ""
                },
                {
                    "name": "$image->charUp($font,$x,$y,$char,$color)",
                    "content": "These methods draw single characters at position (x,y) in the specified font  and  color.\nThey're carry-overs from the C interface, where there is a distinction between characters\nand strings.  Perl is insensible to such subtle distinctions.\n\n$font = GD::Font->load($fontfilepath)\nThis  method  dynamically  loads  a  font  file,  returning  a  font  that you can use in\nsubsequent calls to drawing methods.  For example:\n\nmy $courier = GD::Font->load('./courierR12.fnt') or die \"Can't load font\";\n$image->string($courier,2,10,\"Peachy Keen\",$peach);\n\nFont files must be in GD binary format, as described above.\n"
                },
                {
                    "name": "@bounds = $image->stringFT($fgcolor,$fontname,$ptsize,$angle,$x,$y,$string)",
                    "content": ""
                },
                {
                    "name": "@bounds = GD::Image->stringFT($fgcolor,$fontname,$ptsize,$angle,$x,$y,$string)",
                    "content": ""
                },
                {
                    "name": "@bounds = $image->stringFT($fgcolor,$fontname,$ptsize,$angle,$x,$y,$string,\\%options)",
                    "content": "This method uses TrueType to draw a scaled, antialiased string using the TrueType  vector\nfont of your choice.  It requires that libgd to have been compiled with TrueType support,\nand for the appropriate TrueType font to be installed on your system.\n\nThe arguments are as follows:\n\nfgcolor    Color index to draw the string in\nfontname   A path to the TrueType (.ttf) font file or a font pattern.\nptsize     The desired point size (may be fractional)\nangle      The rotation angle, in radians (positive values rotate counter clockwise)\nx,y        X and Y coordinates to start drawing the string\nstring     The string itself\n\nIf  successful,  the  method  returns  an eight-element list giving the boundaries of the\nrendered string:\n\n@bounds[0,1]  Lower left corner (x,y)\n@bounds[2,3]  Lower right corner (x,y)\n@bounds[4,5]  Upper right corner (x,y)\n@bounds[6,7]  Upper left corner (x,y)\n\nIn case of an error (such as the font not  being  available,  or  FT  support  not  being\navailable), the method returns an empty list and sets $@ to the error message.\n\nThe  fontname  argument  is  the name of the font, which can be a full pathname to a .ttf\nfile, or if not the paths in $ENV{GDFONTPATH} will be searched  or  if  empty  the  libgd\ncompiled  DEFAULTFONTPATH.   The  TrueType  extensions .ttf, .pfa, .pfb or .dfont can be\nomitted.\n\nThe string may contain UTF-8 sequences like: \"&#192;\"\n\nYou may also call this method from the GD::Image class name, in which case it doesn't  do\nany actual drawing, but returns the bounding box using an inexpensive operation.  You can\nuse this to perform layout operations prior to drawing.\n\nUsing  a negative color index will disable antialiasing, as described in the libgd manual\npage at <http://www.boutell.com/gd/manual2.0.9.html#gdImageStringFT>.\n\nAn optional 8th argument allows you to pass a hashref of options to stringFT().   Several\nhashkeys are recognized: linespacing, charmap, resolution, and kerning.\n\nThe value of linespacing is supposed to be a multiple of the character height, so setting\nlinespacing  to  2.0  will  result  in  double-spaced lines of text.  However the current\nversion of libgd (2.0.12) does not do this.  Instead the linespacing seems to  be  double\nwhat  is provided in this argument.  So use a spacing of 0.5 to get separation of exactly\none line of text.  In practice, a spacing of 0.6 seems to  give  nice  results.   Another\nthing to watch out for is that successive lines of text should be separated by the \"\\r\\n\"\ncharacters, not just \"\\n\".\n\nThe  value  of  charmap  is  one  of  \"Unicode\", \"ShiftJIS\" and \"Big5\".  The interaction\nbetween Perl, Unicode and libgd is not clear to me, and you should experiment  a  bit  if\nyou want to use this feature.\n\nThe  value of resolution is the vertical and horizontal resolution, in DPI, in the format\n\"hdpi,vdpi\".  If present, the resolution will be passed to the Freetype rendering  engine\nas a hint to improve the appearance of the rendered font.\n\nThe value of kerning is a flag.  Set it to false to turn off the default kerning of text.\n\nExample:\n\n$gd->stringFT($black,'/c/windows/Fonts/pala.ttf',40,0,20,90,\n\"hi there\\r\\nbye now\",\n{linespacing=>0.6,\ncharmap  => 'Unicode',\n});\n\nIf  GD  was  compiled with fontconfig support, and the fontconfig library is available on\nyour system, then you can use a font name  pattern  instead  of  a  path.   Patterns  are\ndescribed  in  fontconfig and will look something like this \"Times:italic\".  For backward\ncompatibility, this feature is disabled by  default.   You  must  enable  it  by  calling\nuseFontConfig(1) prior to the stringFT() call.\n\n$image->useFontConfig(1);\n\nFor  backward  compatibility  with  older  versions  of  the  FreeType library, the alias\nstringTTF() is also recognized.\n"
                },
                {
                    "name": "$hasfontconfig = $image->useFontConfig($flag)",
                    "content": "Call useFontConfig() with a value of 1 in order to enable  support  for  fontconfig  font\npatterns  (see  stringFT).   Regardless  of the value of $flag, this method will return a\ntrue value if the fontconfig library is present, or false otherwise.\n\nThis method can also be called as a class method of GD::Image;\n"
                },
                {
                    "name": "$result =",
                    "content": ""
                },
                {
                    "name": "$image->stringFTCircle($cx,$cy,$radius,$textRadius,$fillPortion,$font,$points,$top,$bottom,$fgcolor)",
                    "content": "This draws text in a circle. Currently (libgd 2.0.33) this function does not work for me,\nbut the interface is provided for completeness.  The call signature is somewhat  complex.\nHere is an excerpt from the libgd manual page:\n\nDraws the text strings specified by top and bottom on the image, curved along the edge of\na  circle  of radius radius, with its center at cx and cy. top is written clockwise along\nthe top; bottom is written counterclockwise along the bottom. textRadius  determines  the\n\"height\"  of  each  character;  if textRadius is 1/2 of radius, characters extend halfway\nfrom the edge to the center. fillPortion varies from 0 to 1.0, with  useful  values  from\nabout  0.4  to  0.9,  and  determines how much of the 180 degrees of arc assigned to each\nsection of text is actually occupied by text; 0.9 looks better than 1.0 which  is  rather\ncrowded.  font  is a freetype font; see gdImageStringFT. points is passed to the freetype\nengine and has an effect on hinting; although the size  of  the  text  is  determined  by\nradius,  textRadius,  and  fillPortion,  you  should  pass  a  point  size  that  \"hints\"\nappropriately -- if you know the text will be large, pass a large point size such as 24.0\nto get the best results. fgcolor can be any color, and may have an  alpha  component,  do\nblending, etc.\n\nReturns a true value on success.\n"
                },
                {
                    "name": "Alpha channels",
                    "content": "The  alpha  channel  methods allow you to control the way drawings are processed according to\nthe alpha channel. When true color is turned on, colors are encoded as four bytes,  in  which\nthe  last  three  bytes  are  the  RGB color values, and the first byte is the alpha channel.\nTherefore  the  hexadecimal  representation  of  a  non  transparent  RGB  color   will   be:\nC=0x00(rr)(bb)(bb)\n\nWhen  alpha  blending  is  turned  on, you can use the first byte of the color to control the\ntransparency, meaning that a rectangle painted with color 0x00(rr)(bb)(bb)  will  be  opaque,\nand another one painted with 0x7f(rr)(gg)(bb) will be transparent. The Alpha value must be >=\n0 and <= 0x7f.\n"
                },
                {
                    "name": "$image->alphaBlending($integer)",
                    "content": "The alphaBlending() method allows for two different modes of drawing on truecolor images.\nIn  blending  mode,  which  is  on  by default (libgd 2.0.2 and above), the alpha channel\ncomponent of the color supplied to all drawing functions, such as \"setPixel\",  determines\nhow  much  of  the  underlying  color should be allowed to shine through. As a result, GD\nautomatically blends the existing color at that point with the drawing color, and  stores\nthe result in the image. The resulting pixel is opaque. In non-blending mode, the drawing\ncolor  is  copied literally with its alpha channel information, replacing the destination\npixel. Blending mode is not available when drawing on palette images.\n\nPass a value of 1 for blending mode, and 0 for non-blending mode.\n"
                },
                {
                    "name": "$image->saveAlpha($saveAlpha)",
                    "content": "By default, GD (libgd 2.0.2 and above) does  not  attempt  to  save  full  alpha  channel\ninformation  (as  opposed  to  single-color transparency) when saving PNG images. (PNG is\ncurrently the only output format supported by gd  which  can  accommodate  alpha  channel\ninformation.)  This  saves  space in the output file. If you wish to create an image with\nalpha channel information for use with tools that support it, call saveAlpha(1)  to  turn\non  saving  of  such  information,  and  call alphaBlending(0) to turn off alpha blending\nwithin the library so that alpha channel information is  actually  stored  in  the  image\nrather than being composited immediately at the time that drawing functions are invoked.\n"
                },
                {
                    "name": "Miscellaneous Image Methods",
                    "content": "These are various utility methods that are useful in some circumstances.\n"
                },
                {
                    "name": "$image->interlaced([$flag])",
                    "content": "This  method  sets  or queries the image's interlaced setting.  Interlace produces a cool\nvenetian blinds effect on certain viewers.  Provide a true parameter to set the interlace\nattribute.  Provide undef to disable it.  Call the method without parameters to find  out\nthe current setting.\n"
                },
                {
                    "name": "($width,$height) = $image->getBounds()",
                    "content": "This  method  will return a two-member list containing the width and height of the image.\nYou query but not change the size of the image once it's created.\n"
                },
                {
                    "name": "$width = $image->width",
                    "content": ""
                },
                {
                    "name": "$height = $image->height",
                    "content": "Return the width and height of the image, respectively.\n"
                },
                {
                    "name": "$is_truecolor = $image->isTrueColor()",
                    "content": "This method will return a Boolean representing whether the image is true color or not.\n"
                },
                {
                    "name": "$flag = $image1->compare($image2)",
                    "content": "Compare two images and return a bitmap describing the differences  found,  if  any.   The\nreturn  value  must  be logically AND'ed with one or more constants in order to determine\nthe differences.  The following constants are available:\n\nGDCMPIMAGE             The two images look different\nGDCMPNUMCOLORS        The two images have different numbers of colors\nGDCMPCOLOR             The two images' palettes differ\nGDCMPSIZEX            The two images differ in the horizontal dimension\nGDCMPSIZEY            The two images differ in the vertical dimension\nGDCMPTRANSPARENT       The two images have different transparency\nGDCMPBACKGROUND        The two images have different background colors\nGDCMPINTERLACE         The two images differ in their interlace\nGDCMPTRUECOLOR         The two images are not both true color\n\nThe most important of these is GDCMPIMAGE, which will tell you whether the  two  images\nwill look different, ignoring differences in the order of colors in the color palette and\nother invisible changes.  The constants are not imported by default, but must be imported\nindividually or by importing the :cmp tag.  Example:\n\nuse GD qw(:DEFAULT :cmp);\n# get $image1 from somewhere\n# get $image2 from somewhere\nif ($image1->compare($image2) & GDCMPIMAGE) {\nwarn \"images differ!\";\n}\n"
                },
                {
                    "name": "$image->clip($x1,$y1,$x2,$y2)",
                    "content": ""
                },
                {
                    "name": "($x1,$y1,$x2,$y2) = $image->clip",
                    "content": "Set  or get the clipping rectangle.  When the clipping rectangle is set, all drawing will\nbe clipped to occur within this rectangle.  The clipping rectangle is initially set to be\nequal to the boundaries of the  whole  image.  Change  it  by  calling  clip()  with  the\ncoordinates  of  the  new  clipping rectangle.  Calling clip() without any arguments will\nreturn the current clipping rectangle.\n"
                },
                {
                    "name": "$flag = $image->boundsSafe($x,$y)",
                    "content": "The boundsSafe() method will return true if the point indicated by ($x,$y) is within  the\nclipping  rectangle,  or false if it is not.  If the clipping rectangle has not been set,\nthen it will return true if the point lies within the image boundaries.\n"
                },
                {
                    "name": "Grouping Methods",
                    "content": "GD does not support grouping of objects, but GD::SVG does. In that  subclass,  the  following\nmethods declare new groups of graphical objects:\n\n$image->startGroup([$id,\\%style])\n$image->endGroup()\n$group = $image->newGroup\nSee GD::SVG for information.\n"
                }
            ]
        },
        "Polygons": {
            "content": "A  few primitive polygon creation and manipulation methods are provided.  They aren't part of\nthe Gd library, but I thought they might be handy to have around (they're  borrowed  from  my\nqd.pl Quickdraw library).  Also see GD::Polyline.\n",
            "subsections": [
                {
                    "name": "$poly = GD::Polygon->new",
                    "content": "Create an empty polygon with no vertices.\n\n$poly = GD::Polygon->new;\n"
                },
                {
                    "name": "$poly->addPt($x,$y)",
                    "content": "Add point (x,y) to the polygon.\n\n$poly->addPt(0,0);\n$poly->addPt(0,50);\n$poly->addPt(25,25);\n$myImage->fillPoly($poly,$blue);\n"
                },
                {
                    "name": "($x,$y) = $poly->getPt($index)",
                    "content": "Retrieve the point at the specified vertex.\n\n($x,$y) = $poly->getPt(2);\n"
                },
                {
                    "name": "$poly->setPt($index,$x,$y)",
                    "content": "Change the value of an already existing vertex.  It is an error to set a vertex that isn't\nalready defined.\n\n$poly->setPt(2,100,100);\n"
                },
                {
                    "name": "($x,$y) = $poly->deletePt($index)",
                    "content": "Delete the specified vertex, returning its value.\n\n($x,$y) = $poly->deletePt(1);\n"
                },
                {
                    "name": "$poly->clear()",
                    "content": "Delete all vertices, restoring the polygon to its initial empty state.\n"
                },
                {
                    "name": "$poly->toPt($dx,$dy)",
                    "content": "Draw  from current vertex to a new vertex, using relative (dx,dy) coordinates.  If this is\nthe first point, act like addPt().\n\n$poly->addPt(0,0);\n$poly->toPt(0,50);\n$poly->toPt(25,-25);\n$myImage->fillPoly($poly,$blue);\n"
                },
                {
                    "name": "$vertex_count = $poly->length",
                    "content": "Return the number of vertices in the polygon.\n\n$points = $poly->length;\n"
                },
                {
                    "name": "@vertices = $poly->vertices",
                    "content": "Return a list of all the vertices in the polygon object.  Each member of  the  list  is  a\nreference to an (x,y) array.\n\n@vertices = $poly->vertices;\nforeach $v (@vertices)\nprint join(\",\",@$v),\"\\n\";\n}\n"
                },
                {
                    "name": "@rect = $poly->bounds",
                    "content": "Return  the  smallest rectangle that completely encloses the polygon.  The return value is\nan array containing the (left,top,right,bottom) of the rectangle.\n\n($left,$top,$right,$bottom) = $poly->bounds;\n"
                },
                {
                    "name": "$poly->offset($dx,$dy)",
                    "content": "Offset all the vertices of the polygon by the specified horizontal (dh) and vertical  (dy)\namounts.  Positive numbers move the polygon down and to the right.\n\n$poly->offset(10,30);\n"
                },
                {
                    "name": "$poly->map($srcL,$srcT,$srcR,$srcB,$destL,$dstT,$dstR,$dstB)",
                    "content": "Map  the  polygon  from  a  source  rectangle  to  an equivalent position in a destination\nrectangle, moving it and resizing it as necessary.  See polys.pl for  an  example  of  how\nthis    works.     Both   the   source   and   destination   rectangles   are   given   in\n(left,top,right,bottom) coordinates.  For convenience,  you  can  use  the  polygon's  own\nbounding box as the source rectangle.\n\n# Make the polygon really tall\n$poly->map($poly->bounds,0,0,50,200);\n"
                },
                {
                    "name": "$poly->scale($sx,$sy, [$tx,$ty])",
                    "content": "Scale  each  vertex  of  the  polygon  by the X and Y factors indicated by sx and sy.  For\nexample scale(2,2) will make the polygon twice as  large.   For  best  results,  move  the\ncenter  of  the  polygon  to  position  (0,0)  before  you scale, then move it back to its\nprevious position.  Accepts an optional offset vector.\n"
                },
                {
                    "name": "$poly->transform($sx,$rx,$ry,$sy, $tx,$ty)",
                    "content": "Run each vertex of the polygon through a 2D affine transformation matrix, where sx and  sy\nare the X and Y scaling factors, rx and ry are the X and Y rotation factors, and tx and ty\nare X and Y offsets.  See the Adobe PostScript Reference, page 154 for a full explanation,\nor experiment.\n\nlibgd:\n\nThe transformation matrix is created using 6 numbers:\nmatrix[0] == xx\nmatrix[1] == yx\nmatrix[2] == xy\nmatrix[3] == xy (probably meaning yy here)\nmatrix[4] == x0\nmatrix[5] == y0\nwhere the transformation of a given point (x,y) is given by:\n\nxnew = xx * x + xy * y + x0;\nynew = yx * x + yy * y + y0;\n"
                },
                {
                    "name": "GD::Polyline",
                    "content": "Please see GD::Polyline for information on creating open polygons and splines.\n"
                }
            ]
        },
        "Font Utilities": {
            "content": "The  libgd  library (used by the Perl GD library) has built-in support for about half a dozen\nfonts, which were converted from public-domain X Windows  fonts.   For  more  fonts,  compile\nlibgd with TrueType support and use the stringFT() call.\n\nIf  you  wish  to add more built-in fonts, the directory bdfscripts contains two contributed\nutilities that may help you convert X-Windows BDF-format fonts into  the  format  that  libgd\nuses  internally.   However  these  scripts  were  written  for  earlier versions of GD which\nincluded its own mini-gd library.  These scripts will have to be adapted for use with  libgd,\nand the libgd library itself will have to be recompiled and linked!  Please do not contact me\nfor help with these scripts: they are unsupported.\n\nEach  of  these  fonts  is  available  both as an imported global (e.g. gdSmallFont) and as a\npackage method (e.g. GD::Font->Small).\n",
            "subsections": [
                {
                    "name": "gdSmallFont",
                    "content": ""
                },
                {
                    "name": "GD::Font->Small",
                    "content": "This is the basic small font, \"borrowed\" from a well known public domain 6x12 font.\n"
                },
                {
                    "name": "gdLargeFont",
                    "content": ""
                },
                {
                    "name": "GD::Font->Large",
                    "content": "This is the basic large font, \"borrowed\" from a well known public domain 8x16 font.\n"
                },
                {
                    "name": "gdMediumBoldFont",
                    "content": ""
                },
                {
                    "name": "GD::Font->MediumBold",
                    "content": "This is a bold font intermediate in size between the small  and  large  fonts,  borrowed\nfrom a public domain 7x13 font;\n"
                },
                {
                    "name": "gdTinyFont",
                    "content": ""
                },
                {
                    "name": "GD::Font->Tiny",
                    "content": "This is a tiny, almost unreadable font, 5x8 pixels wide.\n"
                },
                {
                    "name": "gdGiantFont",
                    "content": ""
                },
                {
                    "name": "GD::Font->Giant",
                    "content": "This is a 9x15 bold font converted by Jan Pazdziora from a sans serif X11 font.\n"
                },
                {
                    "name": "$font->nchars",
                    "content": "This returns the number of characters in the font.\n\nprint \"The large font contains \",gdLargeFont->nchars,\" characters\\n\";\n"
                },
                {
                    "name": "$font->offset",
                    "content": "This returns the ASCII value of the first character in the font\n"
                },
                {
                    "name": "$width = $font->width",
                    "content": ""
                },
                {
                    "name": "$height = $font->height",
                    "content": "\"height\"\nThese return the width and height of the font.\n\n($w,$h) = (gdLargeFont->width,gdLargeFont->height);\n"
                }
            ]
        },
        "Helper Functions": {
            "content": "GD::LIBGDVERSION\nReturns a number of the libgd VERSION, like 2.0204, 2.0033 or 2.01.\n\nGD::VERSIONSTRING\nReturns the string of the libgd VERSION, like \"2.2.4\".\n\nGD::constant\n",
            "subsections": []
        },
        "Obtaining the C-language version of gd": {
            "content": "libgd, the C-language version of gd, can be obtained at URL http://libgd.org/  Directions for\ninstalling  and  using  it can be found at that site.  Please do not contact me for help with\nlibgd.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "The GD.pm  interface  is  copyright  1995-2010,  Lincoln  D.  Stein.  This  package  and  its\naccompanying  libraries  is free software; you can redistribute it and/or modify it under the\nterms of the GPL (either version 1, or at your option, any later  version)  or  the  Artistic\nLicense 2.0.  Refer to LICENSE for the full license text.  package for details.\n\nThe latest versions of GD.pm are available at\n\nhttps://github.com/lstein/Perl-GD\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "GD::Polyline, GD::SVG, GD::Simple, Image::Magick\n\nperl v5.38.2                                 2026-06-16                                      GD(3pm)",
            "subsections": []
        }
    },
    "summary": "GD.pm - Interface to Gd Graphics Library",
    "flags": [],
    "examples": [],
    "see_also": []
}