<chapter id="hotpixels">
<chapterinfo>

<title>Hot Pixels Correction</title>

<authorgroup>
    <author>
        <firstname>Gilles</firstname><surname>Caulier</surname>
        <affiliation><address><email>caulier dot gilles at free.fr</email></address></affiliation>
    </author>
    <author>
        <firstname>Unai</firstname><surname>Garro</surname>
        <affiliation><address><email>ugarro at telefonica dot net</email></address></affiliation>
    </author>
</authorgroup>

<abstract>
<para>
The digiKam image plugin <emphasis>Hot Pixels</emphasis> 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.
</para>
</abstract>

<keywordset>
<keyword>KDE</keyword>
<keyword>Digikam</keyword>
</keywordset>

</chapterinfo>

<title>Introduction</title>

<para>
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":

<itemizedlist>

  <listitem><para>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.</para></listitem>
    
  <listitem><para>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.</para></listitem>
 
  <listitem><para>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.</para></listitem>

</itemizedlist> 

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.
</para>
<para>

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).
</para>

<para>
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. 
</para>

<sect1 id="using-plugin-blackframecreation">
<title>Create the Black Frames</title>

<para>
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.
</para>
 
<para>
Load this file to the plugin using the <guilabel>Black Frame</guilabel> button. The plugin will process an automatic detection of Hot and Stuck Pixels. They will be highlighted in the control panel preview areas.
</para>

<warning><para>
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.
</para></warning>

</sect1>

<sect1 id="using-plugin-hotpixels">
<title>Using the plugin</title>

<figure>
    <title>Hot Pixels Tool Dialog</title>
    <graphic srccredit="Hot Pixels Tool Dialog" fileref="hotpixelsdialog.png"/>
</figure>

<para>
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.
</para>

<para>
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.
</para>

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

<itemizedlist>

  <listitem><para>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.</para></listitem>
    
  <listitem><para>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.</para></listitem>
  
  <listitem><para>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.</para></listitem>
  
  <listitem><para>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.</para></listitem>

</itemizedlist> 

</para>

</sect1>

<sect1 id="inaction-plugin-hotpixels">
<title>The plugin in action</title>

<para>
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).
</para>

<figure>
    <title>Hot Pixels Correction Preview</title>
    <graphic srccredit="Hot Pixels Correction Preview" fileref="hotpixelspreview.png"/>
</figure>

</sect1>

</chapter>

<!--
Local Variables:
mode: sgml
sgml-omittag: nil
sgml-shorttag: t
End:
-->

