<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-gdkpixbuf">
  <refnamediv>
    <refname>gtk.gdk.Pixbuf</refname>
    <refpurpose>an object containing a client side image.</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.gdk.Pixbuf</classname></ooclass>
      <ooclass><classname><link
linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <constructorsynopsis language="python">
	<methodname><link
linkend="constructor-gdkpixbuf">gtk.gdk.Pixbuf</link></methodname>
	<methodparam><parameter
		       role="keyword">colorspace</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">has_alpha</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">bits_per_sample</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </constructorsynopsis>
      
      <methodsynopsis language="python">
	<methodname><link inkend="method-gdkpixbuf--apply-embedded-orientation">apply_embedded_orientation</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--render-to-drawable">render_to_drawable</link></methodname>
	<methodparam><parameter
		       role="keyword">drawable</parameter></methodparam>
	<methodparam><parameter role="keyword">gc</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dither</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">x_dither</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">y_dither</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--render-to-drawable-alpha">render_to_drawable_alpha</link></methodname>
	<methodparam><parameter
		       role="keyword">drawable</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">alpha_mode</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">alpha_threshold</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dither</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">x_dither</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">y_dither</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--render-pixmap-and-mask">render_pixmap_and_mask</link></methodname>
	<methodparam><parameter
		       role="keyword">alpha_threshold</parameter><initializer>127</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-from-drawable">get_from_drawable</link></methodname>
	<methodparam><parameter role="keyword">src</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">cmap</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-from-image">get_from_image</link></methodname>
	<methodparam><parameter role="keyword">src</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">cmap</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-colorspace">get_colorspace</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-n-channels">get_n_channels</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-has-alpha">get_has_alpha</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-bits-per-sample">get_bits_per_sample</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-pixels">get_pixels</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-width">get_width</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-height">get_height</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-rowstride">get_rowstride</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--get-option">get_option</link></methodname>
	<methodparam><parameter role="keyword">key</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--copy">copy</link></methodname>
	<methodparam></methodparam>  </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--fill">fill</link></methodname>
	<methodparam><parameter
		       role="keyword">pixel</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--save">save</link></methodname>
	<methodparam><parameter
		       role="keyword">filename</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">type</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">options</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>

<!-- NOT IMPLEMENTED
<methodsynopsis language="python">
    <methodname><link linkend="method-gdkpixbuf- -savev">savev</link></methodname>
    <methodparam><parameter role="keyword">filename</parameter></methodparam>
    <methodparam><parameter role="keyword">type</parameter></methodparam>
    <methodparam><parameter role="keyword">option_keys</parameter></methodparam>
    <methodparam><parameter role="keyword">option_values</parameter></methodparam>
    <methodparam><parameter role="keyword">error</parameter></methodparam>
  </methodsynopsis>
END NOT IMPLEMENTED -->

      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--save-to-callback">save_to_callback</link></methodname>
	<methodparam><parameter
		       role="keyword">save_func</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">type</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">options</parameter>
	  <initializer>None</initializer></methodparam>
	<methodparam><parameter
                       role="keyword">user_data</parameter>
	  <initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--add-alpha">add_alpha</link></methodname>
	<methodparam><parameter
		       role="keyword">substitute_color</parameter></methodparam>
	<methodparam><parameter role="keyword">r</parameter></methodparam>
	<methodparam><parameter role="keyword">g</parameter></methodparam>
	<methodparam><parameter role="keyword">b</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--copy-area">copy_area</link></methodname>
	<methodparam><parameter
		       role="keyword">src_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_pixbuf</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--saturate-and-pixelate">saturate_and_pixelate</link></methodname>
	<methodparam><parameter
		       role="keyword">dest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">saturation</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">pixelate</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--scale">scale</link></methodname>
	<methodparam><parameter
		       role="keyword">dest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">offset_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">offset_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">scale_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">scale_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">interp_type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--composite">composite</link></methodname>
	<methodparam><parameter
		       role="keyword">dest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">offset_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">offset_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">scale_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">scale_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">interp_type</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">overall_alpha</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--composite-color">composite_color</link></methodname>
	<methodparam><parameter
		       role="keyword">dest</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">offset_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">offset_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">scale_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">scale_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">interp_type</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">overall_alpha</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">check_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">check_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">check_size</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">color1</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">color2</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--scale-simple">scale_simple</link></methodname>
	<methodparam><parameter
		       role="keyword">dest_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">interp_type</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--composite-color-simple">composite_color_simple</link></methodname>
	<methodparam><parameter
		       role="keyword">dest_width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">dest_height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">interp_type</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">overall_alpha</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">check_size</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">color1</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">color2</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link linkend="method-gdkpixbuf--get-pixels-array">get_pixels_array</link></methodname>
	<methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--subpixbuf">subpixbuf</link></methodname>
	<methodparam><parameter
		       role="keyword">src_x</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">src_y</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--rotate-simple">rotate_simple</link></methodname>
	<methodparam><parameter
		       role="keyword">angle</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gdkpixbuf--flip">flip</link></methodname>
	<methodparam><parameter
		       role="keyword">horizontal</parameter></methodparam>
      </methodsynopsis>
  </classsynopsis>

    <programlisting>
<emphasis role="bold">Functions</emphasis>

<methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-file">gtk.gdk.pixbuf_new_from_file</link></methodname>
	<methodparam><parameter
		       role="keyword">filename</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-file-at-size">gtk.gdk.pixbuf_new_from_file_at_size</link></methodname>
	<methodparam><parameter
		       role="keyword">filename</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-data">gtk.gdk.pixbuf_new_from_data</link></methodname>
	<methodparam><parameter
		       role="keyword">data</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">colorspace</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">has_alpha</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">bits_per_sample</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">rowstride</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-array">gtk.gdk.pixbuf_new_from_array</link></methodname>
	<methodparam><parameter
		       role="keyword">array</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">colorspace</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">bits_per_sample</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-xpm-data">gtk.gdk.pixbuf_new_from_xpm_data</link></methodname>
	<methodparam><parameter
		       role="keyword">data</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-new-from-inline">gtk.gdk.pixbuf_new_from_inline</link></methodname>
	<methodparam><parameter
		       role="keyword">data_length</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">data</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">copy_pixels</parameter></methodparam>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-get-formats">gtk.gdk.pixbuf_get_formats</link></methodname>
      </methodsynopsis><methodsynopsis language="python">
	<methodname><link
linkend="function-gdk--pixbuf-get-file-info">gtk.gdk.pixbuf_get_file_info</link></methodname>
	<methodparam><parameter
		       role="keyword">filename</parameter></methodparam>
      </methodsynopsis></programlisting>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gdkpixbuf">gtk.gdk.Pixbuf</link>
</synopsis>

  </refsect1>

  <refsect1>
    <title>Attributes</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	<?dbhtml cellpadding="5"?>
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"pixel_array"</entry>
	      <entry>Read</entry>
	      <entry>A numeric array containing the pixel values of the
<link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>. The
contents of the numeric array can be changed even though the array is
read-only. However you cannot change the pixel data of pixbufs that are
backed by a const string such as stock icon pixbufs.
<literal>PyGTK</literal> must be compiled with Numeric Python support for
this to work.</entry>
	    </row>

	</tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Properties</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
	<tgroup cols="3">
	  <colspec column="1" colwidth="1in"/>
	  <colspec column="2" colwidth="1in"/>
	  <colspec column="3" colwidth="4in"/>
	  <tbody>

	    <row valign="top">
	      <entry>"bits-per-sample"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>The number of bits per sample. Available in GTK+ 2.4
and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"colorspace"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>The colorspace in which the samples are interpreted.Available in GTK+ 2.4 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"has-alpha"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>If <literal>True</literal>,the pixbuf has an alpha
channel. Available in GTK+ 2.4 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"height"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>The number of rows of the pixbuf. Available in GTK+ 2.4
and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"n-channels"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>The number of samples per pixel. Available in GTK+ 2.4
and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"pixels"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>A pointer to the pixel data of the pixbuf. Available
in GTK+ 2.4 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"rowstride"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>The number of bytes between the start of a row and
the start of the next row. Available in GTK+ 2.4 and above.</entry>
	    </row>

	    <row valign="top">
	      <entry>"width"</entry>
	      <entry>Read-Write-Construct Only</entry>
	      <entry>The number of columns of the pixbuf. Available in GTK+ 2.4
and above.</entry>
	    </row>

	  </tbody>
	</tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
object contains the data that describes an image using client side
resources. By contrast a <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link> uses
server side resources to hold image data. Manipulating the image data in a
<link linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
may involve round trip transfers between a client and a server in X11 while
manipulating image data in a <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
involves only client side operations. Therefore using <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
objects may be more efficient than using <link
linkend="class-gdkpixmap"><classname>gtk.gdk.Pixmap</classname></link>
objects if a lot of image manipulation is necessary.</para>

    <para>In addition to the methods associated with a <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
object there are a number of functions that can be used to create <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
objects from file and inline data.</para>

  </refsect1>

  <refsect1 id="constructor-gdkpixbuf">
    <title>Constructor</title>

    <programlisting><constructorsynopsis language="python">
	<methodname>gtk.gdk.Pixbuf</methodname>
	<methodparam><parameter
		       role="keyword">colorspace</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">has_alpha</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">bits_per_sample</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
      </constructorsynopsis></programlisting>
    <variablelist>
      <varlistentry>
	<term><parameter role="keyword">colorspace</parameter>&nbsp;:</term>
	<listitem><simpara>the color space for the image - currently only
<literal>gtk.gdk.COLORSPACE_RGB</literal>.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">has_alpha</parameter>&nbsp;:</term>
	<listitem><simpara>if <literal>True</literal> the image will have
transparency information.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter
role="keyword">bits_per_sample</parameter>&nbsp;:</term>
	<listitem><simpara>the number of bits per color sample - currently
must be 8.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">width</parameter>&nbsp;:</term>
	<listitem><simpara>the width of image in
pixels.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><parameter role="keyword">height</parameter>&nbsp;:</term>
	<listitem><simpara>the height of image in
pixels.</simpara></listitem>
      </varlistentry>
      <varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	<listitem><simpara>a newly-created <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>.</simpara></listitem>
      </varlistentry>
    </variablelist>

    <para>Creates a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
structure and allocates a buffer for it.  The buffer has an optimal
rowstride.  Note that the buffer is not cleared; you will have to fill it
completely yourself. The size of the image is specified by
<parameter>width</parameter> and <parameter>height</parameter>.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gdkpixbuf--apply-embedded-orientation">
      <title>gtk.gdk.Pixbuf.apply_embedded_orientation</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>apply_embedded_orientation</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>A newly-created pixbuf.</simpara></listitem>
	</varlistentry>
      </variablelist>
      
      <note>
        <para>This method was available in PyGTK 2.16 and above.</para>
      </note>

      <para>
        The <methodname>apply_embedded_orientation</methodname>() method takes an existing
        pixbuf and checks for the presence of an associated "orientation" option,
        which may be provided by the jpeg loader (which reads the exif orientation tag)
        or the tiff loader (which reads the tiff orientation tag, and compensates it for
        the partial transforms performed by libtiff). If an orientation option/tag is present,
        the appropriate transform will be performed so that the pixbuf is oriented correctly.
      </para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--render-to-drawable">
      <title>gtk.gdk.Pixbuf.render_to_drawable</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>render_to_drawable</methodname>
	  <methodparam><parameter
			 role="keyword">drawable</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">gc</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dither</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">x_dither</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">y_dither</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">drawable</parameter>&nbsp;:</term>
	  <listitem><simpara>the destination <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> used for
rendering.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within
<parameter>drawable</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within
<parameter>drawable</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of region to render, in pixels, or -1
to use pixbuf width</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of region to render, in pixels, or
-1 to use pixbuf height</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dither</parameter>&nbsp;:</term>
	  <listitem><simpara>the dithering mode.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x_dither</parameter>&nbsp;:</term>
	  <listitem><simpara>the X offset for
dithering.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y_dither</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y offset for
dithering.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <warning>
        <para>This method is deprecated in PyGTK 2.2 and above. Use the
<link
linkend="method-gdkdrawable--draw-pixbuf"><methodname>gtk.gdk.Drawable.draw_pixbuf</methodname>()</link>
method instead.</para>
      </warning>

      <para>The <methodname>render_to_drawable</methodname>() method renders
a rectangular portion of the pixbuf to a <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>
specified by <parameter>drawable</parameter> while using the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> specified by
<parameter>gc</parameter>. This is done using GdkRGB, so the specified
drawable must have the GdkRGB visual and colormap. Note that this method
will ignore the opacity information for images with an alpha channel; the
<link linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> must
already have the clipping mask set if you want transparent regions to show
through.</para>

      <para>The dither offset is important when re-rendering partial regions
of an image to a rendered version of the full image, or when the offsets to
a base position change, as in scrolling. The dither matrix has to be shifted
for consistent visual results. If you do not have any of these cases, the
dither offsets can be both zero.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--render-to-drawable-alpha">
      <title>gtk.gdk.Pixbuf.render_to_drawable_alpha</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>render_to_drawable_alpha</methodname>
	  <methodparam><parameter
			 role="keyword">drawable</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">alpha_mode</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">alpha_threshold</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dither</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">x_dither</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">y_dither</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">drawable</parameter>&nbsp;:</term>
	  <listitem><simpara>the destination <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">gc</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkgc"><classname>gtk.gdk.GC</classname></link> used for
rendering.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within
<parameter>drawable</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within
<parameter>drawable</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of region to render, in pixels, or -1
to use pixbuf width</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of region to render, in pixels, or
-1 to use pixbuf height</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">alpha_mode</parameter>&nbsp;:</term>
	  <listitem><simpara>Ignored. Present for backward
compatibility.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">alpha_threshold</parameter>&nbsp;:</term>
	  <listitem><simpara>Ignored. Present for backward
compatibility</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dither</parameter>&nbsp;:</term>
	  <listitem><simpara>the dithering mode.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">x_dither</parameter>&nbsp;:</term>
	  <listitem><simpara>the X offset for
dithering.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">y_dither</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y offset for
dithering.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <warning>
        <para>This method is deprecated in PyGTK 2.2 and above. Use the
<link
linkend="method-gdkdrawable--draw-pixbuf"><methodname>gtk.gdk.Drawable.draw_pixbuf</methodname>()</link>
method instead.</para>
      </warning>

      <para>The <methodname>render_to_drawable_alpha</methodname>() method
renders a rectangular portion of the pixbuf to a <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>
specified by <parameter>drawable</parameter>.
<parameter>drawable</parameter> must have a colormap. All windows have a
colormap; however, pixmaps only have colormap by default if they were
created with a window argument.specifying a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link>.
Otherwise a colormap must be set on them with the <link
linkend="method-gdkdrawable--set-colormap"><methodname>gtk.gdk.Drawable.set_colormap</methodname>()</link> 
method. On older X servers, rendering pixbufs with an alpha channel involves
round trips to the X server, and may be somewhat slow.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--render-pixmap-and-mask">
      <title>gtk.gdk.Pixbuf.render_pixmap_and_mask</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>render_pixmap_and_mask</methodname>
	  <methodparam><parameter
			 role="keyword">alpha_threshold</parameter><initializer>127</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">alpha_threshold</parameter>&nbsp;:</term>
	  <listitem><simpara>the threshold value for opacity
values.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a tuple containing the created pixmap and
mask.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>render_to_pixmap_and_mask</methodname>() method
returns a tuple containing a pixmap and a mask bitmap that the pixbuf and
its corresponding thresholded alpha mask are rendered to. This is merely a
convenience method; applications that need to render pixbufs with dither
offsets or to specific drawables should use the <link
linkend="method-gdkpixbuf--render-to-drawable-alpha"><methodname>render_to_drawable_alpha</methodname>()</link> 
or <link
linkend="method-gdkpixbuf--render-to-drawable"><methodname>render_to_drawable</methodname>()</link> 
methods. If the pixbuf does not have an alpha channel, then the mask
returned will be None.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-from-drawable">
      <title>gtk.gdk.Pixbuf.get_from_drawable</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_from_drawable</methodname>
	  <methodparam><parameter
			 role="keyword">src</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">cmap</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">src</parameter>&nbsp;:</term>
	  <listitem><simpara>the source <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">cmap</parameter>&nbsp;:</term>
	  <listitem><simpara>a colormap if <parameter>src</parameter>
doesn't have one set.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within
<parameter>drawable</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within
<parameter>drawable</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate in the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate in the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width in pixels of the region to
get.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height in pixels of the region to
get.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the pixbuf or <literal>None</literal> on
error</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_from_drawable</methodname>() method
transfers image data from the <link
linkend="class-gdkdrawable"><classname>gtk.gdk.Drawable</classname></link>
specified by <parameter>src</parameter> and converts it to an RGB(A)
representation inside a <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>. In
other words, copies image data from a server-side drawable to a client-side
RGB(A) buffer. This allows you to efficiently read individual pixels on the
client side. If <parameter>src</parameter> has no colormap (the <link
linkend="method-gdkdrawable--get-colormap"><methodname>gtk.gdk.Drawable.get_colormap</methodname>()</link> 
method returns <literal>None</literal>), then a suitable colormap must be
specified as <parameter>cmap</parameter>. Typically a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> or a
pixmap created by passing a <link
linkend="class-gdkwindow"><classname>gtk.gdk.Window</classname></link> to
<function>gtk.gdk.Pixmap()</function> will already have a colormap
associated with it. If <parameter>src</parameter> has a colormap, the
<parameter>cmap</parameter> argument will be ignored. If
<parameter>src</parameter> is a bitmap (1 bit per pixel pixmap), then a
colormap is not required; pixels with a value of 1 are assumed to be white,
and pixels with a value of 0 are assumed to be black. For taking
screenshots, the <link
linkend="function-gdk--colormap-get-system"><methodname>gtk.gdk.colormap_get_system</methodname>()</link> 
function returns the correct colormap to use.</para>

      <para>If <parameter>src</parameter> is a pixmap, then the requested
source rectangle must be completely contained within the pixmap, otherwise
the function will return <literal>None</literal>. For pixmaps only (not for
windows) passing -1 for <parameter>width</parameter> or
<parameter>height</parameter> is allowed to mean the full width or height of
the pixmap. If <parameter>src</parameter> is a window, and the window
is off the screen, then there is no image data in the obscured/offscreen
regions to be placed in the pixbuf. The contents of portions of the pixbuf
corresponding to the offscreen region are undefined.</para>

      <para>If the window you're obtaining data from is partially obscured
by other windows, then the contents of the pixbuf areas corresponding to the
obscured regions are undefined. If the target drawable is not mapped
(typically because it's iconified/minimized or not on the current
workspace), <literal>None</literal> will be returned. If memory can't be
allocated for the return value, <literal>None</literal> will be returned
instead. (In short, there are several ways this method can fail, and if it
fails it returns <literal>None</literal>; so check the return value.)</para>

      <para>This method calls the <link
linkend="method-gdkdrawable--get-image"><methodname>gtk.gdk.Drawable.get_image</methodname>()</link> 
method internally and converts the resulting image to a <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>, so
the documentation for the <link
linkend="method-gdkdrawable--get-image"><methodname>gtk.gdk.Drawable.get_image</methodname>()</link> 
method may also be helpful.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-from-image">
      <title>gtk.gdk.Pixbuf.get_from_image</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_from_image</methodname>
	  <methodparam><parameter
			 role="keyword">src</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">cmap</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">src</parameter>&nbsp;:</term>
	  <listitem><simpara>the source <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">cmap</parameter>&nbsp;:</term>
	  <listitem><simpara>a colormap if <parameter>src</parameter>
doesn't have one set or <literal>None</literal>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within
<parameter>src</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within
<parameter>src</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate in the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate in the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width in pixels of the region to
get.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height in pixels of the region to
get.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the pixbuf or <literal>None</literal> on
error</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_from_image</methodname>() method is the same
as the <link
linkend="method-gdkpixbuf--get-from-drawable"><methodname>get_from_drawable</methodname>()</link> 
method but gets the pixbuf from the <link
linkend="class-gdkimage"><classname>gtk.gdk.Image</classname></link>
specified by <parameter>src</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-colorspace">
      <title>gtk.gdk.Pixbuf.get_colorspace</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_colorspace</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the color space.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_colorspace</methodname>() method returns the
color space of the pixbuf.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-n-channels">
      <title>gtk.gdk.Pixbuf.get_n_channels</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_n_channels</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the number of channels.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_n_channels</methodname>() method returns the
number of channels of a pixbuf.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-has-alpha">
      <title>gtk.gdk.Pixbuf.get_has_alpha</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_has_alpha</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the pixbuf has an
alpha channel.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_has_alpha</methodname>() method returns
<literal>True</literal> if the pixbuf has an alpha channel (opacity
information).</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-bits-per-sample">
      <title>gtk.gdk.Pixbuf.get_bits_per_sample</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_bits_per_sample</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the number of bits per color
sample.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_bits_per_sample</methodname>() method returns
the number of bits per color sample in a pixbuf.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-pixels">
      <title>gtk.gdk.Pixbuf.get_pixels</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_pixels</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a string containing the pixel data of the
pixbuf</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_pixels</methodname>() method returns a sting
containing the pixel data of the pixbuf.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-width">
      <title>gtk.gdk.Pixbuf.get_width</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_width</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the width in pixels.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_width</methodname>() method returns the
width of the pixbuf.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-height">
      <title>gtk.gdk.Pixbuf.get_height</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_height</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the height in pixels.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_height</methodname>() method returns the
height of the pixbuf.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-rowstride">
      <title>gtk.gdk.Pixbuf.get_rowstride</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_rowstride</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the number of bytes between
rows.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_rowstride</methodname>() method returns the
rowstride of a pixbuf, which is the number of bytes between rows.</para>

    </refsect2>

  <refsect2 id="method-gdkpixbuf--get-option">
      <title>gtk.gdk.Pixbuf.get_option</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_option</methodname>
	  <methodparam><parameter
			 role="keyword">key</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">key</parameter>&nbsp;:</term>
	  <listitem><simpara>a key string</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the value associated with
<parameter>key</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>get_option</methodname>() method looks up
<parameter>key</parameter> in the list of options that may have been
attached to the pixbuf when it was loaded.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--copy">
      <title>gtk.gdk.Pixbuf.copy</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy</methodname>
	  <methodparam></methodparam>  </methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>A newly-created pixbuf or
<literal>None</literal> if not enough memory could be
allocated.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy</methodname>() method returns a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> with
a copy of the data in the pixbuf.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--fill">
      <title>gtk.gdk.Pixbuf.fill</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>fill</methodname>
	  <methodparam><parameter
			 role="keyword">pixel</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">pixel</parameter>&nbsp;:</term>
	  <listitem><simpara>the RGBA pixel to clear to (0xffffffff is
opaque white, 0x00000000 transparent black)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>fill</methodname>() method clears the pixbuf to
the RGBA value specified by <parameter>pixel</parameter>, converting the
RGBA value into the pixbuf's pixel format. The alpha will be ignored if the
pixbuf doesn't have an alpha channel.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--save">
      <title>gtk.gdk.Pixbuf.save</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>save</methodname>
	  <methodparam><parameter
			 role="keyword">filename</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">type</parameter></methodparam>
	  <methodparam><parameter role="keyword">options</parameter>
	    <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
	  <listitem><simpara>the name of file to save.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>the name of the file
format.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">options</parameter>&nbsp;:</term>
	  <listitem><simpara>a Python dict containing key-value string pairs
or <literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>save</methodname>() method saves the pixbuf to a
file in the format specified by <parameter>type</parameter>, which may be
"jpeg" or "png". If <parameter>options</parameter> is not
<literal>None</literal> it should be a Python dict containing key-value
string pairs that modify the save parameters. For example:</para>

<informalexample><programlisting>
  pixbuf.save(filename, "jpeg", {"quality":"100"})
</programlisting></informalexample>

      <para>Currently only a few parameters exist. JPEG images can be saved
with a "quality" parameter; its value should be in the range [0,100]. Text
chunks can be attached to PNG images by specifying parameters of the form
"tEXt::key", where key is an ASCII string of length 1-79. Note however that
PNG text chunks are stored in ISO-8859-1 encoding, so you can only set texts
that can be represented in this encoding. The values are UTF-8 encoded
strings. ICO images can be saved in depth 16, 24, or 32, by using the
"depth" parameter. When the ICO saver is given "x_hot" and "y_hot"
parameters, it produces a CUR instead of an ICO.</para>

      <para>This method raises the GError exception if an error occurs
during the save operation.</para>

    </refsect2>

<!-- NOT IMPLEMENTED
    <refsect2 id="method-gdkpixbuf- -savev">
    <title>gtk.gdk.Pixbuf.savev</title>

<programlisting><methodsynopsis language="python">
    <methodname>savev</methodname>
    <methodparam><parameter role="keyword">filename</parameter></methodparam>
    <methodparam><parameter role="keyword">type</parameter></methodparam>
    <methodparam><parameter role="keyword">option_keys</parameter></methodparam>
    <methodparam><parameter role="keyword">option_values</parameter></methodparam>
    <methodparam><parameter role="keyword">error</parameter></methodparam>
  </methodsynopsis></programlisting>
  <variablelist>
    <varlistentry>
      <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
      <listitem><simpara>name of file to save.</simpara></listitem>
    </varlistentry>
    <varlistentry>
      <term><parameter role="keyword">type</parameter>&nbsp;:</term>
      <listitem><simpara>name of file format.</simpara></listitem>
    </varlistentry>
    <varlistentry>
      <term><parameter role="keyword">option_keys</parameter>&nbsp;:</term>
      <listitem><simpara>name of options to set, <literal>NULL</literal>-terminated</simpara></listitem>
    </varlistentry>
    <varlistentry>
      <term><parameter role="keyword">option_values</parameter>&nbsp;:</term>
      <listitem><simpara>values for named options</simpara></listitem>
    </varlistentry>
    <varlistentry>
      <term><parameter role="keyword">error</parameter>&nbsp;:</term>
      <listitem><simpara>return location for error, or <literal>NULL</literal></simpara></listitem>
    </varlistentry>
    <varlistentry>
      <term><emphasis>Returns</emphasis>&nbsp;:</term>
      <listitem><simpara>whether an error was set</simpara></listitem>
    </varlistentry>
  </variablelist>
<para>
Saves pixbuf to a file in <parameter>type</parameter>, which is currently "jpeg" or "png".
If <parameter>error</parameter> is set, <literal>False</literal> will be returned. See <link linkend="method-gdkpixbuf- -save"><function>gtk.gdk.Pixbuf.save()</function></link> for more
details.
</para>  </refsect2>
END NOT IMPLEMENTED -->

    <refsect2 id="method-gdkpixbuf--save-to-callback">
      <title>gtk.gdk.Pixbuf.save_to_callback</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>save_to_callback</methodname>
	  <methodparam><parameter
			 role="keyword">save_func</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">type</parameter></methodparam>
	  <methodparam><parameter
                         role="keyword">options</parameter>
            <initializer>None</initializer></methodparam>
	  <methodparam><parameter
                         role="keyword">user_data</parameter>
            <initializer>None</initializer></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">save_func</parameter>&nbsp;:</term>
	  <listitem><simpara> a function that is called to save each block
of data that the save routine generates.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">type</parameter>&nbsp;:</term>
	  <listitem><simpara>the name of the file
format.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">options</parameter>&nbsp;:</term>
	  <listitem><simpara>a Python dict containing key-value string pairs
or <literal>None</literal></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">user_data</parameter>&nbsp;:</term>
	  <listitem><simpara>user-specified data passed to
<literal>save_func</literal> or <literal>None</literal></simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
        <para>This method was available in PyGTK 2.8 and above.</para>
      </note>

      <para>The <methodname>save_to_callback</methodname>() method saves the
pixbuf in the format specified by <parameter>type</parameter> by feeding the
pixbuf data to the callback function specified by
<parameter>save_func</parameter>. <parameter>type</parameter> may be "jpeg",
"png" or "ico" or other installed formats. If <parameter>options</parameter>
is not <literal>None</literal> it should be a Python dict containing
key-value string pairs that modify the save parameters. For example:</para>

<informalexample><programlisting>
        pixbuf.save_to_callback(func, "jpeg", {"quality":"100"})
</programlisting></informalexample>

      <para>See the <link
linkend="method-gdkpixbuf--save"><methodname>save</methodname>()</link>
method for more information on formats. If <parameter>user_data</parameter>
is not None it is passed to <parameter>save_func</parameter> with each
invocation.</para>

      <para>This method raises a GError exception or exceptions raised by
<parameter>save_func</parameter> if an error occurs during the save
operation.</para>

      <para>The signature of <parameter>save_func</parameter> is:</para>

      <programlisting>
def pixbuf_save_func(buf, data=None):
</programlisting>

      <para>where <parameter>buf</parameter> is a Python string containing
the pixbuf data and <parameter>data</parameter> is
<parameter>user_data</parameter>. <parameter>pixbuf_save_func</parameter>
returns <literal>True</literal> if successful or <literal>False</literal> on
failure.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--add-alpha">
      <title>gtk.gdk.Pixbuf.add_alpha</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>add_alpha</methodname>
	  <methodparam><parameter
			 role="keyword">substitute_color</parameter></methodparam>
	  <methodparam><parameter role="keyword">r</parameter></methodparam>
	  <methodparam><parameter role="keyword">g</parameter></methodparam>
	  <methodparam><parameter role="keyword">b</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">substitute_color</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>False</literal>, the
(<parameter>r</parameter>, <parameter>g</parameter>,
<parameter>b</parameter>) arguments will be ignored.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">r</parameter>&nbsp;:</term>
	  <listitem><simpara>the red value to
substitute.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">g</parameter>&nbsp;:</term>
	  <listitem><simpara>the green value to
substitute.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">b</parameter>&nbsp;:</term>
	  <listitem><simpara>the blue value to
substitute.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>add_alpha</methodname>() method returns a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
created from the pixbuf with an alpha channel added. If the pixbuf already
had an alpha channel, the channel values are copied; otherwise, the alpha
channel is initialized to 255 (full opacity).</para>

      <para>If <parameter>substitute_color</parameter> is
<literal>True</literal>, then the color specified by
(<parameter>r</parameter>, <parameter>g</parameter>,
<parameter>b</parameter>) will be assigned zero opacity. That is, if you
pass (255, 255, 255) for the substitute color, all white pixels will become
fully transparent.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--copy-area">
      <title>gtk.gdk.Pixbuf.copy_area</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>copy_area</methodname>
	  <methodparam><parameter
			 role="keyword">src_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">src_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_pixbuf</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">src_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">src_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within the
pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the area to
copy.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the area to
copy.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_pixbuf</parameter>&nbsp;:</term>
	  <listitem><simpara>the destination pixbuf.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate within
<parameter>dest_pixbuf</parameter>.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate within
<parameter>dest_pixbuf</parameter>.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>copy_area</methodname>() method copies a
rectangular area from the pixbuf to the destination <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
specified by <parameter>dest_pixbuf</parameter>. Conversion of pixbuf
formats is done automatically.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--saturate-and-pixelate">
      <title>gtk.gdk.Pixbuf.saturate_and_pixelate</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>saturate_and_pixelate</methodname>
	  <methodparam><parameter
			 role="keyword">dest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">saturation</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">pixelate</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">dest</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> to
write the modified version of the pixbuf</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">saturation</parameter>&nbsp;:</term>
	  <listitem><simpara>the saturation factor</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">pixelate</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> pixelate
<parameter>dest</parameter></simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>saturate_and_pixelate</methodname>() method
modifies the saturation and optionally pixelates the pixbuf, placing the
result in <parameter>dest</parameter>. the pixbuf and
<parameter>dest</parameter> may be the same <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> with
no ill effects.  If <parameter>saturation</parameter> is 1.0 then saturation
is not changed. If it's less than 1.0, saturation is reduced (the image is
darkened); if greater than 1.0, saturation is increased (the image is
brightened). If <parameter>pixelate</parameter> is <literal>True</literal>,
then pixels are faded in a checkerboard pattern to create a pixelated image.
The pixbuf and <parameter>dest</parameter> must have the same image format,
size, and rowstride.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--scale">
      <title>gtk.gdk.Pixbuf.scale</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>scale</methodname>
	  <methodparam><parameter
			 role="keyword">dest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">offset_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">offset_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">scale_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">scale_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">interp_type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">dest</parameter>&nbsp;:</term>
	  <listitem><simpara>the <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> the
scaling is rendered to.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate for the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y coordinate for the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">offset_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the offset in the X direction (currently
rounded to an integer)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">offset_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the offset in the Y direction (currently
rounded to an integer)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">scale_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the scale factor in the X
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">scale_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the scale factor in the Y
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">interp_type</parameter>&nbsp;:</term>
	  <listitem><simpara>the interpolation type for the
transformation.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>scale</methodname>() method creates a
transformation of the pixbuf's image by scaling by
<parameter>scale_x</parameter> and <parameter>scale_y</parameter> and
translating by <parameter>offset_x</parameter> and
<parameter>offset_y</parameter> it, then rendering the rectangle
(<parameter>dest_x</parameter>, <parameter>dest_y</parameter>,
<parameter>dest_width</parameter>, <parameter>dest_height</parameter>) of
the resulting image onto the destination image specified by
<parameter>dest</parameter> replacing the previous contents. The value of
<parameter>interp_type</parameter> must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_NEAREST</literal></term>
	  <listitem>
	    <simpara>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_TILES</literal></term>
	  <listitem>
	    <simpara>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_BILINEAR</literal></term>
	  <listitem>
	    <simpara>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_HYPER</literal></term>
	  <listitem>
	    <simpara>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>Try the <link
linkend="method-gdkpixbuf--scale-simple"><methodname>scale_simple</methodname>()</link> 
method as an alternative with a simpler interface.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--composite">
      <title>gtk.gdk.Pixbuf.composite</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>composite</methodname>
	  <methodparam><parameter
			 role="keyword">dest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">offset_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">offset_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">scale_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">scale_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">interp_type</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">overall_alpha</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">dest</parameter>&nbsp;:</term>
	  <listitem><simpara>the output <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate for the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the top coordinate for the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">offset_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the offset in the X direction (currently
rounded to an integer)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">offset_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the offset in the Y direction (currently
rounded to an integer)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">scale_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the scale factor in the X
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">scale_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the scale factor in the Y
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">interp_type</parameter>&nbsp;:</term>
	  <listitem><simpara>the interpolation type for the
transformation.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">overall_alpha</parameter>&nbsp;:</term>
	  <listitem><simpara>overall alpha for source image
(0..255)</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>composite</methodname>() method creates a
transformation of the pixbuf's image by scaling by
<parameter>scale_x</parameter> and <parameter>scale_y</parameter> and
translating by <parameter>offset_x</parameter> and
<parameter>offset_y</parameter>, then compositing the rectangle
(<parameter>dest_x</parameter>, <parameter>dest_y</parameter>,
<parameter>dest_width</parameter>, <parameter>dest_height</parameter>) of
the resulting image onto the destination image. The value of
<parameter>interp_type</parameter> must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_NEAREST</literal></term>
	  <listitem>
	    <simpara>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_TILES</literal></term>
	  <listitem>
	    <simpara>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_BILINEAR</literal></term>
	  <listitem>
	    <simpara>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_HYPER</literal></term>
	  <listitem>
	    <simpara>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para></para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--composite-color">
      <title>gtk.gdk.Pixbuf.composite_color</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>composite_color</methodname>
	  <methodparam><parameter
			 role="keyword">dest</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">offset_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">offset_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">scale_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">scale_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">interp_type</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">overall_alpha</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">check_x</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">check_y</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">check_size</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">color1</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">color2</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">dest</parameter>&nbsp;:</term>
	  <listitem><simpara>the output <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X coordinate for the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">dest_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the top coordinate for the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of the rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of the
rectangle</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">offset_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the offset in the X direction (currently
rounded to an integer)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">offset_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the offset in the Y direction (currently
rounded to an integer)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">scale_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the scale factor in the X
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">scale_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the scale factor in the Y
direction</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">interp_type</parameter>&nbsp;:</term>
	  <listitem><simpara>the interpolation type for the
transformation.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">overall_alpha</parameter>&nbsp;:</term>
	  <listitem><simpara>overall alpha for source image
(0..255)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">check_x</parameter>&nbsp;:</term>
	  <listitem><simpara>the X offset for the checkboard (origin of
checkboard is at -<parameter>check_x</parameter>,
-<parameter>check_y</parameter>)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">check_y</parameter>&nbsp;:</term>
	  <listitem><simpara>the Y offset for the
checkboard</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">check_size</parameter>&nbsp;:</term>
	  <listitem><simpara>the size of checks in the checkboard (must be a
power of two)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">color1</parameter>&nbsp;:</term>
	  <listitem><simpara>the color of check at upper
left</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">color2</parameter>&nbsp;:</term>
	  <listitem><simpara>the color of the other
check</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>composite_color</methodname>() method creates a
transformation of the source image <parameter>src</parameter> by scaling by
<parameter>scale_x</parameter> and <parameter>scale_y</parameter> and
translating by <parameter>offset_x</parameter> and
<parameter>offset_y</parameter>, then compositing the rectangle
(<parameter>dest_x</parameter> ,<parameter>dest_y</parameter>,
<parameter>dest_width</parameter>, <parameter>dest_height</parameter>) of
the resulting image with a checkboard of the colors
<parameter>color1</parameter> and <parameter>color2</parameter> and renders
it onto the destination image. The value of
<parameter>interp_type</parameter> must be one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_NEAREST</literal></term>
	  <listitem>
	    <simpara>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_TILES</literal></term>
	  <listitem>
	    <simpara>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_BILINEAR</literal></term>
	  <listitem>
	    <simpara>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_HYPER</literal></term>
	  <listitem>
	    <simpara>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para>See the <link
linkend="method-gdkpixbuf--composite-color-simple"><methodname>composite_color_simple</methodname>()</link> 
method for a simpler variant of this method suitable for most tasks.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--scale-simple">
      <title>gtk.gdk.Pixbuf.scale_simple</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>scale_simple</methodname>
	  <methodparam><parameter
			 role="keyword">dest_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">interp_type</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">dest_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of destination
image</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of destination
image</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">interp_type</parameter>&nbsp;:</term>
	  <listitem><simpara>the interpolation type for the
transformation.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>, or
<literal>None</literal> if not enough memory could be allocated for
it.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>scale_simple</methodname>() method returns a new
<link linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
containing a copy of the pixbuf scaled to <parameter>dest_width</parameter>
x <parameter>dest_height</parameter>. The pixbuf is unaffected by the
scaling operation. The value of <parameter>interp_type</parameter> must be
one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_NEAREST</literal></term>
	  <listitem>
	    <simpara>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_TILES</literal></term>
	  <listitem>
	    <simpara>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_BILINEAR</literal></term>
	  <listitem>
	    <simpara>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_HYPER</literal></term>
	  <listitem>
	    <simpara>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

      <para><parameter>interp_type</parameter> should be
<literal>gtk.gdk.INTERP_NEAREST</literal> if you want maximum speed (but
when scaling down <literal>gtk.gdk.INTERP_NEAREST</literal> is usually
unusably ugly).  The default <parameter>interp_type</parameter> should be
<literal>GDK_INTERP_BILINEAR</literal> which offers reasonable quality and
speed.</para>

      <para>You can scale a sub-portion of <parameter>src</parameter> by
creating a sub-pixbuf pointing into <parameter>src</parameter>; see the
<link
linkend="method-gdkpixbuf--subpixbuf"><methodname>subpixbuf</methodname>()</link>
method for more information.</para>

      <para>For more complicated scaling/compositing see the <link
linkend="method-gdkpixbuf--scale"><methodname>scale</methodname>()</link>
and <link
linkend="method-gdkpixbuf--composite"><methodname>composite</methodname>()</link> 
methods.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--composite-color-simple">
      <title>gtk.gdk.Pixbuf.composite_color_simple</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>composite_color_simple</methodname>
	  <methodparam><parameter
			 role="keyword">dest_width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">dest_height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">interp_type</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">overall_alpha</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">check_size</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">color1</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">color2</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter
role="keyword">dest_width</parameter>&nbsp;:</term>
	  <listitem><simpara>the width of destination
image</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">dest_height</parameter>&nbsp;:</term>
	  <listitem><simpara>the height of destination
image</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">interp_type</parameter>&nbsp;:</term>
	  <listitem><simpara>the interpolation type for the
transformation.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">overall_alpha</parameter>&nbsp;:</term>
	  <listitem><simpara>overall alpha for source image
(0..255)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">check_size</parameter>&nbsp;:</term>
	  <listitem><simpara>the size of checks in the checkboard (must be a
power of two)</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">color1</parameter>&nbsp;:</term>
	  <listitem><simpara>the color of check at upper
left</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter role="keyword">color2</parameter>&nbsp;:</term>
	  <listitem><simpara>the color of the other
check</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>the new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>, or
<literal>NULL</literal> if not enough memory could be allocated for
it.</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>composite_color_simple</methodname>() method
returns a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> by
scaling the pixbuf to <parameter>dest_width</parameter> x
<parameter>dest_height</parameter> and compositing the result with a
checkboard of colors <parameter>color1</parameter> and
<parameter>color2</parameter>. The value of <parameter>interp_type</parameter> must be
one of:</para>

      <variablelist>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_NEAREST</literal></term>
	  <listitem>
	    <simpara>Nearest neighbor sampling; this is the fastest and
lowest quality mode. Quality is normally unacceptable when scaling down, but
may be OK when scaling up.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_TILES</literal></term>
	  <listitem>
	    <simpara>This is an accurate simulation of the PostScript image
operator without any interpolation enabled. Each pixel is rendered as a tiny
parallelogram of solid color, the edges of which are implemented with
antialiasing. It resembles nearest neighbor for enlargement, and bilinear
for reduction.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_BILINEAR</literal></term>
	  <listitem>
	    <simpara>Best quality/speed balance; use this mode by default.
Bilinear interpolation. For enlargement, it is equivalent to point-sampling
the ideal bilinear-interpolated image. For reduction, it is equivalent to
laying down small tiles and integrating over the coverage area.</simpara>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term><literal>gtk.gdk.INTERP_HYPER</literal></term>
	  <listitem>
	    <simpara>This is the slowest and highest quality reconstruction
function. It is derived from the hyperbolic filters in Wolberg's "Digital
Image Warping", and is formally defined as the hyperbolic-filter sampling
the ideal hyperbolic-filter interpolated image (the filter is designed to be
idempotent for 1:1 pixel mapping).</simpara>
	  </listitem>
	</varlistentry>
      </variablelist>

    <para>See the <link
linkend="method-gdkpixbuf--composite-color"><methodname>composite_color</methodname>()</link> 
method for a more powerful but complicated interface.</para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--get-pixels-array">
      <title>gtk.gdk.Pixbuf.get_pixels_array</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>get_pixels_array</methodname>
	  <methodparam></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a Numeric Python array containing the pixel
	  data of the pixbuf</simpara></listitem>
	</varlistentry>
      </variablelist>

      <note>
	<para>This method is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <methodname>get_pixels_array</methodname>() method returns a
Numeric Python array containing the pixel data of the pixbuf.</para>

      <note>
	<para>PyGTK must be compiled with Numeric Python support for this
method to be available.</para>
      </note>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--subpixbuf">
      <title>gtk.gdk.Pixbuf.subpixbuf</title>
      
      <programlisting><methodsynopsis language="python">
          <methodname>subpixbuf</methodname>
          <methodparam><parameter role="keyword">src_x</parameter></methodparam>
          <methodparam><parameter role="keyword">src_y</parameter></methodparam>
          <methodparam><parameter role="keyword">width</parameter></methodparam>
          <methodparam><parameter role="keyword">height</parameter></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">src_x</parameter>&nbsp;:</term>
          <listitem><simpara>X coord in the pixbuf</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">src_y</parameter>&nbsp;:</term>
          <listitem><simpara>Y coord in the pixbuf</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">width</parameter>&nbsp;:</term>
          <listitem><simpara>width of region in the pixbuf</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">height</parameter>&nbsp;:</term>
          <listitem><simpara>height of region in the pixbuf</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a new <link
          linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <methodname>subpixbuf</methodname>() method creates a new
<link linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
that represents a sub-region of the pixbuf. The new pixbuf shares its pixels
with the original pixbuf, so writing to one affects both.</para>

    </refsect2>
    
    <refsect2 id="method-gdkpixbuf--rotate-simple">
      <title>gtk.gdk.Pixbuf.rotate_simple</title>
      
      <programlisting><methodsynopsis language="python">
          <methodname>rotate_simple</methodname>
          <methodparam><parameter role="keyword">angle</parameter></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">angle</parameter>&nbsp;:</term>
          <listitem><simpara>the rotation angle</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a new <link
          linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>rotate_simple</methodname>() method creates a
      new <link
      linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
      by rotating the given pixbuf by a multiple of 90 degrees as specified
      by <parameter>angle</parameter> which is one of the <xref
      linkend="gdk-pixbuf-rotation-constants"
      endterm="gdk-pixbuf-rotation-constants-title"></xref></para>

    </refsect2>

    <refsect2 id="method-gdkpixbuf--flip">
      <title>gtk.gdk.Pixbuf.flip</title>

      <programlisting><methodsynopsis language="python">
          <methodname>flip</methodname>
          <methodparam><parameter role="keyword">horizontal</parameter></methodparam>
        </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">flip</parameter>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> to flip horizontally, <literal>False</literal> to
            flip vertically</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a new <link
          linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.6 and above.</para>
      </note>

      <para>The <methodname>flip</methodname>() method creates a
      new <link
      linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
      by flipping the given pixbuf horizontally or vertically, as specified
      by <parameter>horizontal</parameter>.</para>
    </refsect2>

  </refsect1>

  <refsect1>
    <title>Functions</title>

    <refsect2 id="function-gdk--pixbuf-new-from-file">
      <title>gtk.gdk.pixbuf_new_from_file</title>

      <programlisting><methodsynopsis language="python">
          <methodname>gtk.gdk.pixbuf_new_from_file</methodname>
          <methodparam><parameter
	    role="keyword">filename</parameter></methodparam>
        </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
          <listitem><simpara>the name of the file containing the image to
load</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pixbuf_new_from_file</function>() function
returns a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
containing an image loaded from the file specified by
<parameter>filename</parameter>. The image file format is detected
automatically. The application will block until the image is done loading.
This method can be used by applications in which blocking is acceptable
while an image is being loaded (small images in general). Applications that
need progressive loading should use <link
linkend="class-gdkpixbufloader"><classname>gtk.gdk.PixbufLoader</classname></link> 
instead.</para>

      <para>This function raises the GError exception if an error occurs
during the loading of the pixbuf.</para>

    </refsect2>

    <refsect2 id="function-gdk--pixbuf-new-from-file-at-size">
      <title>gtk.gdk.pixbuf_new_from_file_at_size</title>

      <programlisting><methodsynopsis language="python">
          <methodname>gtk.gdk.pixbuf_new_from_file_at_size</methodname>
          <methodparam><parameter
	    role="keyword">filename</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">width</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">height</parameter></methodparam>
        </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
          <listitem><simpara>the name of the file containing the image to
load</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">width</parameter>&nbsp;:</term>
          <listitem><simpara> The width the image should
          have</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">height</parameter>&nbsp;:</term>
          <listitem><simpara> The height the image should
          have</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
	<para>This function is available in PyGTK 2.4 and above.</para>
      </note>

      <para>The <function>gtk.gdk.pixbuf_new_from_file_at_size</function>()
function returns a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
containing an image loaded from the file specified by
<parameter>filename</parameter> with it scaled to the size specified by
<parameter>width</parameter> and <parameter>height</parameter>. The image
file format is detected automatically. The application will block until the
image is done loading.  This function can be used by applications in which
blocking is acceptable while an image is being loaded (small images in
general). Applications that need progressive loading should use a <link
linkend="class-gdkpixbufloader"><classname>gtk.gdk.PixbufLoader</classname></link>
instead.</para>

      <para>This function raises the GError exception if an error occurs
during the loading of the pixbuf.</para>

    </refsect2>

    <refsect2 id="function-gdk--pixbuf-new-from-data">
      <title>gtk.gdk.pixbuf_new_from_data</title>

      <programlisting><methodsynopsis language="python">
          <methodname>gtk.gdk.pixbuf_new_from_data</methodname>
          <methodparam><parameter
	    role="keyword">data</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">colorspace</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">has_alpha</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">bits_per_sample</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">width</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">height</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">rowstride</parameter></methodparam>
	</methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">data</parameter>&nbsp;:</term>
          <listitem><simpara>a string containing image data in 8-bit/sample
          packed format.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
          role="keyword">colorspace</parameter>&nbsp;:</term>
          <listitem><simpara>the colorspace for the image
          data.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
          role="keyword">has_alpha</parameter>&nbsp;:</term>
          <listitem><simpara>If <literal>True</literal>, the data has an
          opacity channel.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
          role="keyword">bits_per_sample</parameter>&nbsp;:</term>
          <listitem><simpara>the number of bits per
          sample.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">width</parameter>&nbsp;:</term>
          <listitem><simpara>the width of the image in pixels.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">height</parameter>&nbsp;:</term>
          <listitem><simpara>the height of the image in pixels.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
          role="keyword">rowstride</parameter>&nbsp;:</term>
          <listitem><simpara>the distance in bytes between row
          starts.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
	<para>This function is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <function>gtk.gdk.pixbuf_new_from_data</function>() function
returns a new pixbuf created from the string specified by
<parameter>data</parameter>. <parameter>data</parameter> must be RGB image
data with 8 bits per sample. <parameter>colorspace</parameter> must be
<literal>gtk.gdk.COLORSPACE_RGB</literal>.</para>

    </refsect2>

    <refsect2 id="function-gdk--pixbuf-new-from-array">
      <title>gtk.gdk.pixbuf_new_from_array</title>

      <programlisting><methodsynopsis language="python">
          <methodname>gtk.gdk.pixbuf_new_from_array</methodname>
          <methodparam><parameter
	    role="keyword">array</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">colorspace</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">bits_per_sample</parameter></methodparam>
        </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">array</parameter>&nbsp;:</term>
          <listitem><simpara>a string containing image data in 8-bit/sample
          packed format.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
          role="keyword">colorspace</parameter>&nbsp;:</term>
          <listitem><simpara>the colorspace for the image
          data.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
          role="keyword">bits_per_sample</parameter>&nbsp;:</term>
          <listitem><simpara>the number of bits per
          sample.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
	<para>This function is available in PyGTK 2.2 and above.</para>
      </note>

      <para>The <function>gtk.gdk.pixbuf_new_from_array</function>()
function returns a new pixbuf created from the Numeric Python array
specified by <parameter>array</parameter>. <parameter>array</parameter> must
be a 3 or 4 dimensional array (4 if the image has an alpha channel) with
<parameter>bits_per_sample</parameter> bits per sample.
<parameter>colorspace</parameter> must be
<literal>gtk.gdk.COLORSPACE_RGB</literal>.</para>

      <note>
	<para>PyGTK must be compiled with the Numeric Python module to
support this function.</para>
      </note>

    </refsect2>

    <refsect2 id="function-gdk--pixbuf-new-from-xpm-data">
      <title>gtk.gdk.pixbuf_new_from_xpm_data</title>

      <programlisting><methodsynopsis language="python">
          <methodname>gtk.gdk.pixbuf_new_from_xpm_data</methodname>
          <methodparam><parameter
	    role="keyword">data</parameter></methodparam>
        </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">data</parameter>&nbsp;:</term>
          <listitem><simpara>a list of strings containing the XPM image
data</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pixbuf_new_from_xpm_data</function>()
function returns a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> by
parsing <literal>XPM</literal> data in memory specified by
<parameter>data</parameter>. <parameter>data</parameter> is a list of
strings containing the <literal>XPM</literal> data.</para>

    </refsect2>

    <refsect2 id="function-gdk--pixbuf-new-from-inline">
      <title>gtk.gdk.pixbuf_new_from_inline</title>

      <programlisting><methodsynopsis language="python">
          <methodname>gtk.gdk.pixbuf_new_from_inline</methodname>
          <methodparam><parameter
			 role="keyword">data_length</parameter></methodparam>
          <methodparam><parameter
			 role="keyword">data</parameter></methodparam>
          <methodparam><parameter
			 role="keyword">copy_pixels</parameter></methodparam>
        </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter
role="keyword">data_length</parameter>&nbsp;:</term>
          <listitem><simpara>the length in bytes of the
<parameter>data</parameter></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">data</parameter>&nbsp;:</term>
          <listitem><simpara>a string containing the inline pixbuf
data</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter
role="keyword">copy_pixels</parameter>&nbsp;:</term>
          <listitem><simpara>if <literal>True</literal> the pixel data
should be copied</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a new <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link>
object</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pixbuf_new_from_inline</function>()
function returns a <link
linkend="class-gdkpixbuf"><classname>gtk.gdk.Pixbuf</classname></link> from
a flat representation that is suitable for storing as inline data in a
program. This is useful if you want to ship a program with images, but don't
want to depend on any external files.</para>

      <para>GTK+ ships with a program called
<command>gdk-pixbuf-csource</command> which allows for conversion of an
image into such a inline representation.In almost all cases, you should pass
the <option>--raw</option> flag to <command>gdk-pixbuf-csource</command>. A
sample invocation would be:</para>

      <programlisting>
  gdk-pixbuf-csource --raw --name=myimage_inline myimage.png
</programlisting>

      <para>For the typical case where the inline pixbuf is read-only static
data, you don't need to copy the pixel data unless you intend to write to
it, so you can pass <literal>False</literal> for
<parameter>copy_pixels</parameter>.</para>

      <para>This function raises the GError exception if an error occurs
during the loading of the pixbuf.</para>

    </refsect2>

    <refsect2 id="function-gdk--pixbuf-get-formats">
      <title>gtk.gdk.pixbuf_get_formats</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.pixbuf_get_formats</methodname>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>a list of image formats as Python
	  dicts</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pixbuf_get_formats</function>() function
returns a list of the supported image formats as a Python dict. The keys
of the image format dict are:</para>

      <variablelist>
	<varlistentry>
	  <term><parameter>name</parameter>&nbsp;:</term>
	  <listitem><simpara>the name of the image format.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>description</parameter>&nbsp;:</term>
	  <listitem><simpara>a description of the image
	  format.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>mime_types</parameter>&nbsp;:</term>
	  <listitem><simpara>a list of the mime types this image
	  matches.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>extensions</parameter>&nbsp;:</term>
	  <listitem><simpara>a list of typical filename extensions for the
	  image format.</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter>is_writable</parameter>&nbsp;:</term>
	  <listitem><simpara>if <literal>True</literal> the image can be
	  written to a file</simpara></listitem>
	</varlistentry>
      </variablelist>

    </refsect2>

    <refsect2 id="function-gdk--pixbuf-get-file-info">
      <title>gtk.gdk.pixbuf_get_file_info</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>gtk.gdk.pixbuf_get_file_info</methodname>
	  <methodparam><parameter
			 role="keyword">filename</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
	  <listitem><simpara>the name of the file to check</simpara></listitem>
	</varlistentry>
	<varlistentry>
	<term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara>an image format as a Python dict</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <function>gtk.gdk.pixbuf_get_file_info</function>() function
reads enough of the file specified by <parameter>filename</parameter> to
determine its image format and then returns the image format information in
a Python dict. See the <link
linkend="function-gdk--pixbuf-get-formats"><function>gtk.gdk.pixbuf_get_formats</function>()</link>
function for more details on the image format dict.</para>

    </refsect2>

  </refsect1>

</refentry>
