<sect3 id="editor-transform-resize">
    <sect3info>

        <title>Change the image size</title>

        <abstract>

            <para>
                <ulink url="http://cimg.sourceforge.net"><inlinemediaobject>
                <imageobject><imagedata fileref="&path;logo-cimg.png" format="PNG"/></imageobject>
                <textobject><phrase>cimglogo</phrase></textobject>
                </inlinemediaobject></ulink>
            </para>

            <para>
                The &digikam; <emphasis>Blowup Photograph</emphasis> is definitely one of the most advanced tools to increase a photograph's size with minimal loss in image quality.
            </para>

        </abstract>

        <keywordset>
        <keyword>Cimg</keyword>
        <keyword>Greycstoration</keyword>
        </keywordset>

    </sect3info>

    <title>Introduction</title>

    <para>
        Rescaling an image to make it smaller is easy. The big question is: how can you blow up an image and keep the details sharp? How can one zoom in when the resolution boundary has been reached? How can one reinvent or guess the missing information to fill in the necessarily coarse image after upsizing? Well, the CImg algorithm we use here does an excellent job, try it out and see for yourself!
    </para>

    <sect4 id="using-resizingimage"> <title>Resizing a Photograph</title>

        <anchor id="resizetool.anchor"/>

        <para>
            If the photograph has the wrong size, you can scale it to the size you would like by using Transform Resize tool. Select <menuchoice><guimenu>Transform</guimenu><guimenuitem>Resize</guimenuitem></menuchoice> and adjust the target values. The Resize tool dialog is available below.
        </para>

        <example><title>The Resize Tool Dialog</title>
            <screenshot><screeninfo>The Resize Tool Dialog</screeninfo><mediaobject><imageobject><imagedata fileref="&path;editor-resize.png" format="PNG" /> </imageobject></mediaobject></screenshot> 
        </example>

        <para>
            This image resizing tool uses a standard linear interpolation method to approximate pixels. If you want to up-size a small image with a better quality, try the Blowup tool.
        </para>

    </sect4>


    <sect4 id="using-resizerestoration"> <title>Increasing image size (Restoration)</title>
        <para>
            Many image editing programs use some kind of interpolation &eg; spline interpolation to scale-up an image. &digikam; uses a more sophisticated approach. The algorithm underlying <emphasis>Restoration</emphasis> has been developed by the IMAGE team of GREC CNRS lab in Caen/France and is a part of the <ulink url="http://cimg.sourceforge.net">CImg project</ulink>.
        </para>

        <para><inlinemediaobject><imageobject> 
            <imagedata fileref="&path;editor-resize-restoration.png" format="PNG" /> </imageobject>
            <textobject><phrase>Blowup Photograph Dialog</phrase></textobject></inlinemediaobject>
        </para>

        <para>You have to tell the tool about the resizing you want to do. These settings are available in <guilabel>New Size</guilabel> tab and are listed below:

        <itemizedlist>

        <listitem><para><guilabel>Maintain Aspect Ratio</guilabel>: if this option is enabled, setting the new image size will preserve the aspect ratio of the original image.</para></listitem>
        <listitem><para><guilabel>Width</guilabel>: the new image width to use for blowing up.</para></listitem> 
        <listitem><para><guilabel>Height</guilabel>: the new image height to use for blowing up.</para></listitem>

        </itemizedlist>
        </para>

        <para>
            If you want to set filter parameters for finer adjustments, use <guilabel>Smoothing Settings</guilabel> and <guilabel>Advanced Settings</guilabel> tabs:
        </para>

        <para><inlinemediaobject><imageobject> 
            <imagedata fileref="&path;editor-resize-restoration-settings1.png" format="PNG" /> </imageobject>
            <textobject><phrase>Photograph Blowup Smoothing Settings</phrase></textobject></inlinemediaobject>
        </para>

        <para>
        <itemizedlist>

            <listitem><para><guilabel>Detail Preservation</guilabel> p [0, 100]: this controls the preservation of the curvatures (features). A low value forces an equal smoothing across the image, whereas bigger values preferably smooth the homogeneous regions and leaves the details sharper. A value of 0.9 should well preserve details so that no sharpening is required afterwards. Note that <guilabel>Detail Preservation</guilabel> must be always inferior to <guilabel>Anisotropy</guilabel>.</para></listitem>
            <listitem><para><guilabel>Anisotropy</guilabel> alpha [0, 100]: a low value smooths equally in all directions, whereas a value close to 1 smooths in one direction only. If you have film grain or CCD kind of noise a high value will result in wave-like pattern, whereas JPEG artifacts are suited for values close to 1. </para></listitem>
            <listitem><para><guilabel>Smoothing</guilabel> [0, 500]: this sets the maximum overall smoothing factor (when p defines the relative smoothing). Set it according to the noise level.</para></listitem>
            <listitem><para><guilabel>Regularity</guilabel> [0, 100]: this parameter is concerned with the bigger structures. The bigger this value, the more even the overall smoothing will be. This is necessary when much noise is present since it is then difficult to estimate the geometry. Also if you want to achieve a 'van Gogh' turbulence effect, setting it higher than 3 is recommended.</para></listitem>
            <listitem><para><guilabel>Filter Iterations</guilabel>: number of times the blurring algorithm is applied. Usually 1 or 2 is sufficient.</para></listitem>

        </itemizedlist>
        </para>

        <para><inlinemediaobject><imageobject>
            <imagedata fileref="&path;editor-resize-restoration-settings2.png" format="PNG" /> </imageobject>
            <textobject><phrase>Photograph Blowup Advanced Settings</phrase></textobject></inlinemediaobject>
        </para>

        <para>
            <itemizedlist>

                <listitem><para><guilabel>Angular Step</guilabel> da [5, 90]: angular integration of the anisotropy alpha. If alpha is chosen small, da should also be chosen small. But beware, small angles result in long runs! Choose it as large as you can accept. </para></listitem>
                <listitem><para><guilabel>Integral Step</guilabel> [0.1, 10]: spatial integration step width in terms of pixels. Should remain less than 1 (sub-pixel smoothing) and never be higher than 2.</para></listitem>
                <listitem><para><guilabel>Use Linear Interpolation</guilabel>: The gain in quality if you select this option is only marginal and you lose a factor of 2 in speed. Our recommendation is to leave it off.</para></listitem>

            </itemizedlist>

        </para>

        <para>
            <guilabel>Save As...</guilabel> and <guilabel>Load...</guilabel> buttons are used to do just that. Any Blowup Photograph filter settings that you have set can be saved to the filesystem in a text file and loaded later.
        </para>

        <warning><para>
            Blowup Photograph is very fast in what it is doing, but it can take a long time to run and cause high CPU load. You may always abort computation by pressing <guilabel>Cancel</guilabel> button during rendering.
        </para></warning>

    </sect4>

    <sect4 id="inaction-resizerestoration">
        <title>The blow-up tool in action</title>

        <para>
        You can see below an Blowup Photograph example applied to a small color image area resized to x2. The original is (1), the Blowup result (3). The (2) preview is the result given to standard linear resizing method to compare.
        </para>

        <para><inlinemediaobject><imageobject> 
            <imagedata fileref="&path;editor-resize-restoration-preview.png" format="PNG" /> </imageobject>
            <textobject><phrase>Blowup Photograph Filter Preview</phrase></textobject></inlinemediaobject>
        </para>

    </sect4>

</sect3>

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