I recently went to scan an old newspaper ad on microfilm – and the scanner was covered in dust.
There is a way to “cancel out” the look of dust. So I took a second scan of each page, slightly offset from the first. If we align the two scans perfectly then you can see how the text “stays” while the dust “moves” between images:

We can remove the dust using a technique called “Photo Stacking” where we use the differences between the two images to create a third “corrected” image.
Setting up
First, go to https://www.photopea.com/ in order to get set up.
- Click File -> Open to load your first image
- Then, click File -> Open & Place to add the second image as a layer
- Select both layers and align them to each other by clicking Edit -> Auto Align
- With both layers still selected, click Layer -> Smart Object -> Convert to Smart Object . Both layers will be combined into one.
- Perform the stacking: click Layer -> Smart Object -> Stack Mode and select one of the modes below.
Stacking modes

Maximum
Maximum channel values are retained. The brightest values for a pixel “win out” across the 2 photos – so all the dark blemishes disappear.
This is convenient in our case because we only have dark blemishes.
When the same pixel has “black dust” in one pic and “white background” in the other pic, the white background wins out because it is brighter. Pixels that have “black letter” colour will have the same colour across the 2 pics and will be unaffected.
(If we had white blemishes in the microfilm scan, then Maximum stacking mode would retain those ones!)

Minimum
The minimum (darkest) channel values are always retained.
In our case, the dark blemishes are accentuated. We put them in the final image whenever they appear in image 1 OR in image 2.
This stacking order would be great for eliminating white blemishes.

Average / Median
In these modes, we use either the Average or the Median value for a pixel in a stack.
They are good for reducing noise, whatever the colour/brightness may be. But I think they won’t remove it completely.
In our example, because we have just 2 images – the average and the median stack mode are the same.
If you had many images in your stack, then the difference between the two modes would matter:
Average would soften the image. It would perform a calculation, and set each pixel to the average value across the image stack.
Median would keep images sharper – it would pick a specific “middle most common” value that appears for a pixel across the entire stack. It won’t calculate a softer value. See the slider at the bottom of this post for a comparison.
Modes that help analyze your images

Range
The value of a pixel would be the difference between the Maximum brightness seen and the Minimum brightness seen.
In our example, this ends up highlighting those areas where a portion of the white paper background had a dark blemish on it – across the 2 images.
The reason why you don’t see the black letters, is because they remained the same across the two images. If we had white blemishes appearing on top of them, then the would show up in Range mode.

Standard Deviation
Analytical: measures the distribution of information between the images. Useful for object removal as it clearly indicates areas that will be averaged out with a Median stack mode.

Variance
Analytical: as Standard Deviation, indicates how pixel values are spread between images. More intense distributions are shown very clearly.

Summation
Produces the total value of pixels from each image. Usually results in overexposure, but can be used to lighten very underexposed imagery.
If you are photographing an object at night, with a bad camera, you could correct those photos with the Summation mode.
Additional resources
- You can Stack images in Photoshop using the exact same steps. Except, in some versions of Photoshop (CS6 for me) the “Stack Mode” menu option is always greyed out. It seems like the functionality just isn’t there for older versions.
- There is a Photoshop stacking tutorial that works even on older versions, but appears to only perform the Minimum stacking mode. It will accomplish Focus Stacking but won’t help you remove dust from an image.
- Tutorial on “Focus Stacking” in Photopea. This technique lets you combine 2 half-blurry images to create 1 sharp image.
















































































































