Dark Frame Subtraction using Adobe Photoshop
by Chris Limone
Rating: 9 / 10
If you shoot long exposures digitally, you should get into the habit of shooting with the lens cap on. That's right, shoot a dark frame at the beginning or end of every day you shoot so that you can easily remove any hotpixels that might show up on your images.When shooting long exposures at night with a digital camera, you may have noticed little white (or red, blue, or green) specks on the image (if you havent noticed, zoom in to about 400% and youll see them). These hot pixels are completely normal when using shutter speeds of 2 or more seconds. The CCD sensors have not been perfected and as of yet there is no way to avoid this. Most of the time you will never see these defects even if you do shoot long exposures. The reason is simply that you wont zoom in far enough to see them. But if for some reason you want to print very large, or enlarge and crop an image, these little spots will become apparent. So if you love shooting at night, or with long exposures, let me show you an easy way to get rid of these annoying little dots.
There is a well-established method of removing these hot-pixels called dark frame subtraction. If you take a long-exposure with the lens cap on, you would think you should get a completely black image, right? Nope. What you get is something that looks more like the sky on a starry night. This is the dark frame. Hot-pixels dont always stay in the same spot, but all images shot within the same day should have approximately identical hot-pixel locations. Also, the longer the exposure, the more of these little dots will show up. Thus, if youre going to do a dark frame subtraction, you need to shoot a dark frame with the same exposure as the image you wish to edit, and you need to shoot it within the same day. It's much easier to shoot the dark frame directly after the original photograph instead of trying to remember what exposures you shot earlier in the day.
There are some freeware and shareware programs you can download that will do dark frame subtraction with or without a dark frame (links to these programs are at the end of the article), but I am going to show you how to do it manually in Adobe Photoshop.
Original Image: 15s at f/6.7 |
Dark Frame: 15s with lens cap on |
This is an image I shot recently to illustrate this concept. You cant see any hot pixels at this level of magnification, so I am going to zoom in to where the blue box is shown (400% magnification). Its worth noting that no color correction has been done to the image, in camera or in Photoshop. In-camera color correction must be turned off to get the dark-frame image, so you should also shoot the main image with any color correction settings disabled.

Close up of the area in the blue box
Here I have my original image with a couple hotspots next to the dark frame image file (shot immediately after the original). You can compare the two images to see how the hot-spots look similar. On my dark-frame image there were about 20 of these hot pixels. I shot these images with a Canon 10D. Most professional and semi-professional camera models have better CCD sensors and therefore fewer hot pixels. The consumer point-and-shoot cameras tend to have much more of these if the camera is capable of taking long exposures.
Open your dark-frame image and the original image in Adobe Photoshop. With the dark-frame image window active, select all (Ctrl-A) and copy (Ctrl-C). Then go to the original image window and paste it in (Ctrl-V). This should place it directly over the original image onto a separate layer so both are aligned correctly.

Select the dark frame layer and change the blending mode to Difference. This will get rid of the hot-pixels by inverting the image only where the dark frame is not black. You can change the opacity of the dark frame layer to find a better balance if the difference is too much. Usually 50% opacity works well.

Here the dark frame layer is set to 16% opacity. Notice the red hot pixel on the left has disappeared.

Here I have set the opacity to 50%. The hot pixel on the right blends in a little better, but the red one on the left has turned green. Upon earlier inspection when searching for hot pixels in the dark frame image, I noticed there were more blue or red patches than there was white. So, Im going to go with the lesser of two evils and set my dark frame layers opacity to 16%. This should get rid of all the colored hot pixels.
Now, if youre finished fussing with the dark frame subtraction method, you should flatten the image.

At this point you can do any color correction or photo-editing that youd like. I just did a color balance adjustment to get the final image.

These programs from Media Chance are available to try for free. More information is available at the Media Chance website.
Blackframe NR uses an advanced algorithm to get rid of hot pixels which means you dont have to choose the lesser of two evils, it will get rid of both colored and white hot pixels in one try.
Blackframe NRwww.mediachance.com/digicam/blackframe.htm
Hotpixels Eliminator works somewhat like Adobe Photoshops Dust and Scratches filter and its a good choice if you do not have a dark frame.
Hotpixels Eliminatorwww.mediachance.com/digicam/hotpixels.htm







Joey
26-10-2007
isn't this process outdated now, since most Digital SLR cameras have a 'long exposure noise reduction feature' which basically does the same thing in camera if enabledvksgautam
03-03-2008
good articleAlex Fliker
09-08-2012
Joey, being astrophotographer I can say firmly - noise reduction of DSLR just sucks, you can trust me. Btw, thank you for the article!gonzalo
27-09-2012
Thanks for the article ¡¡¡