# Gimp.cairo_surface_create_buffer

    function cairo_surface_create_buffer(surface: cairo.Surface): Gegl.Buffer {
        // Gjs wrapper for gimp_cairo_surface_create_buffer()
    }

This function returns a Gegl.Buffer which wraps surface's pixels. It must only be called on image surfaces, calling it on other surface types is an error.

Since 2.10

surface

  a Cairo surface

Returns

  a Gegl.Buffer