Index: /trunk/ppMerge/src/ppMergeArguments.c
===================================================================
--- /trunk/ppMerge/src/ppMergeArguments.c	(revision 24836)
+++ /trunk/ppMerge/src/ppMergeArguments.c	(revision 24837)
@@ -170,4 +170,6 @@
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-xsmooth", 0, "Number of smoothing regions in x", 0);
     psMetadataAddS32(arguments, PS_LIST_TAIL, "-fringe-ysmooth", 0, "Number of smoothing regions in y", 0);
+    psMetadataAddBool(arguments, PS_LIST_TAIL, "-fringe-smooth", 0, "Smooth output image", false);
+    psMetadataAddF32(arguments, PS_LIST_TAIL, "-fringe-smooth-sigma", 0, "Size of smoothing Gaussian", NAN);
 
     /** CTEMASK construction parameters */
@@ -329,4 +331,6 @@
     VALUE_ARG_RECIPE_INT("-fringe-xsmooth", "FRINGE.XSMOOTH", S32, 0);
     VALUE_ARG_RECIPE_INT("-fringe-ysmooth", "FRINGE.YSMOOTH", S32, 0);
+    VALUE_ARG_RECIPE_BOOL("-fringe-smooth", "FRINGE.SMOOTH");
+    VALUE_ARG_RECIPE_FLOAT("-fringe-smooth-sigma", "FRINGE.SMOOTH.SIGMA", F32);
 
     /** CTEMASK construction parameters */
Index: /trunk/ppMerge/src/ppMergeLoop.c
===================================================================
--- /trunk/ppMerge/src/ppMergeLoop.c	(revision 24836)
+++ /trunk/ppMerge/src/ppMergeLoop.c	(revision 24837)
@@ -65,4 +65,6 @@
     int fringeSmoothX = psMetadataLookupS32(NULL, arguments, "FRINGE.XSMOOTH"); // Smoothing regions in x
     int fringeSmoothY = psMetadataLookupS32(NULL, arguments, "FRINGE.YSMOOTH"); // Smoothing regions in y
+    bool fringeSmooth = psMetadataLookupBool(NULL, arguments, "FRINGE.SMOOTH"); // Smooth the output image?
+    float fringeSmoothSigma = psMetadataLookupF32(NULL, arguments, "FRINGE.SMOOTH.SIGMA"); // Smooth the output image?
 
     // set the mask and mark bit values based on the named masks
@@ -416,6 +418,15 @@
             // Put the new readout into the cell after the existing readouts.
             if (type == PPMERGE_TYPE_FRINGE && outRO) {
-                pmFringeRegions *regions = pmFringeRegionsAlloc(fringeNum, fringeSize, fringeSize,
-                                                                fringeSmoothX, fringeSmoothY);
+		if (fringeSmooth) {
+		    if (outRO->mask) {
+			psImage *smoothed = psImageSmoothMask (NULL, outRO->image, outRO->mask, maskVal, fringeSmoothSigma, 3, 0.2);
+			psFree (outRO->image);
+			outRO->image = smoothed;
+		    } else {
+			psImageSmooth (outRO->image, fringeSmoothSigma, 3);
+		    }
+		}
+
+                pmFringeRegions *regions = pmFringeRegionsAlloc(fringeNum, fringeSize, fringeSize, fringeSmoothX, fringeSmoothY);
                 pmFringeStats *fringe = pmFringeStatsMeasure(regions, outRO, maskVal);
                 psFree(regions);
@@ -429,5 +440,9 @@
                 fringes->data[0] = fringe;
 
-                pmFringesFormat(outCell, NULL, fringes);
+                // XXX replaced this : pmFringesFormat(outCell, NULL, fringes);
+		if (!psMetadataAdd(outCell->analysis, PS_LIST_TAIL, "FRINGE.MEASUREMENTS", PS_DATA_ARRAY, "Fringes", fringes)) {
+		    psError(PS_ERR_UNKNOWN, false, "Unable to add fringe to analysis metadata\n");
+		    goto ERROR;
+		}
                 psFree(fringes);        // Drop reference
             }
