CI Photocommunity

Register a free account now!

If you are registered, you get access to the members only section, can participate in the buy & sell second hand forum and last but not least you can reserve your preferred username before someone else takes it.

Removing Dust and Lens Vignettes in Software


Well-Known Member
I'm going to provide a nicely detailed tutorial on how you can eliminate or compensate for imager dust and optical vignetting from an image. For my source images, I will use files from my last shoot through my pinhole lens. Since the light from a pinhole has virtually a single path to each imager photosite, the effects of dust on the imager are at their worst, so this will better demonstrate the effectiveness of this technique.

Here is the source image which I'll be referring to as the Light Frame:


Since a pinhole has no focus or aperture adjustment, the only controls are the image file format, shutter speed, ISO, and white balance, for this photo, 2640x1760 RAW, 2 Seconds, 100, Day Light.

The imager dust is obvious, but I visually scanned the image was found these:


Right after the above shot, I aimed my tripod mounted SD14 up towards a pure smooth blue sky and this is my Flat Frame:


The imager dust is far more evident in the Flat Frame with it's smooth background:


I can see that there is a slight gradation in the blue of the sky, ideally, even this should be minimized, but it was still sufficient when considering that it was shot with the Sun low in the sky and there were clouds to the West where the sky would normally be smoother.

Step 1:

In SPP, open the Light Frame and make your usual image adjustments. Do not perform any image size or cropping at this time.

Step 2:

Before saving the file, save your adjustment settings, they will be needed later to process the Flat Frame.

Step 3:

Save your adjusted Light Frame image as a 16 Bit TIF file.

Step 4:

Open the Flat Frame and apply the saved adjustments from your Light Frame session.

Step 5:

Then shift the Saturation all the way to the left, so the Flat Frame is now monochrome:


Step 6:

Save your adjusted monochrome Flat Frame image as a 16 Bit TIF file.

<To be continued in another post>


Well-Known Member
Step 7:

Open DeepSkyStacker


Step 8:

Click on "Open Picture Files..." to load the 16 Bit TIF Light Frame file


Step 9:

Click on "Flat Files..." to load the 16 Bit TIF monochrome Flat Frame file


Step 10:

Click on "Check All" to ensure DSS has something to do


Step 11:

Click on "Stack Checked Pictures"


DSS will display a confirmation window and click on OK:


<To be continued in another post>


Well-Known Member
DSS will step through a succession of progress windows and watch for it "Saving Final image .../Autosave.tif"


DSS will add a number to the Autosave.tif file name, Autosave001.tif Autosave003.tif Autosave003.tif... when asked to process other files from the same source folder, so you do not have to worry about loosing any work.

When completed, DSS will give you a WTF moment:


Do not worry, DSS simply opened the newly created Autosave.tif and applied it's default idea for RGB/K Levels, Luminance, and Saturation. I have still to figure out how these controls work and I am not comfortable with how they alter the image. Give them a try if you wish.

At this point, you can exit DSS. Since there is nothing on the DSS window to Quit or Exit, just click the upper right window close icon. DSS will ask if you want to save anything, just answer no since the Autosave.tif has already been saved.

Step 8:

Here is another surprise, DSS has taken two 16 bit TIF files and created a single 32 bit TIF file. For me, Photoshop chokes on it and Irfanview can't even call it up in the thumbnail view. I use
Please, Log in or Register to view URLs content!
, which is their freeware version, to open the DSS Autosave.tif and then save it as a reduced 16 bit TIF:


<To be continued in another post>


Well-Known Member
Step 9:

Now let's see what we have. Open the 16 bit version of Autosave.tif in photoshop:


Oops, if you look where the worst dust particles were, there are now bright versions in their place:


This is because the monochrome Flat Frame is over correcting. The solution is to return back to Step 4, repeat the adjustments, and this time lower the Contrast. For these images, the initial contrast setting was +1.3. On my second pass, I reduced this to -1.8 and this is the result:


and Great, now the dust is dark, but not as dark as it was originally:


That means that a contrast setting between +1.3 and -1.8 on the Flat Frame will be able to null out the noise. Apart from this trial, test, and hunting for an effective contrast value that is the process.

It turns out that the ideal Flat Frame contrast was -1.1 but I also had to switch from a Light Frame with a 2 Second exposure to another Light Frame that I shot at .5 Seconds. As you can see from these examples, the Flat Frame compensation brightens the resulting image and I've found that it's best to shoot with the histogram shifted to the left, slightly under exposed so that bright highlights, the East facing white wall in this example photo, don't get blown out when DSS applies the Flat Frame.

All that remains is to increase the color saturation to match the original scene:


Look Close! The big chunks of dirt still leave artifacts, but the rest is gone.


Hi Steaphany,
that´s a lot of work you´ve done in providing this tutorial.
Excellent, and easy to follow.
But for me it leaves the question:
Wouldn´t it be easier to clean the sensor regularly to avoid that amount of dust?
Or did I miss something?


Well-Known Member
Thanks for the info and tutorial Steaphany!
Can you just use the same Flat file for other images in different light if you haven't yet cleaned the image sensor? Or do you have to take new Flat files in the same lighting in order to use them?

Uwe, I think this would be easier if you're already taking pictures. Unless you clean your camera before and after every use. And for beginners like me who haven't fully understood the process of cleaning this gives us another option to try.


Well-Known Member

Yes, you can save your Flat Frames to use with later shoots. Just keep in mind that any new dust particles that were not recorded in the Flat Frame would not be corrected.

If you have a Flat Frame that you use with a specific lens to compensate for vignetting, then the urgency to shoot one for every photo session decreases. For example, I have a flat frame set aside and ready to vignette compensate when ever I shoot through my Orion 90mm Ø 1250mm Maksutov Cassegrain telescope, since, unlike dust, the vignette is static.


Well-Known Member
Thanks Steaphany,
I've noticed more dust spots on my images today, so it may soon be time for me to give the sensor cleaning a go.