Home

pixbuf

A pixbuf, short for pixel buffer, is a data structure used to store image data in memory. In the GNOME project and its GTK toolkit, the term most often refers to the GdkPixbuf library, which provides a pixbuf type for loading, storing, and manipulating images.

A pixbuf encapsulates a rectangular array of pixels together with metadata. Typical fields include a pointer

Pixbufs can be created from dimensions, from image files, or from memory buffers. They can be scaled,

Memory management is handled through reference counting in the GObject system; pixbuf objects are shared and

to
the
pixel
data,
the
image
width
and
height,
a
rowstride
(the
number
of
bytes
between
the
start
of
one
row
and
the
next),
and
the
number
of
color
channels
per
pixel.
Most
pixbufs
use
8
bits
per
sample
and
either
3
channels
(RGB)
or
4
channels
(RGBA).
A
has_alpha
flag
indicates
whether
an
alpha
channel
is
present.
Pixel
data
are
stored
in
row-major
order,
with
a
specified
channel
order
(commonly
red,
green,
blue,
[alpha]).
transformed,
or
converted
between
formats,
and
they
can
be
drawn
to
different
surfaces
or
widgets.
In
GTK
applications,
a
pixbuf
is
often
used
with
widgets
such
as
GtkImage
to
display
images,
or
passed
to
drawing
routines
and
rendering
pipelines
like
Cairo.
freed
when
no
longer
in
use.
See
also
GdkPixbuf
and
GTK
for
related
libraries
and
concepts.