<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/refs.utilspec.image.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'book.image.php',
    1 => 'GD',
    2 => 'Bildbearbeitung und GD',
  ),
  'up' => 
  array (
    0 => 'refs.utilspec.image.php',
    1 => 'Bildverarbeitung und -generierung',
  ),
  'prev' => 
  array (
    0 => 'function.read-exif-data.php',
    1 => 'read_exif_data',
  ),
  'next' => 
  array (
    0 => 'image.setup.php',
    1 => 'Installation/Konfiguration',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/image/book.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/book.image.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="book.image" class="book">
 
 <h1 class="title">Bildbearbeitung und GD</h1>
 

 
 <div id="intro.image" class="preface">
  <h1 class="title">Einführung</h1>
  <p class="para">
   Mit PHP können Sie nicht nur HTML ausgeben, sondern auch Grafiken in vielen
   Formaten wie <abbr title="Graphic Interchange Format">GIF</abbr>, <abbr title="Portable Network Graphics">PNG</abbr>,
   <abbr title="Joint Photographic Experts Group">JPEG</abbr>, <abbr title="Wireless Bitmap">WBMP</abbr> und <abbr>XPM</abbr>
   erzeugen und/oder manipulieren. Noch besser, Sie können Grafiken mit PHP
   direkt als Datenstrom ausgeben. Damit das funktioniert, müssen Sie PHP mit
   der <abbr title="Graphics Draw">GD</abbr>-Bibliothek zur Grafikbearbeitung kompilieren.
   <abbr title="Graphics Draw">GD</abbr> und PHP benötigen, je nachdem mit welchen
   Grafikformaten Sie arbeiten wollen, zusätzliche Bibliotheken.
  </p>
  <p class="para">
   Sie können die Grafikfunktionen in PHP auch verwenden, um die Größe von
   <abbr title="Joint Photographic Experts Group">JPEG</abbr>-, <abbr title="Graphic Interchange Format">GIF</abbr>-, <abbr title="Portable Network Graphics">PNG</abbr>-,
   <abbr title="Shockwave Flash">SWF</abbr>-, <abbr title="Tagged Image File Format">TIFF</abbr>- und
   <abbr>JPEG2000</abbr>-Grafiken zu bestimmen.
  </p>
  <p class="para">
   Mittels der <a href="ref.exif.php" class="link">exif-Erweiterung</a> können Sie die
   in den Headern von <abbr title="Joint Photographic Experts Group">JPEG</abbr>- und
   <abbr title="Tagged Image File Format">TIFF</abbr>-Grafiken enthaltenen Informationen verarbeiten. Auf
   diese Weise können von Digitalkameras erstellte Metadaten verarbeitet
   werden. Die Exif-Funktionen benötigen die <abbr title="Graphics Draw">GD</abbr>-Bibliothek
   nicht.
  </p>

  <p class="para">
   <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
    <span class="simpara">
     Im Abschnitt über die Anforderungen können Sie nachlesen, wie Sie die
     Möglichkeiten der Bildbearbeitung zum Lesen, Schreiben und Manipulieren
     von Bildern erweitern können. Um Metadaten von Bildern auszulesen, die
     mit einer Digitalkamera aufgenommen wurden, wird die bereits erwähnte
     <a href="ref.exif.php" class="link">exif-Erweiterung</a> benötigt.
    </span>
   </p></blockquote>
   <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
    <span class="simpara">
     Für die Funktion <span class="function"><a href="function.getimagesize.php" class="function">getimagesize()</a></span> wird die GD-Bibliothek
     nicht benötigt.
    </span>
   </p></blockquote>
   <div class="caution"><strong class="caution">Achtung</strong>
    <p class="simpara">
     Während die gebündelte Version der GD-Bibliothek den Zend-Speichermanager
     zur Allokation von Speicher verwendet, tun dies die Systemversionen
     nicht, sodass <a href="ini.core.php#ini.memory-limit" class="link">memory_limit</a>
     ignoriert wird.
    </p>
   </div>
  </p>
  <p class="para">
   GD unterstützt viele Formate. Nachfolgend eine Liste aller von GD
   unterstützten Formaten und Hinweise zu Verfügbarkeit und
   Lese-/Schreibunterstützung.
  </p>
  <p class="para">
   <table class="doctable table">
    <caption><strong>Von GD unterstützte Formate</strong></caption>
    
     <thead>
      <tr>
       <th>Format</th>
       <th>Lesen</th>
       <th>Schreiben</th>
       <th>Anmerkungen</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>JPEG</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>PNG</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>GIF</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>XBM</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>XPM</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>WBMP</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>WebP</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>BMP</td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td><strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></td>
       <td>Verfügbar seit PHP 7.2.0</td>
      </tr>

     </tbody>
    
   </table>

  </p>
  <p class="para">
   Obwohl die meisten Formate in der obigen Tabelle sowohl zum Lesen als auch
   zum Schreiben verfügbar sind, bedeutet dies nicht, dass die Unterstützung
   in PHP einkompiliert ist. Welche Formate dies sind und wie PHP mit
   Unterstützung für diese kompiliert werden kann, zeigt die Funktion
   <span class="function"><a href="function.gd-info.php" class="function">gd_info()</a></span>. Weitere Informationen zu diesem Thema sind im
   Kapitel Installation zu finden.
  </p>
 </div>

 

 








 




 








 







 




 




<ul class="chunklist chunklist_book"><li><a href="image.setup.php">Installation/Konfiguration</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="image.requirements.php">Anforderungen</a></li><li><a href="image.installation.php">Installation</a></li><li><a href="image.configuration.php">Laufzeit-Konfiguration</a></li><li><a href="image.resources.php">Ressource-Typen</a></li></ul></li><li><a href="image.constants.php">Vordefinierte Konstanten</a></li><li><a href="image.examples.php">Beispiele</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="image.examples-png.php">PNG erzeugen mit PHP</a></li><li><a href="image.examples-watermark.php">Wasserzeichen mit Hilfe von Alpha-Kan&auml;len zuf&uuml;gen</a></li><li><a href="image.examples.merged-watermark.php">Erstellen eines transparenten Wasserzeichens mit imagecopymerge</a></li></ul></li><li><a href="ref.image.php">GD- und Image-Funktionen</a><ul class="chunklist chunklist_book chunklist_children"><li><a href="function.gd-info.php">gd_info</a> — Liefert Informationen &uuml;ber die aktuell verwendete GD-Bibliothek</li><li><a href="function.getimagesize.php">getimagesize</a> — Liefert die Gr&ouml;&szlig;e einer Grafik</li><li><a href="function.getimagesizefromstring.php">getimagesizefromstring</a> — Liefert die Gr&ouml;&szlig;e einer Grafik aus einer Zeichenkette</li><li><a href="function.image-type-to-extension.php">image_type_to_extension</a> — Get file extension for image type</li><li><a href="function.image-type-to-mime-type.php">image_type_to_mime_type</a> — Get Mime-Type for image-type returned by getimagesize,
   exif_read_data, exif_thumbnail, exif_imagetype</li><li><a href="function.image2wbmp.php">image2wbmp</a> — Gibt das Bild im Browser oder einer Datei aus.</li><li><a href="function.imageaffine.php">imageaffine</a> — Return an image containing the affine transformed src image, using an optional clipping area</li><li><a href="function.imageaffinematrixconcat.php">imageaffinematrixconcat</a> — Concatenate two affine transformation matrices</li><li><a href="function.imageaffinematrixget.php">imageaffinematrixget</a> — Get an affine transformation matrix</li><li><a href="function.imagealphablending.php">imagealphablending</a> — Set the blending mode for an image</li><li><a href="function.imageantialias.php">imageantialias</a> — Should antialias functions be used or not</li><li><a href="function.imagearc.php">imagearc</a> — Zeichnet einen Bogen</li><li><a href="function.imageavif.php">imageavif</a> — Gibt das Bild im Browser oder einer Datei aus.</li><li><a href="function.imagebmp.php">imagebmp</a> — Output a BMP image to browser or file</li><li><a href="function.imagechar.php">imagechar</a> — Zeichnet ein horizontal ausgerichtetes Zeichen</li><li><a href="function.imagecharup.php">imagecharup</a> — Zeichnet ein vertikal ausgerichtetes Zeichen</li><li><a href="function.imagecolorallocate.php">imagecolorallocate</a> — Alloziert eine Farbe f&uuml;r eine Grafik</li><li><a href="function.imagecolorallocatealpha.php">imagecolorallocatealpha</a> — Allocate a color for an image</li><li><a href="function.imagecolorat.php">imagecolorat</a> — Liefert den Farbwert eines Bildpunktes</li><li><a href="function.imagecolorclosest.php">imagecolorclosest</a> — Ermittelt den Index der Farbe, die der angegebenen Farbe am n&auml;chsten kommt</li><li><a href="function.imagecolorclosestalpha.php">imagecolorclosestalpha</a> — Get the index of the closest color to the specified color + alpha</li><li><a href="function.imagecolorclosesthwb.php">imagecolorclosesthwb</a> — Get the index of the color which has the hue, white and blackness</li><li><a href="function.imagecolordeallocate.php">imagecolordeallocate</a> — L&ouml;scht eine Farbdefinition</li><li><a href="function.imagecolorexact.php">imagecolorexact</a> — Ermittelt den Index-Wert der angegebenen Farbe</li><li><a href="function.imagecolorexactalpha.php">imagecolorexactalpha</a> — Get the index of the specified color + alpha</li><li><a href="function.imagecolormatch.php">imagecolormatch</a> — Makes the colors of the palette version of an image more closely match the true color version</li><li><a href="function.imagecolorresolve.php">imagecolorresolve</a> — Ermittelt den Index-Wert der angegebenen Farbe oder die n&auml;chstm&ouml;gliche
   Alternative dazu</li><li><a href="function.imagecolorresolvealpha.php">imagecolorresolvealpha</a> — Get the index of the specified color + alpha or its closest possible alternative</li><li><a href="function.imagecolorset.php">imagecolorset</a> — Setzt die Farbe f&uuml;r den angegebenen Paletten-Index</li><li><a href="function.imagecolorsforindex.php">imagecolorsforindex</a> — Ermittelt die Farbwerte eines Palettenindex</li><li><a href="function.imagecolorstotal.php">imagecolorstotal</a> — Ermittelt die Anzahl der Farben in der Palette eines Bildes</li><li><a href="function.imagecolortransparent.php">imagecolortransparent</a> — Definiert eine Farbe als transparent</li><li><a href="function.imageconvolution.php">imageconvolution</a> — Apply a 3x3 convolution matrix, using coefficient and offset</li><li><a href="function.imagecopy.php">imagecopy</a> — Kopiert einen Bildausschnitt</li><li><a href="function.imagecopymerge.php">imagecopymerge</a> — Copy and merge part of an image</li><li><a href="function.imagecopymergegray.php">imagecopymergegray</a> — Copy and merge part of an image with gray scale</li><li><a href="function.imagecopyresampled.php">imagecopyresampled</a> — Copy and resize part of an image with resampling</li><li><a href="function.imagecopyresized.php">imagecopyresized</a> — Kopieren und &Auml;ndern der Gr&ouml;&szlig;e eines Bild-Teiles</li><li><a href="function.imagecreate.php">imagecreate</a> — Erzeugt ein neues Palettenbild</li><li><a href="function.imagecreatefromavif.php">imagecreatefromavif</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefrombmp.php">imagecreatefrombmp</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefromgd.php">imagecreatefromgd</a> — Create a new image from GD file or URL</li><li><a href="function.imagecreatefromgd2.php">imagecreatefromgd2</a> — Create a new image from GD2 file or URL</li><li><a href="function.imagecreatefromgd2part.php">imagecreatefromgd2part</a> — Create a new image from a given part of GD2 file or URL</li><li><a href="function.imagecreatefromgif.php">imagecreatefromgif</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefromjpeg.php">imagecreatefromjpeg</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefrompng.php">imagecreatefrompng</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefromstring.php">imagecreatefromstring</a> — Create a new image from the image stream in the string</li><li><a href="function.imagecreatefromtga.php">imagecreatefromtga</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefromwbmp.php">imagecreatefromwbmp</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefromwebp.php">imagecreatefromwebp</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefromxbm.php">imagecreatefromxbm</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatefromxpm.php">imagecreatefromxpm</a> — Erzeugt ein neues Bild aus einer Datei oder URL</li><li><a href="function.imagecreatetruecolor.php">imagecreatetruecolor</a> — Create a new true color image</li><li><a href="function.imagecrop.php">imagecrop</a> — Crop an image to the given rectangle</li><li><a href="function.imagecropauto.php">imagecropauto</a> — Crop an image automatically using one of the available modes</li><li><a href="function.imagedashedline.php">imagedashedline</a> — Zeichnet eine gestrichelte Linie</li><li><a href="function.imagedestroy.php">imagedestroy</a> — L&ouml;scht ein Bild</li><li><a href="function.imageellipse.php">imageellipse</a> — Draw an ellipse</li><li><a href="function.imagefill.php">imagefill</a> — Flutf&uuml;llung</li><li><a href="function.imagefilledarc.php">imagefilledarc</a> — Draw a partial arc and fill it</li><li><a href="function.imagefilledellipse.php">imagefilledellipse</a> — Draw a filled ellipse</li><li><a href="function.imagefilledpolygon.php">imagefilledpolygon</a> — Zeichnet ein gef&uuml;lltes Polygon</li><li><a href="function.imagefilledrectangle.php">imagefilledrectangle</a> — Zeichnet ein gef&uuml;lltes Rechteck</li><li><a href="function.imagefilltoborder.php">imagefilltoborder</a> — F&uuml;llt einen Bereich mit einer bestimmten Farbe</li><li><a href="function.imagefilter.php">imagefilter</a> — Applies a filter to an image</li><li><a href="function.imageflip.php">imageflip</a> — Flips an image using a given mode</li><li><a href="function.imagefontheight.php">imagefontheight</a> — Ermittelt die H&ouml;he einer Schriftart</li><li><a href="function.imagefontwidth.php">imagefontwidth</a> — Ermittelt die Breite einer Schriftart</li><li><a href="function.imageftbbox.php">imageftbbox</a> — Give the bounding box of a text using fonts via freetype2</li><li><a href="function.imagefttext.php">imagefttext</a> — Write text to the image using fonts using FreeType 2</li><li><a href="function.imagegammacorrect.php">imagegammacorrect</a> — Wendet eine Gamma-Korrektur auf ein GD-Bild an</li><li><a href="function.imagegd.php">imagegd</a> — Output GD image to browser or file</li><li><a href="function.imagegd2.php">imagegd2</a> — Output GD2 image to browser or file</li><li><a href="function.imagegetclip.php">imagegetclip</a> — Get the clipping rectangle</li><li><a href="function.imagegetinterpolation.php">imagegetinterpolation</a> — Get the interpolation method</li><li><a href="function.imagegif.php">imagegif</a> — Gibt das Bild im Browser oder einer Datei aus.</li><li><a href="function.imagegrabscreen.php">imagegrabscreen</a> — Captures the whole screen</li><li><a href="function.imagegrabwindow.php">imagegrabwindow</a> — Captures a window</li><li><a href="function.imageinterlace.php">imageinterlace</a> — Aktiviert oder Deaktiviert Interlacing</li><li><a href="function.imageistruecolor.php">imageistruecolor</a> — Finds whether an image is a truecolor image</li><li><a href="function.imagejpeg.php">imagejpeg</a> — Gibt das Bild im Browser oder einer Datei aus.</li><li><a href="function.imagelayereffect.php">imagelayereffect</a> — Set the alpha blending flag to use layering effects</li><li><a href="function.imageline.php">imageline</a> — Zeichnet eine Linie</li><li><a href="function.imageloadfont.php">imageloadfont</a> — L&auml;dt eine neue Schriftart</li><li><a href="function.imageopenpolygon.php">imageopenpolygon</a> — Draws an open polygon</li><li><a href="function.imagepalettecopy.php">imagepalettecopy</a> — Copy the palette from one image to another</li><li><a href="function.imagepalettetotruecolor.php">imagepalettetotruecolor</a> — Converts a palette based image to true color</li><li><a href="function.imagepng.php">imagepng</a> — Ausgabe eines Bildes im Browser oder als Datei im PNG-Format</li><li><a href="function.imagepolygon.php">imagepolygon</a> — Zeichnet ein Polygon</li><li><a href="function.imagerectangle.php">imagerectangle</a> — Zeichnet ein Rechteck</li><li><a href="function.imageresolution.php">imageresolution</a> — Get or set the resolution of the image</li><li><a href="function.imagerotate.php">imagerotate</a> — Rotate an image with a given angle</li><li><a href="function.imagesavealpha.php">imagesavealpha</a> — Ob beim Speichern von Bildern vollst&auml;ndige Alphakanal-Information erhalten wird</li><li><a href="function.imagescale.php">imagescale</a> — Scale an image using the given new width and height</li><li><a href="function.imagesetbrush.php">imagesetbrush</a> — Set the brush image for line drawing</li><li><a href="function.imagesetclip.php">imagesetclip</a> — Set the clipping rectangle</li><li><a href="function.imagesetinterpolation.php">imagesetinterpolation</a> — Set the interpolation method</li><li><a href="function.imagesetpixel.php">imagesetpixel</a> — Setzt ein einzelnes Pixel</li><li><a href="function.imagesetstyle.php">imagesetstyle</a> — Set the style for line drawing</li><li><a href="function.imagesetthickness.php">imagesetthickness</a> — Set the thickness for line drawing</li><li><a href="function.imagesettile.php">imagesettile</a> — Set the tile image for filling</li><li><a href="function.imagestring.php">imagestring</a> — Zeichnet einen horizontalen String</li><li><a href="function.imagestringup.php">imagestringup</a> — Zeichnet einen vertikalen String</li><li><a href="function.imagesx.php">imagesx</a> — Ermittelt die Breite eines Bildes</li><li><a href="function.imagesy.php">imagesy</a> — Ermittelt die H&ouml;he eines Bildes</li><li><a href="function.imagetruecolortopalette.php">imagetruecolortopalette</a> — Convert a true color image to a palette image</li><li><a href="function.imagettfbbox.php">imagettfbbox</a> — Ermittelt das umgebende Rechteck eines Textes, der eine TrueType-Schriftart
   verwendet</li><li><a href="function.imagettftext.php">imagettftext</a> — Schreibt Text mit TrueType-Schriftarten ins Bild</li><li><a href="function.imagetypes.php">imagetypes</a> — Liefert die von der verwendeten PHP-Version unterst&uuml;tzten Grafikformate</li><li><a href="function.imagewbmp.php">imagewbmp</a> — Gibt das Bild im Browser oder einer Datei aus.</li><li><a href="function.imagewebp.php">imagewebp</a> — Output a WebP image to browser or file</li><li><a href="function.imagexbm.php">imagexbm</a> — Output an XBM image to browser or file</li><li><a href="function.iptcembed.php">iptcembed</a> — Embeds binary IPTC data into a JPEG image</li><li><a href="function.iptcparse.php">iptcparse</a> — Parse a binary IPTC block into single tags</li><li><a href="function.jpeg2wbmp.php">jpeg2wbmp</a> — Konvertiert eine JPEG-Bilddatei in eine WBMP-Bilddatei</li><li><a href="function.png2wbmp.php">png2wbmp</a> — Convert PNG image file to WBMP image file</li></ul></li><li><a href="class.gdimage.php">GdImage</a> — The GdImage class</li><li><a href="class.gdfont.php">GdFont</a> — The GdFont class</li></ul></div><?php manual_footer($setup); ?>