ASPN ActiveState Programmer Network
  ActiveState, a division of Sophos
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
PHP Manual
Function Reference
Apache-specific Functions
Array Functions
Aspell functions [deprecated]
BCMath Arbitrary Precision Mathematics Functions
Bzip2 Compression Functions
Calendar functions
CCVS API Functions
COM support functions for Windows
Class/Object Functions
ClibPDF functions
CURL, Client URL Library Functions
Cybercash payment functions
Crédit Mutuel CyberMUT functions
Character type functions
Database (dbm-style) abstraction layer functions
Date and Time functions
dBase functions
DBM Functions
dbx functions
DB++ Functions
Directory functions
DOM XML functions
Error Handling and Logging Functions
FrontBase Functions
filePro functions
Filesystem functions
Forms Data Format functions
FTP functions
Function Handling functions
Gettext
GMP functions
HTTP functions
Hyperwave functions
ICAP Functions
iconv functions
Image functions
IMAP, POP3 and NNTP functions
Informix functions
InterBase functions
Ingres II functions
IRC Gateway Functions
Java
LDAP functions
Mail functions
Mathematical Functions
Multi-Byte String Functions
MCAL functions
Mcrypt Encryption Functions
Mhash Functions
Microsoft SQL Server functions
Ming functions for Flash
Miscellaneous functions
mnoGoSearch Functions
mSQL functions
MySQL Functions
Network Functions
Unified ODBC functions
Oracle 8 functions
OpenSSL functions
Oracle functions
Ovrimos SQL functions
Output Control Functions
Object property and method call overloading
PDF functions
Verisign Payflow Pro functions
PHP options & information
POSIX functions
PostgreSQL functions
Program Execution functions
Printer functions
Pspell Functions
GNU Readline
GNU Recode functions
Regular Expression Functions (Perl-Compatible)
Regular Expression Functions (POSIX Extended)
Satellite CORBA client extension
Semaphore and Shared Memory Functions
SESAM database functions
Session handling functions
Shared Memory Functions
Shockwave Flash functions
SNMP functions
Socket functions
String functions
Sybase functions
URL Functions
Variable Functions
WDDX Functions
XML parser functions
XSLT functions
YAZ functions
YP/NIS Functions
Zip File Functions (Read Only Access)
Zlib Compression Functions

MyASPN >> Reference >> PHP Manual >> Function Reference
PHP Manual

XXXVI. Image functions

You can use the image functions in PHP to get the size of JPEG, GIF, PNG, and SWF images, and if you have the GD library (available at http://www.boutell.com/gd/) you will also be able to create and manipulate images.

The format of images you are able to manipulate depend on the version of gd you install, and any other libraries gd might need to access those image formats. Versions of gd older than gd-1.6 support gif format images, and do not support png, where versions greater than gd-1.6 support png, not gif.

In order to read and write images in jpeg format, you will need to obtain and install jpeg-6b (available at ftp://ftp.uu.net/graphics/jpeg/), and then recompile gd to make use of jpeg-6b. You will also have to compile PHP with --with-jpeg-dir=/path/to/jpeg-6b.

To add support for Type 1 fonts, you can install t1lib (available at ftp://sunsite.unc.edu/pub/Linux/libs/graphics/), and then add --with-t1lib[=dir].

Table of Contents
GetImageSize -- Get the size of an image
Image2WBMP -- Output image to browser or file
ImageAlphaBlending -- Set the blending mode for an image
ImageArc -- Draw a partial ellipse
ImageFilledArc -- Draw a partial ellipse and fill it
ImageEllipse -- Draw an ellipse
ImageFilledEllipse -- Draw a filled ellipse
ImageChar -- Draw a character horizontally
ImageCharUp -- Draw a character vertically
ImageColorAllocate -- Allocate a color for an image
ImageColorDeAllocate --  De-allocate a color for an image
ImageColorAt -- Get the index of the color of a pixel
ImageColorClosest --  Get the index of the closest color to the specified color
ImageColorClosestAlpha --  Get the index of the closest color to the specified color + alpha
ImageColorExact -- Get the index of the specified color
ImageColorExactAlpha -- Get the index of the specified color + alpha
ImageColorResolve --  Get the index of the specified color or its closest possible alternative
ImageColorResolveAlpha --  Get the index of the specified color + alpha or its closest possible alternative
ImageGammaCorrect --  Apply a gamma correction to a GD image
ImageColorSet --  Set the color for the specified palette index
ImageColorsForIndex -- Get the colors for an index
ImageColorsTotal --  Find out the number of colors in an image's palette
ImageColorTransparent -- Define a color as transparent
ImageCopy --  Copy part of an image
ImageCopyMerge --  Copy and merge part of an image
ImageCopyMergeGray --  Copy and merge part of an image with gray scale
ImageCopyResized -- Copy and resize part of an image
ImageCopyResampled -- Copy and resize part of an image with resampling
ImageCreate -- Create a new palette based image
ImageCreateTrueColor -- Create a new TRUE color image
ImageTrueColorToPalette -- Convert a TRUE color image to a palette image
ImageCreateFromGIF -- Create a new image from file or URL
ImageCreateFromJPEG -- Create a new image from file or URL
ImageCreateFromPNG -- Create a new image from file or URL
ImageCreateFromWBMP -- Create a new image from file or URL
ImageCreateFromString -- Create a new image from the image stream in the string
ImageCreateFromXBM -- Create a new image from file or URL
ImageCreateFromXPM -- Create a new image from file or URL
ImageDashedLine -- Draw a dashed line
ImageDestroy -- Destroy an image
ImageFill -- Flood fill
ImageFilledPolygon -- Draw a filled polygon
ImageFilledRectangle -- Draw a filled rectangle
ImageFillToBorder -- Flood fill to specific color
ImageFontHeight -- Get font height
ImageFontWidth -- Get font width
ImageGIF -- Output image to browser or file
ImagePNG --  Output a PNG image to either the browser or a file
ImageJPEG -- Output image to browser or file
ImageWBMP -- Output image to browser or file
ImageInterlace -- Enable or disable interlace
ImageLine -- Draw a line
ImageLoadFont -- Load a new font
ImagePaletteCopy -- Copy the palette from one image to another
ImagePolygon -- Draw a polygon
ImagePSBBox --  Give the bounding box of a text rectangle using PostScript Type1 fonts
ImagePSEncodeFont --  Change the character encoding vector of a font
ImagePSFreeFont -- Free memory used by a PostScript Type 1 font
ImagePSLoadFont -- Load a PostScript Type 1 font from file
ImagePsExtendFont --  Extend or condense a font
ImagePsSlantFont --  Slant a font
ImagePSText --  To draw a text string over an image using PostScript Type1 fonts
ImageRectangle -- Draw a rectangle
ImageSetPixel -- Set a single pixel
ImageSetBrush -- Set the brush image for line drawing
ImageSetStyle -- Set the style for line drawing
ImageSetTile -- Set the tile image for filling
ImageSetThickness -- Set the thickness for line drawing
ImageString -- Draw a string horizontally
ImageStringUp -- Draw a string vertically
ImageSX -- Get image width
ImageSY -- Get image height
ImageTTFBBox --  Give the bounding box of a text using TypeType fonts
ImageTTFText --  Write text to the image using TrueType fonts
ImageTypes --  Return the image types supported by this PHP build
JPEG2WBMP --  Convert JPEG image file to WBMP image file
PNG2WBMP --  Convert PNG image file to WBMP image file
read_exif_data -- Read the EXIF headers from a JPEG

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2003 ActiveState, a division of Sophos All rights reserved