# Hot Pixels Correction

Gilles
Caulier

    caulier dot gilles at free.fr

Unai
Garro

    ugarro at telefonica dot net

The digiKam image plugin Hot Pixels will allow you to remove hot pixels on a photograph taken with a defective camera CCD. It uses algorithms from JPEGPixi project and copyrighted by Martin Dickopp.

KDE
Digikam

# Introduction

Most current digital cameras produce images with numerous brightly colored "bad pixels" when using slow shutter speeds. Night pictures can be ruined by these "bad pixels". There are three different types of "bad pixels":

- Stuck pixels: it's a pixel that always reads high or is always on to maximum power on all exposures. This produces a bright pixel usually of red, blue or green color in the final image. A Stuck pixel will occur regardless of shutter speed, aperture size or any other user settings. It will occur on a normal exposure and tends to be more obvious under bright condition.

- Dead pixels: it's a pixel that reads zero or is always off on all exposures. This state produces a black pixel in the final image. Similar to Stuck pixel, a Dead pixel will occur regardless of shutter speed, aperture size or any other user settings.

- Hot pixels: it's a pixel that reads high (bright) on longer exposures as white, red, or green color. The longer the exposure time, the more visible hot pixels will become. These pixels will not be visible in bright conditions.

Do note that Stuck or Dead pixels will occur at the same location for all images. If the location of the Stuck or Dead pixel occurs at different location, it may be a Hot Pixel.

Stuck, Dead or Hot pixels are a problem in particular when shooting in high quality raw mode since many cameras have built-in hot pixel suppression applied automatically when JPEG compression is used (which is mostly the case).

This plugin can be used to fix the "Hot pixels" and "Stuck Pixels" on a photograph using a Black Frame subtraction method. There is no yet a manual editor to select bad pixels.

## Create the Black Frames

The Black Frame substraction method is the most accurate "Hot Pixels" and "Stuck Pixels" removal. First you have to create a "Black Frame" as a reference. This is easy to do. When you finish taking your long exposure shots, put a lens cap on the camera and take one "dark" image with the same exposure time as the images before. This image will be all dark, but with close examination you will see that it has the Hot and Stuck Pixels (colored dots). These are positioned at the same place as on your previous shots.

Load this file to the plugin using the Black Frame button. The plugin will process an automatic detection of Hot and Stuck Pixels. They will be highlighted in the control panel preview areas.

If you use an old digital camera, it is important to re-shoot the Black Frame next time you are taking a long exposure pictures to detect new Hot and Stuck Pixels on CCD defects.

## Using the plugin

### Hot Pixels Tool Dialog

At first as explained in the previous section you need to load a Black Frame corresponding to the image to correct. An automatic parsing will be processed on the Black Frame to find bad pixels. Note that the plugin will remember the previous Black Frame used on the last plugin session and it will be re-opened automatically with the next session.

The image panel and the original preview help you to pan within the image. The preview window shows the filter output using the current settings. Bad Pixels are highlighted on all preview areas.

Select an area to see bad pixels on preview and the filter result using 'Separate View' options of image panel. Choose the best Filter method to interpolate pixels or pixel blocks. These are the available filters:

- Average: the pixels adjacent to the pixel block are averaged. The resulting color is assigned to all pixels in the block. For 1-dimensional interpolation, this is done separately for one pixel-wide, horizontal or vertical stripes.

- Linear: the pixels which have a distance of 1 from the pixel block are used to calculate a bilinear surface (2-dim), or a group of linear curves (1-dim), which is then used to assign interpolated colors to the pixels in the block.

- Quadratic: this is the default filtering method. The pixels which have a distance of 2 or less from the pixel block are used to calculate a biquadratic surface (2-dim), or a group of quadratic curves (1-dim), which is then used to assign interpolated colors to the pixels in the block.

- Cubic: the pixels which have a distance of 3 or less from the pixel block are used to calculate a bicubic surface (2-dim), or a group of cubic curves (1-dim), which is then used to assign interpolated colors to the pixels in the block.

## The plugin in action

Below, you can see the Hot Pixels Correction plugin applied to a color photograph taken with a defficient digital camera at 200 ISO sensitivity with a long exposure shot. The original image magnified to 300% is (1), the corrected image (2).

### Hot Pixels Correction Preview