Index: trunk/ppStack/src/ppStackMatch.c
===================================================================
--- trunk/ppStack/src/ppStackMatch.c	(revision 15303)
+++ trunk/ppStack/src/ppStackMatch.c	(revision 15368)
@@ -58,13 +58,27 @@
     }
 
+    // Generate a fake image to match to
+    float maxMag = -INFINITY;           // Maximum magnitude of sources
+    for (int i = 0; i < sources->n; i++) {
+        pmSource *source = sources->data[i]; // Source of interest
+        if (source->psfMag > maxMag) {
+            maxMag = source->psfMag;
+        }
+    }
+    pmReadout *fake = pmReadoutFakeFromSources(input->image->numCols, input->image->numRows,
+                                               sources, target, powf(10.0, -0.4 * maxMag));
+
+
     // Do the image matching
-    if (!pmSubtractionMatch(output, input, NULL, footprint, regionSize, spacing, threshold, sources,
+    if (!pmSubtractionMatch(output, input, fake, footprint, regionSize, spacing, threshold, sources,
                             stampsName, target, type, size, order, widths, orders, inner, ringsOrder,
                             binning, optimum, optWidths, optOrder, optThresh, iter, rej, maskBad,
                             maskBlank, badFrac)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to match images.");
+        psFree(fake);
         psFree(optWidths);
         return false;
     }
+    psFree(fake);
     psFree(optWidths);
 
