A Scripting Language for Web, Linux and Windows

A Scripting Language for Web, Linux and Windows

Module: gd

Module for image processing, compatible with PHP GD based on LibGD The module must be loaded with dl('gd');

See also example Graphics functions.

The following functions are almost compatible with PHP. For further information read documentation of PHP GD.

  • gd_info
  • imagetypes

Open / Output

  • imagecreate
  • imagecreatetruecolor
  • imagedestroy
  • imagejpeg
  • imagegif
  • imagepng
  • imagewbmp
  • imagewebp
  • imagebmp

Special helper functions, not part of PHP GD.

Function/Arguments Return Description
imagecreatefromfile (string filename) handle Create image from filename. On success a image handle is returned.
imagefile (handle image, string filename) bool Save image to filename. On success true is returned.

Drawing

  • imagesetpixel
  • imagefill
  • imagefilltoborder
  • imageline
  • imagedashedline
  • imagerectangle
  • imagefilledrectangle
  • imagearc
  • imagefilledarc
  • imageellipse
  • imagefilledellipse
  • imagepolygon
  • imageopenpolygon
  • imagefilledpolygon

Text/Font

  • imagestring
  • imagestringup
  • imagettftext
  • imagefontheight
  • imagefontwidth

Properties

  • imageistruecolor
  • imagegettruecolorpixel
  • imagesetthickness
  • imagesetbrush
  • imagesettile
  • imagesetstyle
  • imagesetantialiased
  • imagesetantialiaseddontblend
  • imageinterlace
  • imageresolution
  • imagealphablending
  • imagesavealpha
  • imagesetinterpolation

Special helper functions, not part of PHP GD.

Function/Arguments Return Description
imagesx (handle image) number Return image width in pixel.
imagesy (handle image) number Return image height in pixel.
imagegetpixel (handle image, number x, number y) number Get color of pixel x/y. Same as colorat function.

Colors, Palettes

  • imagecolorstotal
  • imagecolorat
  • imagecolorsforindex
  • imagecolortransparent
  • imagecolorallocate
  • imagecolorallocatealpha
  • imagecolordeallocate
  • imagecolorclosest
  • imagecolorclosestalpha
  • imagecolorclosesthwb
  • imagecolorexact
  • imagecolorexactalpha
  • imagecolorresolve
  • imagecolorresolvealpha
  • imagecolormatch
  • imagecolorset
  • imagepalettetotruecolor
  • imagetruecolortopalette
  • imagepalettecopy

Copy, Size

  • imagecopy
  • imagecopymerge
  • imagecopymergegray
  • imagecopyresized
  • imagecopyrotated
  • imagecopyresampled
  • imagecrop
  • imagecropauto
  • imagescale

Operations, Filters

  • imageflip
  • imagerotate
  • imagefilter
  • imagecompare

back to Home