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

    <title>Adjust Curves</title>

    <abstract>
    <para>
        The &digikam; <emphasis>Adjust Curves</emphasis> is a tool to non-linearly adjust luminosity graduation and color channels.
    </para>
    </abstract>

    </sect3info>

    <title>Introduction</title>

    <para>
    The Adjust Curves tool is the most sophisticated tool available to adjust the images' tonality. Start it from the <menuchoice><guimenu>Color</guimenu> <guimenuitem>Curves Adjust...</guimenuitem></menuchoice> Image Editor menu.
    It allows you to click and drag control points on a curve to create a free function mapping input brightness levels to output brightness levels. The Adjust Curves tool can replicate any effect you can achieve with Brightness/Contrast/Gamma or the Adjust Levels tool, though it is more powerful than either one of them.

    But this tool can do more for you, it helps you to improve the tonal quality of your photographs to very finely stepped gray scales. And do not forget that the better the photographs are (good exposure, lossless format, 24 or 32 bit deep) the more you can improve them. Navigate to the "Achieving ultimate tonal quality" section of this instructive page: <ulink url="http://www.normankoren.com/digital_tonality.html">Tonal quality and dynamic range in digital cameras by Norman Koren</ulink>. Use Adjust Curves tool to do just the same!
    </para>
    <para>
    This tool provides visual curves to modify the intensity values of the active layer displayed as a histogram non-linearily. In <guilabel>Curve smooth mode</guilabel>, you change the curves shape by adding new points to the curve or by moving end point positions. Another way, is to draw all the curve manually in <guilabel>Curve free mode</guilabel>. In both cases the effect is immediately displayed in the image preview area to the left, where the preview can be configured by clicking on the top left icons.
    </para>

        <sect4 id="using-adjustcurves">
        <title>Using Adjust Curves</title>

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

        <para>
        To the left, half of the original and the target preview image is shown. The target preview is updated dynamically according to the widget settings. On the right side the following options are available:

        <itemizedlist>

        <listitem><para>
        Modify <guilabel>Channel</guilabel> : with this combo box you can select the specific channel to be modified by the tool:

            <itemizedlist>
                <listitem><para><guilabel>Luminosity</guilabel>: changes the intensity of all pixels.</para></listitem>
                <listitem><para><guilabel>Red</guilabel>: changes the Red saturation of all pixels.</para></listitem>
                <listitem><para><guilabel>Green</guilabel>: changes the Green saturation of all pixels .</para></listitem>
                <listitem><para><guilabel>Blue</guilabel>: changes the Blue saturation of all pixels.</para></listitem>
                <listitem><para><guilabel>Alpha</guilabel>: changes the transparency of all pixels.</para></listitem>
            </itemizedlist>

        </para></listitem>

        <listitem><para>
        Next to this box are two icons to select linear or logarithmic histogram display. For images taken with a digital camera the linear mode is usually the most useful. However, for images containing substantial areas of constant color, a linear histogram will often be dominated by a single bar. In this case a logarithmic histogram will be more appropriate.
        </para></listitem>

        <listitem><para>
        Main Curves Editing Area: the horizontal bar (x-axis) represents input values (they are value levels from 0 to 255). The vertical bar (y-axis) is only a scale for output colors of the selected channel.  The control curve is drawn on a grid and crosses the histogram diagonally. The pointer x/y position is permanently displayed above the grid. If you click on the curve, a control point is created. You can move it to bend the curve. If you click outside the curve, a control point is also created, and the curve includes it automatically. So each point of the curve represents an 'x'  translated into a 'y' output level.
        </para></listitem>

        <listitem><para>
        Curve <guilabel>Type</guilabel> for channel : below the editing area are several icons that determine whether the curve can be edited using a <guilabel>Curve smooth mode</guilabel> curve or a <guilabel>Curve free mode</guilabel>. Smooth mode constrains the curve type to a smooth line with tension and provides a realistic rendering. Free mode lets you draw your curve free-hand with the mouse. With curve segments scattered all over the grid, result will be surprising but hardly repeatable. A reset-to-defaults button is also available.
        </para></listitem>

        <listitem><para>
        If, for example, you move a curve segment to the right, &ie; to highlights, you can see that these highlights are corresponding to darker output tones and that image pixels corresponding to this curve segment will go darker.
        </para></listitem>

        <listitem><para>
        With color channels, moving right will decrease saturation up to reaching complementary color. To delete all control points (apart from both end points), click on the <guilabel>Reset</guilabel> button. To delete only one  point, move it onto another point. Just ply with the curves and watch the results. You even can solarize the image on part of its tonal range. This happens when the curve is inverted in some part.
        </para></listitem>

        <listitem><para>
        The original photo preview has a red marker on it. If you place this marker to a zone you want to modify, a corresponding line will be drawn on the curve grid indicating the original value. Create a point on that line and move it up or down to adjust it to your pleasing.
        </para></listitem>

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

        <listitem><para>
        <guilabel>Reset</guilabel>: this button resets all curve values for all channels.
        </para></listitem>

        </itemizedlist>

        </para>

        <para>
        The curves tool has several features that facilitate the positioning of points on the control curves. Clicking the mouse button in the original image preview area produces a vertical doted bar in the graph area of the curves tool. The bar position corresponds to the pixel value the mouse cursor is over 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 control curve and helps to discover the locations of shadow, midtone, and highlight pixels.
        </para>

        <para>
        Using this way and the three <guilabel>Tone Color Picker</guilabel> buttons will automatically create control points on the curve in all channels for shadow, middle, and highlight tones. Enable the color picker button that you want to use, and click on the original image preview area to produce control points on each of the Red, Green, Blue, and Luminosity control curves.
        </para>
        <!-- TODO: digiKam 5.6.0 - this option does not exist (new screenshot)
        <para>
        <guilabel>Over Exposure Indicator</guilabel> option adds up all color channels and indicates the blown-out highlights. If more than one channel in a pixel is over-exposed you will see the combined color resulting from the curve settings. The display is an indicator only and has no effect on the final rendering.
        </para> -->

        </sect4>

        <sect4 id="inaction-adjustcurves">
        <title>The Adjust Curves in action</title>

        <para>
        Below you can see a black and white photograph corrected in <guilabel>Luminosity</guilabel> channel. Shadow and highlight tone picker tool have been use to determined the curves to apply from original. The original image is (1), the corrected image (2).
        </para>

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

        </sect4>

    </sect3>

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