Stacking Procedure is incorrect

Started Aug 9, 2002 | Discussions thread
Flat view
Simon Glynn Forum Member • Posts: 66
Stacking Procedure is incorrect

A number of people have identified a stacking procedure used to reduce random noise in images, by layering sequentially shot frames of the exact same scene and adjusting opacity of the frames.

From what I have read the general concensus has been to (for a three layer case)

Add the three layers
Set the bottom layer to 100% opacity
Set the middle layer to 50% opacity
Set the top layer to 50% Opacity

On the basis of the above understanding I believe the method is incorrect, but I acknowledge that I may have missunderstood the above method. Let me explain

To test why the above in incorrect, you can do the following.

Create a new image in photoshop of say 20 pixels by 20 pixels
Copy the layer two additional times
Fill the bottom layer with colour black (RGB 0,0,0)
Fill the middle layer with colour white (RGB 255,255,255)
Fill the top layer with colour grey (RGB 127,27,127)
Set the opacity of the middle layer and top layer to 50%

The idea is that irrespective of the order of the layers, the resulting averaged image (in this case an averaged colour) should be the same. In the above configuration this is true. The resulting colour is 127 which is the average of middle grey + black + white. But......

Try swapping the top and middle layer. Notice that the colour changes. If the top layer is white, and the middle layer is grey (still both with 50% opacity), then the resulting image colour is a lighter grey (RGB 160,160,160), and this is not what we should be expecting to see.

If you now change the opacity of the top layer (white) to 33%, and leave the middle layer as 50% opacity the result is 127 again, which is the correct result.

While the 50% method described is not too far wrong for 3 images, consider what would happen if you have a 100 layer image. If you set all but the bottom layer of the image to 50% opacity, the the very top image (image 100) would have a 50% weighting in the final result, so if there were a hot pixel in image 100 that was not present in any of the other 99 images, then the final image, would have a 50% weighting of that hot pixel balanced against the correct pixel in each of the 99 other images underneath it.

I therefore think that the correct opacity settings to use should follow the below formula. (Layer 1 is the bottom layer)

Layer 1 = 100%
Layer 2 = (100/2) = 50%
Layer 3 = (100/3) = 33%
Layer n = (100/n) %

Try it with the test case I described. Add more black frames and adjust according to the above formula. The overall result will get darker, but thats expected because the average of all layers is tending more towards the black end of the spectrum. Whats important is that as you switch the order of the layers (making sure the remember to adjust the opacity to match the layer position), that the result is always the same.

Please correct me if I have made an oversight.


Flat view
Post (hide subjects) Posted by
Keyboard shortcuts:
FForum PPrevious NNext WNext unread UUpvote SSubscribe RReply QQuote BBookmark MMy threads
Color scheme? Blue / Yellow