Dark Frames And Your Night Photography

In an upcoming webinar (Down with the Noise) I explain a lot about noise: causes, contravention and cures. This is a bit of a prelude and addresses the questions:

  1. What is a dark frame?
  2. What do I do with my dark frame?
  3. What do I do if I don’t have dark frame(s)?

What Is a Dark Frame?

A dark frame is one or more images taken at the same exposure length, ISO and ambient temperature as the light (normal) frames but with the lens or body cap on the camera to prevent any light from reaching the sensor. When doing many kinds of night and low light photography dark frames can be quite helpful. And when doing star trails or other night imagery dark frames may save your bacon. A dark frame is what your camera does after a long exposure when long exposure noise reduction is turned on. But you’ll be far more efficient if you take those frames yourself. If you’re taking 100 light frames, e.g. for a star trail, you can take 3 or four dark frames and waste 50% less time (and not have gaps!)

Contrary to popular belief dark frames and long exposure noise reduction do little to reduce the random noise that is present in every exposure. That random noise is most pernicious in dark photos and shadow areas.  Dark frames, however are good for the following things:

  1. Reducing or eliminating hot pixels and amp glow
  2. Removing any “bias” in your image – that is bringing the black back.
    Want me to translate that: an unexposed area on your sensor should read as “0,0,0”  for Red, Green and Blue but I will bet you you don’t get zero!

This would probably be a good place to show you what a dark frame looks like. But you’ll be disappointed. Dark frames are usually quite black.  So instead of showing you JUST the dark frame, here is the dark frame boosted to show the speckles from hell – though they may not be obvious. Here I have made the speckles more obvious by boosting the darks using Curves in Photoshop. At this level of detail there are not any obvious hot pixels.

Dark Frame Overview – Boosted to show details. Note where the markers are – they are shown in the next frames.

And next is the same dark frame zoomed to 3200% unaltered. Hover your cursor over the image to see the same area boosted using curves.

Single Dark Frame (Linear Mode) Unmodified – or cursor over to see boosted version.

When inspected carefully, and with the dark level significantly increased it is possible to notice the hot pixels and possibly banding in a dark frame.  While there were plenty of red speckles and obviously green and blue as well in my stable of dark frames, the “hot pixels” didn’t leap out at me.  If you look carefully at the image you’ll notice I also used the color sampler tool to provide RGB values for 3 different locations on the image.  Of note is location 1 where the R (red) value is 14.  What is particularly worrisome about that value is that even after the entire frame has been boosted to the equivalent of 1.6 stops, you’ll notice that a value of 14 is still larger than all three colors at spot 3. After boosting, that red pixel really stands out with a value of 44.  Our first take away is that boosting the brightness boosts the noise.  The second thing to notice is that the red spot is NOT a hot pixel.  How do we know? Compare 4 dark frames (all boosted)

Boosted Dark Frame                             Click these–>   Frame 1 ~ Frame 2 ~ Frame 3 ~ Frame 4

Takeaway 2: There really is randomness!

Now that we have noticed the randomness, we realize that if we average enough of these frames together we can get the average “bias” – that is the amount of offset above zero in the image.  And if there are hot pixels, the good news is they will be in there too.

But How Do I Use a Dark Frame?

The simplest answer is to feed your dark frame(s) to a program that already knows what to do with them like StarStax, StarTrails or Image Stacker.  But you can do it yourself, and perhaps more elegantly using Photoshop.  How?  Place the dark frame as a layer over the image you want to correct and change the blend mode to Subtract (or difference). Adjust the opacity of the blend until it looks just right.

But I Did Not Take a Dark Frame, Now What?

All is not lost. If you have enough frames you can create a unique kind of dark frame. I took over 300 28-second exposure for a star trail along Lake Gaston in North Carolina.

In the image below I created the top frame using the Brighten mode in StarStax. I could just as easily have created the top frame using the StarCircleAcademy Stacking Action.

I used Darken mode to create the middle frame by feeding it my 100 darkest images. Using Darken mode as the stacking option means that hot or stuck pixels that are in every image as well as the lowest value of sky glow will be collected into a single result.

I then loaded the light (Brighten Mode) and the dark (Darken mode) frames into Photoshop. I placed the dark image over the brighten stack and changed the blend mode to Subtract.

What Happened Here?
Dark Frame Substitute process

Several interesting things happened:

  1. The hot pixels were almost completely annihilated
  2. The sky gradient caused by lights glowing in the distance was also almost eliminated.
  3. The contrast in the sky and elsewhere was improved
  4. The red bias on the railing was mostly removed.

A few less desirable things happened, too. The bright red glow on the railing once subtracted caused some of the railing to turn green. And the subtraction created some “holes” and “halos” in the image – especially where the brightest lights are found.  With some minor touch up, most of those issues can easily be fixed.

Is this the end? By no means! There are a LOT more interesting techniques to follow. Stay tuned.

SHARE this on Facebook or Google+ You know you want to help your friend out anyway, right!?

9 thoughts on “Dark Frames And Your Night Photography

    1. Steven Christenson

      Seems like a good tool. A little clunky and Windows only, but thanks for the pointer to PixelFixer. It does say the dark frame subtraction is “beta” only and perhaps part of the reason is it only allows the use of a single dark frame.

  1. Chris

    Hi I have created a stacking plug-in for GIMP and I’ve never been quite sure if my handling of dark frames is “correct”. If you could comment on the procedure I’d appreciate it.

    I first take all the dark frames and layer them 1 on top of the other but reducing the opacity over time so that they all end up with an “even” value to give an average dark frame. The formula for opacity is 100.0 / pow(2, layer_count – 1) which if my maths doesn’t suck should mean you end up with an average image at the end.

    I then take this master dark and apply it to each light frame using difference before then blending the light frames using lighten as you’d expect. Should I be using subtract rather than difference?

    Once again thanks for any comments you have, it was written out of frustration at no free option to stack images on OSX. Of course StarStax came out the following week, but I still want to keep this available as an option to those who want to use it.

    You can take a look at the project here: http://code.google.com/p/gimp-startrail-compositor/ . I realise this is a bit geeky for a page but I haven’t got round to making a more user friendly page for it away from the project hosting.

    1. Steven Christenson

      I’ll take a look when I can, however I know that averaging in Photoshop works by changing the opacity in Normal mode to 1/N where N is the rank up from the bottom of the layer stack. I give the formula here (in the video). You didn’t say what blend mode you’re using, but it sounds like Linear Add (or Add)

      The blend mode math is described here. Looks like you definitely want subtract rather than difference though I found in practice it doesn’t seem to matter.

      Please note that as I indicated dark frames won’t fix your noise – just your hot pixels and your black level.

      1. Chris

        Thanks, I’ve updated the plugin based on your comments. The 1/n was what it used to be but it didn’t seem right to me, so I changed it. I have now put it back.

  2. John Pelafigue

    Do I wanta thank you for this simple explanation. Mr. _ _ _ _ _ talks about dark frames and never says what they are, how to get one. I felt like I’d missed the first chapter, but of course I hadn’t. Phd’s just assume people know certain things, I guess.

    1. Clive

      Excellent article, and despite what Mr Pelafigue you do make it very clear what a dark frame is and how to produce it. I have just started to experiment with Deepsky Stacker which is quite complicated and not for the novice and thanks to your article I should now be able to get some reasonable results. Maybe Mr Palefinger should stick to his colouring in books 🙂

      1. Steven Christenson Post author

        I took Mr. Palefinger’s response as a contrast between the article above and some other person (Mr. ____) whom he didn’t want to name. If it was umbrage for us (Steven – the author), no worries there, either.

        And you are correct… knowing what a dark frame, light frame, bias (offset) frame, are makes DeepSkyStacker more useful and less magical.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.