Global Hot Pixel Removal and Signal-based Noise Reduction (Ai-free!)

Introduction

Summertime landscape astrophotography in the southwest can be seriously sweat-inducing. Chances are that if you’re standing in one place and still feel hot, so does your camera sensor!

The aptly named ‘hot pixel’ is a defective pixel or grouping of subpixels that becomes most noticeable when the temperature of the sensor gets too hot. The sensor temperature is influenced by operation duration and the ambient air temperature, among other factors. The high temperature makes the sensor more prone to current leaks, which disproportionately affect the values of these defective pixels.

There’s nothing wrong with your camera! It is completely normal for cameras to behave like this, even for high-end/prosumer deep space cameras.

Traditionally, deep-space setups make use of a cooler and dark frames to get rid of hot pixels. Since hot pixels don’t change places between images, deep space astrophotographers can easily remove them by stacking a series of ‘dark frames’. For us landscape-astrophotographers however, dark frames are rarely a realistic option.

Here’s why: practical applications of photography like timelapses or image stacking (both covered in this example) take a lot of time to complete. During this time, the ambient temperature can fluctuate quite a bit, especially for something like a timelapse that is set to run all night. As a result, the single-image distribution of hot pixels can vary quite a bit. Should you take dark frames in these conditions, you will find that your dark stack is unrepresentative of the conditions when you were taking your photos. In other words, since our relatively convenient DSLR and mirrorless cameras don’t come with built in temperature regulators like the astrocams do, we can end up subtracting too many or too few hot pixels using our post-hoc dark frames, leaving us back at step 1 with several visible artifacts– some appearing quite large.

This is where synthetic darks come in hand.

The advantages of using synthetic darks:

  • Image local – no need to worry about variance
  • Easy to create on many different image editing software
  • Practical for timelapse cleaning
  • Practical for transforming a timelapse (motion or static) sequence into a stacked image
  • They preserve surrounding noise without introducing any additional noise
  •  Can still be incorporated into a non-destructive workflow
  • Can be applied to thee image globally – no need to mask with brushes.
  • Expandable to cover several different editing situations
Tutorial

Disclaimer, techniques making use of synthetic darks alone will work best on foreground images. To extend this technique to the sky portion of the image, you’d have to remove the stars using an Ai tool like StarNet (free) or StarXterminator (paid), or use a process called Cosmetic Correction that can be found in SiriL (free) and Pixinsight (paid), which uses statistical analysis of a dark frame or dark stack to remove hot pixels anywhere in the image. I would highly recommend SiriL and StarNet to those starting out as both are incredibly powerful tools. You can accomplish high level edits using these without ever having to move to the paid software, I say as someone who owns both.

The example I will be using to demonstrate synthetic darks and noise reduction is a 10 image sequence from a larger motion timelapse I took of the aurora that I have turned into a stand-alone image. This requires image alignment which I will be skipping. The movement of elements in the scene also increases the effectiveness of the stacking for noise reduction. For a static timelapse stack, I would instead opt to use the synthetic dark as a mask to content-aware fill the hot pixels. For static timelapse video cleaning, a stacked synthetic dark could be used to remove the average hot pixel variation from the full video sequence as a subtraction overlay. Since a synthetic dark stack is essentially a model for the video’s hot pixels, you shouldn’t see much improvements to the stack after incorporating ~30 images.

The lowered noise in the comparison image at the beginning of the post is purely a result of image stacking, which is inherently Ai-free.

Step 1

Using photoshop, go to File -> Scripts -> Load images into stack, and select as many images as you would like. I will be selecting 10 to try to limit the scratch disk space used. These can be raw images or tiffs. I wouldn’t recommend much beyond simple color correction as far as edits go. Before exporting tiffs or closing camera raw, I would recommend sliding distortion correction to zero (0) to avoid ringing artifacts when stacking.

For images taken from a motion timelapse sequence, check ‘attempt to automatically align source images’ before clicking ‘OK’. Images shot on a static tripod may be able to avoid this step.

Below is a simulated stack to illustrate the problem, and where the image-local-ness of synthetic darks comes into play.

Zooming in (right) shows how pervasive the problem is.

Lots of pixels are smearing across the stacked frame. Not even all of the hot pixels are smearing the same way.

By quickly targeting hot pixels in each image BEFORE stacking, we can keep the noise reduction benefits while removing a ton of hot pixels, even small ones!

Step 2

Put each image into a group folder and duplicate them twice within their groups. Then turn off all other groups but the first one you’d like to work on. When you’re done, your layers tab should look like this (right). 

Step 3

Select the top copy in the group, then go to Filter -> Noise -> Dust and Scratches. 

Play around with the radius and threshold until most of the hot pixels are gone. I used a radius of 7 and a threshold of 57 for the first image, but don’t take these numbers as gospel! They will change slightly from image to image, and depend on your pixel size/megapixel count (MP count assumes the same sensor size). Check and uncheck the preview button to get a better look. A higher radius will be more aggressive and conversely, a low threshold will be aggressive. 

 

 

Slide the slider on the right to see the preview on vs off.

 

 

Don’t worry, the movement between images is just because I used imprecise screenshots!

Step 4

There are a few ways to create the synthetic dark from here. The most intuitive to me is to change the blend mode of your dust and scratches layer to ‘subtract’ and then selecting both of your copies and then right clicking and selecting ‘Merge Layers’ (or using your operating system’s keyboard shortcuts). 

Alternatively you could select your first copy and go to Image -> Apply Image… 

If you’re using the apply image route just make sure to change the target off of ‘merged’ to your dust and scratches layer, and set the blend mode to ‘subtract’ with an offset of zero (0). 

Afterwards, you should have your original layer, and a dark layer with all the hot pixels, plus whatever else the dust and scratches filter picked up. I will be referring to this layer from now on as the ‘hot pixel layer’.

Step 4a

This step can be optional, depending on the image.

The purpose of this step is to remove some of the natural sensor noise that the dust and scratches filter picked up on to better optimize the stacking process down the line. This has the added benefit of softening the hot pixel subtraction and reducing the likelihood of leaving sharp holes where your hot pixels once were. Remember, we want to do out best to select only hot pixels using this layer. There are more precise ways of doing this, Despeckle is primarily for speed.

For this step, select your hot pixel layer, then go to Filter -> Noise -> Despeckle and it will clean it up as seen on the right.

Step 5

Set your hot pixel layer’s blend mode to ‘Subtract’.

Repeat Steps 3-4 for each of the other groups you made.

Once you have subtracted the hot pixels from each image, select and merge each group so that you have 10 flattened images with hot pixels removed in your layers tab. Select them all, and then convert them to a smart object. From here, go to Layer -> Smart objects -> Stack mode, and choose a stack mode. I typically stick with the Mean as a starting point.

Note: Selecting and converting the group folders into a smart object will not preserve the subtraction blend modes on each hot pixel image. This is why we need to merge each group separately first.

Step 6

Congratulate yourself for creating your first image stack with synthetic darks to remove hot pixels!

As mentioned previously, if your images don’t move between frames you can save time by making a synthetic dark from your final image stack instead, and then subtract it or use it as a mask.

Save your image and continue working on it with your usual workflow!