diff --git a/src/cairo-openvg-surface.c b/src/cairo-openvg-surface.c
index 2782646..45b54bb 100644
--- a/src/cairo-openvg-surface.c
+++ b/src/cairo-openvg-surface.c
@@ -39,6 +39,14 @@
 
 #define MAX_OPACITIES 32
 
+typedef struct cached_image_t {
+    VGImage  vg_image;        /*< set to 0 when entry not used */
+    void    *cairo_image;
+    void    *data;
+} cached_image_t;
+
+#define MAX_IMAGES 32
+
 typedef struct cairo_openvg_surface {
     cairo_surface_t base;
     cairo_content_t content;
@@ -51,6 +59,8 @@ typedef struct cairo_openvg_surface {
     double          alpha;
     double          opacity[MAX_OPACITIES];
     int             opacity_level;
+
+    cached_image_t  images[MAX_IMAGES];
 } cairo_openvg_surface_t;
 
 static void
@@ -505,11 +515,51 @@ _cairo_openvg_setup_surface_source (cairo_openvg_surface_t  *vgsurface,
           image->format == CAIRO_FORMAT_A8 ||
           image->format == CAIRO_FORMAT_A1);
 
+  {
+    int i;
+    for (i=0; i<MAX_IMAGES;i++)
+      {
+        if (vgsurface->images[i].vg_image &&
+            (vgsurface->images[i].cairo_image == image ||
+             vgsurface->images[i].data == image->data))
+          {
+            vgsurface->source_image = vgsurface->images[i].vg_image;
+            fprintf (stderr, "found in cache!\n");
+            goto USED_CACHE;
+          }
+      }
+  }
+
   vgsurface->source_image = vgCreateImage (VG_sRGBA_8888, 
     image->width, image->height, VG_IMAGE_QUALITY_FASTER);
   /* NONALIASED, FASTER, BETTER */
 
-  /*printf ("image: %ix%i\n", image->width, image->height);*/
+
+  { /* store in cache */
+    int i;
+    int done = 0;
+    for (i=0; i<MAX_IMAGES;i++)
+      {
+        if (vgsurface->images[i].vg_image == 0)
+          {
+            vgsurface->images[i].vg_image = vgsurface->source_image;
+            vgsurface->images[i].cairo_image = image;
+            vgsurface->images[i].data = image->data;
+            done = 1;
+            break;
+          }
+      }
+    if (done == 0)
+      {
+        i=1;
+        vgDestroyImage (vgsurface->images[i].vg_image);
+        vgsurface->images[i].vg_image = vgsurface->source_image;
+        vgsurface->images[i].cairo_image = image;
+        vgsurface->images[i].data = image->data;
+      }
+  }
+
+  printf ("image: %p %p %ix%i\n", image, image->data, image->width, image->height);
 
   data = malloc (image->width * image->height * 4);
 
@@ -534,6 +584,8 @@ _cairo_openvg_setup_surface_source (cairo_openvg_surface_t  *vgsurface,
 
   free (data);
 
+USED_CACHE:
+
   vgSetParameteri (vgsurface->source_paint,
                    VG_PAINT_TYPE, VG_PAINT_TYPE_PATTERN);
 
@@ -623,7 +675,7 @@ teardown_source (cairo_openvg_surface_t *vgsurface,
     }
   if (vgsurface->source_image)
     {
-      vgDestroyImage (vgsurface->source_image);
+      /*vgDestroyImage (vgsurface->source_image);*/
       vgsurface->source_image = 0;
     }
   return CAIRO_STATUS_SUCCESS;
