Introduction
This Photoshop tutorial shows how to remove multiple small spots/speckles from an image without resorting to the Healing Brush or the Clone Stamp. Unlike the "Dust and Scratches" Filter, this method does not cause loss of detail or other undesirable artifacts. It also allows for finer control over the "despeckling" process. The technique can save a significant amount of time and effort if a photograph contains many defects of that type and the results of the "Dust & Scratches" filter are unsatisfactory (which is not unusual).
The image on the left shows how the same image fragment (the full image is shown in
Step 1 below) changes during all of the steps of the tutorial.
The main phases of the method are:
- Creating a mask that separates the spots/speckles from the image. This phase is illustrated by the first 5 subimages above ("Original", "Minimum", "Maximum", "Difference", "Mask") and is described in Steps 1-6 below.
- Blurring the original image ("Blurred" subimage above) described in Step 7.
- Filling the spots/speckles in the original image with the grayscale values from the blurred version in the locations selected by the created spot/speckle mask ("Composite" subimage above). This is described in Step 8.
- Adjusting/tweaking the degree of correction and final touch-up of the remaining spots ("Added Levels" and "Final Image" above), described in Steps 9-10.
NOTE: To see larger versions of the tutorial images, click on them. Repeated clicking on the enlarged version will enlarge it further, up to the original size, which can be downloaded using the usual right-click method.
Another way of downloading the full-resolution image:
- Click on the small image in the tutorial.
- In the page that opens, select "save photo" link in the "Sizes:" bar at the bottom of the page.
The image on the right contains spots/speckles of different sizes and shapes. Removing them with the Healing Brush would be tedious and the "Dust & Scratches" filter creates objectionable artifacts, so let's try to use an efficient approach that does not degrade the image:
STEP 1
Create a copy of the “Background” layer. Try not to work on the “Background” layer. If you change it without copying, you will not be able to go back to the original state of the photo for comparison.
Note: The image on the right shows the entire layer stack created during this tutorial, but the displayed image is in its original state (with spots/speckles).
STEP 2
Select the "Background copy" layer in the layers stack, go to Filter/Other/Minimum. Select filter radius that removes the undesirable small spots/speckles. In our example, radius of 3 worked well. After applying the filter the speckles should be gone as in the picture on the left.
Although the Minimum filter effectively removed the spots/speckles, it also shifted the edges in the image. Dark regions became generally larger and bright regions smaller. The filter also darkened the entire image. These effects are undesirable. They would add many unwanted regions to our spot/speckle mask - see Step 4 below. We will reverse these changes in the next step.
STEP 3
With the "Background copy" layer still selected choose
Filter/Other/Maximum with the radius set to
the same value as in the previously applied Minimum filter (3 in our example) and click “OK”. The result is shown on the right.
The speckles are still gone, as in
Step 2, but the edges have been shifted back to their original positions.
Side Note: By using the Minimum and Maximum filters we have just performed a
morphological opening of the image. In this example, opening removed the bright spots of size smaller than the size of the filter - "structuring element" in the image processing lingo - while leaving all other parts of the image relatively unchanged and enabling the creation of an effective spot/speckle mask in
Step 4 below.
For the interested reader, a good overview of image morphology can be found here.
IMPORTANT: To remove
dark spots/speckles on a generally bright "background" simply change the order of the filters (Maximum filter followed by the Minimum). Not surprisingly, this operation is known as
morphological closing.
STEP 4
The next step is to create a mask that will separate the dust, speckles and small scratches from the rest of the image. To achieve this we need to change the blending mode of the “Background copy” layer from Normal to Difference.
This blending mode highlights the differences between the layers being compared – in this case the “Background copy” and “Background” layers.
The bigger the difference between the luminosity of the pixels being compared on the layers, the lighter the result. Blending of pixels with the same luminosity results in black; blending a black pixel with a white one will result in white.
Since the spots/speckles were minimized on the “Background copy” layer by the morphological opening, the Difference blending mode will highlight them while showing everything else as close to black (see the image above).
STEP 5
To make the highlighted imperfections more obvious, add a “Levels” adjustment layer at the top of the layer stack and group it with the “Background copy” layer by placing the cursor on the border between those two layers and Alt-Left Clicking.
By grouping “Levels” with the “Background copy” layer you restrict any changes to just that layer, while the “Background” layer remains unchanged.
Now the contrast between the “Background copy” and “Background” layer can be enhanced by adjusting the "Levels" layer. The result is seen on the right. This is the mask we will use to remove the unwanted spots and speckles from the image.
Note: The Maximum filter might also come in handy here if the Levels adjustment layer is not effective enough. The Maximum filter will make the white marks larger and brighter.
STEP 6
Press Alt-Ctrl-Shift-E to create a merged copy of the resulting image. Name the layer “Mask” (see the layer stack in Step 1). Make sure it is selected in the layer stack.
Press Ctrl-A and Ctrl-C to copy it to the clipboard. Switch off all layers except the “Background” layer by clicking on the eye icon next to the layer name.
STEP 7
Make another copy of the “Background” layer and name it “Blurred” (see the layer stack in Step 1). With the “Blurred” layer selected in the layer stack choose Filter/Blur/Gaussian Blur and set the blur amount to a value where none of the spots/speckles in the image are visible. Click “OK”.
The outcome should look something like the image above.
STEP 8
Add a layer mask to the “Blurred” layer. Alt-Left-Click on it and then press Ctrl-V to paste into the layer mask the contents of the “Mask” layer that were copied to the clipboard.
In the resulting composite only those fragments of the “Blurred” layer show that correspond to white areas of the layer mask while the black parts of the layer mask reveal the “Background” layer. This way most of the damaged areas of the picture are filled in (see image on the right).
STEP 9
To make the filled-in patches blend in perfectly add a “Levels” adjustment layer to the “Blurred” layer and group them together (see the layer stack in Step 1).
Regulate the brightness of the “Blurred” layer until the fixed areas become undistinguishable from the rest.
The result is the image on the left.
STEP 10
Use whatever tool you prefer to handle the last couple of remaining spots to achieve the final result shown on the right.
Page 2 of this tutorial shows the effects of applying the presented method to a
color photo and compares the results with the "Dust & Scratches" filter. It also highlights the larger loss of detail and unwanted artifacts caused by the "Dust & Scratches" filter in comparison to this approach.
Home
New comment: Requires approval