Index: trunk/pstamp/src/ppstampParseCamera.c
===================================================================
--- trunk/pstamp/src/ppstampParseCamera.c	(revision 24966)
+++ trunk/pstamp/src/ppstampParseCamera.c	(revision 29379)
@@ -8,7 +8,19 @@
 
 // Set up the ppstamp output Image file
-bool setupOutput(pmConfig *config, pmFPAfile *input, bool doMask, bool doWeight)
+bool setupOutput(pmConfig *config, pmFPAfile *input, psString stage, bool doMask, bool doWeight)
 {
-    pmFPAfile *output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT");
+    pmFPAfile *output;
+    
+    if (!stage || (strcmp(stage, "diff") != 0)) {
+        output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT");
+    } else {
+        // need special filerule for diff stage image to allow for negative values
+        output = pmFPAfileDefineSkycell(config, NULL, "PPSTAMP.OUTPUT.DIFF");
+    }
+    if (!output) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to setup output.");
+        return false;
+    }
+
     output->save = true;
 
@@ -29,5 +41,5 @@
 // something else that I'm missing?
 
-bool ppstampParseCamera(pmConfig *config)
+bool ppstampParseCamera(pmConfig *config, ppstampOptions *options)
 {
     bool status = false;
@@ -83,5 +95,5 @@
 
     // Set up the output target
-    if (!setupOutput(config, input, doMask, doWeight)) {
+    if (!setupOutput(config, input, options->stage, doMask, doWeight)) {
         psError(PS_ERR_UNKNOWN, false, "Unable to setup output.");
         return false;
