<sect3 id="editor-color-levels">
    <sect3info>

    <title>Adjust Levels</title>

    <abstract>
    <para>
        The &digikam; <emphasis>Adjust Levels</emphasis> is a tool to manually adjust the histogram channels of an image.
    </para>
    </abstract>

    </sect3info>

    <title>Introduction</title>

    <para>
        Situated between the more sophisticated Adjust Curves tool and the simpler Brightness/Contrast/Gamma Image Editor tool 
        is this Adjust Levels tool for improving exposure. Although the dialog for this tool looks very complicated, 
        for the basic usage we have in mind here, the only part you need to deal with is the
        <guilabel>Input Levels</guilabel> area, concretely the 3 sliders that appear below the histogram.
    </para>

    <para>
        This widget contains a visual graph of the intensity values of the active layer or selection (histogram).
        Below the graph are five sliders that can be clicked into and dragged to constrain and change the intensity
        level for the image. The left sliders position represents the dark areas and similarly,
        the right position represents the light areas.
    </para>

    <sect4 id="using-adjustlevels">
        <title>Using the Adjust Levels tool</title>

        <para>
            <inlinemediaobject><imageobject>
                <imagedata fileref="&path;editor-levelsadjust.png" format="PNG" /> </imageobject>
                <textobject><phrase>The Adjust Levels Tool Dialog</phrase></textobject>
            </inlinemediaobject>
        </para>

        <para>
            Actually the easiest way to learn how to use it is to experiment by moving the three sliders around,
            and watching how the image is affected.
        </para>

        <para>
            On the right, both an original and a target preview image is available. 
            The target preview is updated dynamically according to the slider positions. On the left, the following options are available:

            <itemizedlist>

            <listitem><para>
            Modify levels for <guilabel>Channel</guilabel> : this combo box allows the selection of the specific
            channel that will be modified by the tool:

                <itemizedlist>
                    <listitem><para><guilabel>Luminosity</guilabel>: this option makes intensity changes against
                    all pixels in the image.</para></listitem>
                    <listitem><para><guilabel>Red</guilabel>: this option makes Red saturation changes against
                    all pixels in the image.</para></listitem>
                    <listitem><para><guilabel>Green</guilabel>: this option makes Green saturation changes against
                    all pixels in the image.</para></listitem>
                    <listitem><para><guilabel>Blue</guilabel>: this option makes Blue saturation changes against
                    all pixels in the image.</para></listitem>
                    <listitem><para><guilabel>Alpha</guilabel>: this option makes transparency changes against
                    all pixels in the image.</para></listitem>
                </itemizedlist>

            </para></listitem>

            <listitem><para>Set <guilabel>Scale</guilabel> for channel : this combo controls whether the histogram
            will be displayed using a linear or logarithmic amplitude. For images taken with a digital camera, the linear
            mode is usually the most useful. However, for images that contain substantial areas of constant color a
            linear histogram will often be dominated by a single bar. In this case a logarithmic histogram will often
            be more useful.</para></listitem>

            <listitem><para><guilabel>Input Levels</guilabel>: the input levels allow manual adjustments to
            be selected for each of the ranges. The main area is a graphic representation of image dark, mid and light tones content. They are on abscissa from level 0 (black) to level 255 (white).
            Pixel number for a level is on ordinate axis. The curve surface represents all the pixels of the image for the selected channel (histogram). A well balanced image is an image with levels
            (tones) distributed all over the whole range. An image with a predominant blue color, for example,
            will produce a histogram shifted to the left in Green and Red channels, manifested by green and
            red color lacking on highlights. The level ranges can be modified in three ways:
                <itemizedlist>
                    <listitem><para>
                    Three sliders: the first on the top for dark tones, the second one for light tones, and the last one on the bottom for midtones (often called Gamma value).
                    </para></listitem>
                    <listitem><para>
                    Three input boxes to enter values directly.
                    </para></listitem>
                    <listitem><para>
                    Three Color Picker buttons using the original photo preview to automatically adjust inputs levels settings for shadow, midtone and highlights. There is also a fully automated adjustment button available next to the reset button.
                    </para></listitem>
                </itemizedlist>
            </para></listitem>

            <listitem><para><guilabel>Output Levels</guilabel>: the output levels allow manual selection
            of a narrowed-down output level range. There are also two sliders located here that can be used
            to interactively change the output levels like <guilabel>Input Levels</guilabel>.
            This output level compression may, for example, be used to create a bleached image as a background for some other subject to put into the foreground.</para></listitem>

            <listitem><para><guilabel>Auto</guilabel>: this button performs an automatic setting of the
            levels based on the pixel intensities of the image.</para></listitem>

            <listitem><para><guilabel>Save As</guilabel> and <guilabel>Load</guilabel>: these buttons are used
            to do just that. Any Levels that you have set can be saved to the filesystem and loaded later.
            The used file format is The Gimp Levels format.</para></listitem>

            <listitem><para><guilabel>Reset All</guilabel>: this button reset all
            <guilabel>Input Levels</guilabel> and <guilabel>Output Levels</guilabel> values for all
            channels.</para></listitem>

            </itemizedlist>
        </para>

        <para>
            The Adjust Levels tool has several features to facilitate the positioning input levels sliders. 
            Clicking the mouse button in the original image preview area produces a vertical doted bar in the graph area of the histogram. 
            The bar position corresponds to the pixel value under the mouse cursor in the image window. Clicking and dragging the mouse button 
            interactively updates the position of the vertical bar. In this way it is possible to see where different pixel values in the image 
            are located on the input levels sliders and helps to discover the locations of shadow, midtone, and highlight pixels.
        </para>

        <para>
            Using in this mode and the three <guilabel>Color Picker</guilabel> buttons will automatically adjust input levels settings in all channels for 
            shadow, middle, and highlight tones. Enable the color picker button that you want use, and click on the original image preview area to set input 
            levels on each of the Red, Green, Blue, and Luminosity histogram channels.
        </para>

        <para>
            <guilabel>Over Exposure Indicator</guilabel> option checks all color channel to see if more than one channel in a pixel is over-exposed, 
            and you will see the combined color resulting of channel level settings. 
            This feature is available as an indicator in the target preview area and has no effect on final rendering.
        </para>

        </sect4>

    <sect4 id="inaction-adjustlevels">
    <title>The Adjust Levels tool in action</title>

    <para>
        Below, you can see an <guilabel>Input levels</guilabel> adjustment example applied to a color image for the Red/Green/Blue channels. Intensity/Alpha channels and <guilabel>Output Levels</guilabel> are unchanged. The original image is (1), the corrected image (2).
    </para>

    <para>
        <inlinemediaobject>
            <imageobject><imagedata fileref="&path;editor-levels-preview.png" format="PNG" /> </imageobject>
            <textobject><phrase>The Adjust Levels Tool in Action</phrase></textobject>
        </inlinemediaobject>
    </para>

    </sect4>

</sect3>

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