XLI. Funciones para imágenes

Puede usar las funciones para imágenes en PHP para obtener el tamaño de imágenes JPEG, GIF, PNG, SWF, TIFF y JPEG2000, y si tiene instalada la biblioteca GD (disponible en http://www.boutell.com/gd/) también podrá crear y manipular imágenes.

Si tiene PHP compilado con --enable-exif puede trabajar con la información guardada en las cabeceras de las imágenes JPEG y TIFF. Estas funciones no requieren la biblioteca GD.

Los formatos de imágenes que puede manipular dependen de la versión de GD que instale y de cualquier otra biblioteca que GD pueda necesitar para acceder a esos formatos de imagen. Las versiones de GD anteriores a la GD-1.6 soportan imágenes en formato gif y no soportan png, mientras que las versiones superiores a la GD-1.6 soportan el formato png y no el gif.

Antes de poder leer y escribir imágenes en formato jpeg, deberá obtener e instalar jpeg-6b (disponible en ftp://ftp.uu.net/graphics/jpeg/), y después recompilar GD para poder hacer uso de jpeg-6b. También tendrá que compilar PHP con la opción --with-jpeg-dir=/ruta/a/jpeg-6b.

Para añadir el soporte de fuentes Type 1, puede instalar t1lib (disponible en ftp://sunsite.unc.edu/pub/Linux/libs/graphics/), y entonces añadir la opción --with-t1lib[=dir] al recompilar.

Tabla de contenidos
exif_imagetype -- Determine the type of an image
exif_read_data -- Read the EXIF headers from JPEG or TIFF. This way you can read meta data generated by digital cameras.
exif_thumbnail -- Retrieve the embedded thumbnail of a TIFF or JPEG image
gd_info -- Retrieve information about the currently installed GD library
GetImageSize -- Obtiene el tamaño de una imagen GIF, JPG o PNG
image_type_to_mime_type -- Get Mime-Type for image-type returned by getimagesize, exif_read_data, exif_thumbnail, exif_imagetype
image2wbmp -- Output image to browser or file
imagealphablending -- Set the blending mode for an image
ImageArc -- Dibuja una elipse parcial
ImageChar -- Dibuja un carácter horizontalmente
ImageCharUp -- Dibuja un carácter vertical
ImageColorAllocate -- Reserva un color para una imagen
imagecolorallocatealpha -- Allocate a color for an image
ImageColorAt -- Obtiende el índice del color de un pixel
ImageColorClosest -- Obtiene el índice del color más cercano al color especificado
imagecolorclosestalpha -- Get the index of the closest color to the specified color + alpha
imagecolorclosesthwb --  Get the index of the color which has the hue, white and blackness nearest to the given color
imagecolordeallocate -- De-allocate a color for an image
ImageColorExact -- Devuelve el índice del color especificado
imagecolorexactalpha -- Get the index of the specified color + alpha
ImageColorResolve -- Devuelve el índice del color especificado o su posible alternativa más cercana
imagecolorresolvealpha --  Get the index of the specified color + alpha or its closest possible alternative
ImageColorSet -- Establece el color para el índice de la paleta especificado
ImageColorsForIndex -- Obtiene los colores de un índice
ImageColorsTotal -- Encuentra el número de colores de la paleta de una imagen
ImageColorTransparent -- Define un color como transparente
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
imagecopyresampled -- Copia y reescala parte de una imagen con remuestreo
ImageCopyResized -- Copia y redimensiona parte de una imagen
ImageCreate -- Crea una nueva imagen
imagecreatefromgd2 -- Create a new image from GD2 file or URL
imagecreatefromgd2part -- Create a new image from a given part of GD2 file or URL
imagecreatefromgd -- Create a new image from GD file or URL
ImageCreateFromGif -- Crea una nueva imagen desde un fichero o una URL
imagecreatefromjpeg -- Crea una imagen nueva desde un archivo o URL
imagecreatefrompng -- Crea una imagen nueva desde un fichero o URL
imagecreatefromstring -- Create a new image from the image stream in the string
imagecreatefromwbmp -- Create a new image from file or URL
imagecreatefromxbm -- Create a new image from file or URL
imagecreatefromxpm -- Create a new image from file or URL
imagecreatetruecolor -- Crea una imagen nueva en color real (true color)
ImageDashedLine -- Dibuja una línea discontinua
ImageDestroy -- Destruye una imagen
imageellipse -- Draw an ellipse
ImageFill -- Relleno
imagefilledarc -- Draw a partial ellipse and fill it
imagefilledellipse -- Draw a filled ellipse
ImageFilledPolygon -- Dibuja un polígono relleno
ImageFilledRectangle -- dibuja un rectángulo relleno
ImageFillToBorder -- Relleno de un color especifico
ImageFontHeight -- Devuelve la altura de una fuente
ImageFontWidth -- Devuelve la anchura de una fuente
imageftbbox -- Give the bounding box of a text using fonts via freetype2
imagefttext -- Write text to the image using fonts using FreeType 2
imagegammacorrect -- Apply a gamma correction to a GD image
imagegd2 -- Output GD2 image to browser or file
imagegd -- Output GD image to browser or file
ImageGif -- Envía una imagen al navegador o a un fichero
ImageInterlace -- Activa o desactiva el entrelazado
imagejpeg -- Output image to browser or file
ImageLine -- Dibuja una línea
ImageLoadFont -- Carga una fuente nueva
imagepalettecopy -- Copy the palette from one image to another
imagepng -- Output a PNG image to either the browser or a file
ImagePolygon -- Dibuja un polígono
ImagePSBBox -- Devuelve el borde que rodea un rectángulo de texto usando fuentes PostScript Type1
ImagePSCopyFont -- hace una copia de una fuente ya cargada para futuras modificaciones
ImagePSEncodeFont -- Cambia el vector de codificación de caracteres de una fuente
imagepsextendfont -- Extend or condense a font
ImagePSFreeFont -- Libera la memoria usada por un fuente PostScript Type 1
ImagePSLoadFont -- Carga una fuente PostScript Type 1 desde un fichero
imagepsslantfont -- Slant a font
ImagePSText -- Para dibujar una cadena de texto sobre una imagen usando fuentes PostScript Type1
ImageRectangle -- Dibuja un rectángulo
imagerotate -- Rotate an image with a given angle
imagesetbrush -- Set the brush image for line drawing
ImageSetPixel -- Dibuja un pixel
imagesetstyle -- Set the style for line drawing
imagesetthickness -- Set the thickness for line drawing
imagesettile -- Set the tile image for filling
ImageString -- Dibuja una cadena de texto horizintalmente
ImageStringUp -- Dibuja una cadena de texto verticalmente
ImageSX -- Obtiene la anchura de la imagen
ImageSY -- Obtiene la altura de la imagen
imagetruecolortopalette -- Convert a true color image to a palette image
ImageTTFBBox -- Devuelve un caja que rodea al texto usando fuentes TypeType
ImageTTFText -- Escribe texto en la imagen usando fuentes TrueType
imagetypes -- Return the image types supported by this PHP build
imagewbmp -- Output image to browser or file
iptcembed -- Embed binary IPTC data into a JPEG image
iptcparse --  Parse a binary IPTC http://www.iptc.org/ block into single tags.
jpeg2wbmp -- Convert JPEG image file to WBMP image file
png2wbmp -- Convert PNG image file to WBMP image file
read_exif_data -- Reads header information stored in TIFF and JPEG images