home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <title>5.5.  Threshold</title>
- <link rel="stylesheet" href="gimp-help-plain.css" type="text/css" />
- <link rel="stylesheet" href="gimp-help-screen.css" type="text/css" />
- <link rel="stylesheet" href="gimp-help-custom.css" type="text/css" />
- <link rel="alternate stylesheet" href="gimp22.css" type="text/css" title="gimp22" />
- <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
- <link rel="start" href="index.html" title="GNU Image Manipulation Program" />
- <link rel="up" href="gimp-tools-color.html" title="5.  Color Tools" />
- <link rel="prev" href="gimp-tool-brightness-contrast.html" title="5.4.  Brightness-Contrast tool" />
- <link rel="next" href="gimp-tool-levels.html" title="5.6.  Levels" />
- </head>
- <body>
- <div class="navheader">
- <table width="100%" summary="Navigation header">
- <tr>
- <th colspan="3" align="center">5.5. 
- <span lang="en" xml:lang="en">Threshold</span>
- </th>
- </tr>
- <tr>
- <td width="20%" align="left"><a accesskey="p" href="gimp-tool-brightness-contrast.html"><img src="../images/prev.png" alt="Prev" /></a> </td>
- <th width="60%" align="center">5. 
- <span lang="en" xml:lang="en">Color Tools</span>
- </th>
- <td width="20%" align="right"> <a accesskey="n" href="gimp-tool-levels.html"><img src="../images/next.png" alt="Next" /></a></td>
- </tr>
- </table>
- <hr />
- </div>
- <div class="sect2" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h3 class="title"><a id="gimp-tool-threshold"></a>5.5. 
- <span lang="en" xml:lang="en">Threshold</span>
- </h3>
- </div>
- <div>
- <div class="revhistory">
- <table border="1" width="100%" summary="Revision history">
- <tr>
- <th align="left" valign="top" colspan="3">
- <b>Revision History</b>
- </th>
- </tr>
- <tr>
- <td align="left">Revision $Revision: 2429 $</td>
- <td align="left">2008-01-05</td>
- <td align="left">j.h</td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- </div>
- <a id="id2644937" class="indexterm"></a>
- <a id="id2644952" class="indexterm"></a>
- <p>
- The Threshold tool transforms the current layer or the selection into a
- black and white image, where white pixels represent the pixels of the
- image whose Value is in the threshold range, and black pixels represent
- pixels with Value out of the threshold range.
- </p>
- <p>
- You can use it to enhance a black and white image (a scanned text for
- example) or to create selection masks.
- </p>
- <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
- <table border="0" summary="Note">
- <tr>
- <td rowspan="2" align="center" valign="top" width="25">
- <img alt="[Note]" src="../images/note.png" />
- </td>
- <th align="left">Note</th>
- </tr>
- <tr>
- <td align="left" valign="top">
- <p>
- As this tool creates a black and white image, the anti-aliasing of the
- original image disappears. If this poses a problem, rather use the
- <a class="link" href="gimp-tool-levels.html" title="5.6.  Levels">Levels </a> tool.
- </p>
- </td>
- </tr>
- </table>
- </div>
- <div class="sect3" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h4 class="title"><a id="id2644999"></a>5.5.1. 
- <span lang="en" xml:lang="en">Activate the Tool</span>
- </h4>
- </div>
- </div>
- </div>
- <p>
- You can access this tool from the image menu through
- <span class="guimenu"><span class="accel">T</span>ools</span> ‚Üí <span class="guisubmenu"><span class="accel">C</span>olor Tools</span> ‚Üí <span class="guimenuitem"><span class="accel">T</span>hreshold,</span>,
- </p>
- <p>
- or through
- <span class="guimenu">Colors</span> ‚Üí <span class="guimenuitem">Threshold</span>,
- </p>
- <p>
- or by clicking on the
- <span class="guiicon">
- <span class="inlinemediaobject"><img src="../images/toolbox/stock-tool-threshold-22.png" /></span>
- </span>
- icon in Toolbox if this tool has been installed in it. You can do
- that through the <a class="link" href="gimp-dialogs-misc.html#gimp-tools-dialog" title="5.1.  Tools Dialog">Tool dialog</a>.
- </p>
- </div>
- <div class="sect3" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h4 class="title"><a id="id2645101"></a>5.5.2. 
- <span lang="en" xml:lang="en">Options</span>
- </h4>
- </div>
- </div>
- </div>
- <div class="figure">
- <a id="id2645112"></a>
- <p class="title">
- <b>Figure 13.123. 
- <span lang="en" xml:lang="en">Threshold tool options</span>
- </b>
- </p>
- <div class="figure-contents">
- <div class="mediaobject">
- <img src="../images/toolbox/tools-threshold.png" alt="Threshold tool options" />
- </div>
- </div>
- </div>
- <br class="figure-break" />
- <div class="variablelist">
- <dl>
- <dt>
- <span class="term">Threshold range</span>
- </dt>
- <dd>
- <p>
- The Threshold tool provides a visual graph, a histogram, of the
- intensity value of the active layer or selection. You can set the
- threshold range either using the input boxes or clicking button 1
- and dragging on the graph. It allows you to select a part of the
- image with some intensity from a background with another
- intensity. Pixels inside the range will be white, and the others
- will be black. Adjust the range to get the selection you want in
- white on black background.
- </p>
- </dd>
- <dt>
- <span class="term">Preview</span>
- </dt>
- <dd>
- <p>
- The Preview toggle allows dynamic updating of the active layer or
- selection while changes are made to the intensity level.
- </p>
- </dd>
- </dl>
- </div>
- </div>
- <div class="sect3" lang="en" xml:lang="en">
- <div class="titlepage">
- <div>
- <div>
- <h4 class="title"><a id="id2645192"></a>5.5.3. 
- <span lang="en" xml:lang="en">
- Using Threshold and Quick Mask to create a selection mask
- </span>
- </h4>
- </div>
- </div>
- </div>
- <p>
- That's not always the case, but an element you want to extract from
- an image can stand out well against the background. In this case,
- you can use the Threshold tool to select this element as a whole.
- Grokking the GIMP described a method based on a channel mask, but now,
- using the <a class="link" href="gimp-image-window-qmask-button.html" title="3.  QuickMask">Quick mask
- </a> is easier.
- </p>
- <div class="procedure">
- <ol type="1">
- <li>
- <p>
- First start decomposing you image into its RGB and HSV components by
- using the <a class="link" href="plug-in-decompose-registered.html" title="11.16.  Decompose">Decompose</a> filter. A
- new grey-scaled image is created and the components are displayed as
- layers in the Layer Dialog. These layers come with a thumbnail but
- it is too small for an easy study. You can, of course, increase the
- size of this preview with the dialog menu (the small triangular
- button), but playing with the “<span class="quote">eyes </span>” is more simple to
- display the wanted layer in the decompose image. Select the layer
- that isolates the element the best.
- </p>
- <div class="figure">
- <a id="id2645259"></a>
- <p class="title">
- <b>Figure 13.124. 
- <span lang="en" xml:lang="en">
- The original image, the decompose image and its Layer Dialog
- </span>
- </b>
- </p>
- <div class="figure-contents">
- <div class="mediaobject">
- <img src="../images/using/threshold-orig.png" alt="The original image, the decompose image and its Layer Dialog" />
- </div>
- <div class="mediaobject">
- <img src="../images/using/threshold-decomp.png" alt="The original image, the decompose image and its Layer Dialog" />
- </div>
- <div class="mediaobject">
- <img src="../images/using/threshold-layers.png" alt="The original image, the decompose image and its Layer Dialog" />
- </div>
- </div>
- </div>
- <br class="figure-break" />
- </li>
- <li>
- <p>
- Call the Threshold tool from the decompose image. By moving the
- black cursor, fit threshold to isolate the best the element you want
- to extract. This will probably not be perfect: we will enhance the
- result with the selection mask we are going to create.
- </p>
- <div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
- <table border="0" summary="Warning">
- <tr>
- <td rowspan="2" align="center" valign="top" width="25">
- <img alt="[Warning]" src="../images/warning.png" />
- </td>
- <th align="left">Warning</th>
- </tr>
- <tr>
- <td align="left" valign="top">
- <p>
- Make sure you have selected the right layer when you call the
- Threshold tool: when it is opened, you can't change to another
- layer.
- </p>
- </td>
- </tr>
- </table>
- </div>
- <div class="figure">
- <a id="id2645340"></a>
- <p class="title">
- <b>Figure 13.125. 
- <span lang="en" xml:lang="en">The selected layer after threshold fit</span>
- </b>
- </p>
- <div class="figure-contents">
- <div class="mediaobject">
- <img src="../images/using/threshold-fit.png" alt="The selected layer after threshold fit" />
- <div class="caption">
- <p>
- We got the best outline for our flower. There are several red
- objects which we must remove.
- </p>
- </div>
- </div>
- </div>
- </div>
- <br class="figure-break" />
- </li>
- <li>
- <p>
- Make sure the image displaying the selected layer is active and
- copy it to the clipboard with
- <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>C</strong></span>.
- </p>
- </li>
- <li>
- <p>
- Now, make the original image active. Click on the
- <span class="guibutton">Quick Mask</span> button at the bottom-left corner
- of the image window: the image gets covered with a red (default)
- translucent mask. This red color does not suit well to our image
- with much red: go to the Channel Dialog, activate the
- “<span class="quote">Quick mask</span>” channel and change this color with the
- <span class="guibutton">Edit Channel Attributes</span>. Come back to the
- original image. Press
- <span class="keycap"><strong>Ctrl</strong></span>+<span class="keycap"><strong>V</strong></span> to
- paste the previously copied layer.
- </p>
- <div class="figure">
- <a id="id2645454"></a>
- <p class="title">
- <b>Figure 13.126. 
- <span lang="en" xml:lang="en">The mask</span>
- </b>
- </p>
- <div class="figure-contents">
- <div class="mediaobject" align="center">
- <img src="../images/using/threshold-mask.png" align="middle" alt="The mask" />
- </div>
- </div>
- </div>
- <br class="figure-break" />
- </li>
- <li>
- <p>
- Voilà. Your selection mask is ready: you can improve the selection
- as usually. When the selection is ready, disable the Quick mask by
- clicking again on its button: you will see the marching ants around
- the selection.
- </p>
- <div class="figure">
- <a id="id2645503"></a>
- <p class="title">
- <b>Figure 13.127. 
- <span lang="en" xml:lang="en">The result</span>
- </b>
- </p>
- <div class="figure-contents">
- <div class="mediaobject">
- <img src="../images/using/threshold-result.png" alt="The result" />
- </div>
- <div class="mediaobject">
- <img src="../images/using/threshold-selection.png" alt="The result" />
- </div>
- </div>
- </div>
- <br class="figure-break" />
- <p>
- We used the Zoom to work at a pixel level, the Lasso to remove large
- unwanted areas, the pencil (to get hard limits), black paint to
- remove selected areas, white paint to add selected areas, especially
- for stem.
- </p>
- </li>
- </ol>
- </div>
- </div>
- </div>
- <div class="navfooter">
- <hr />
- <table width="100%" summary="Navigation footer">
- <tr>
- <td width="40%" align="left"><a accesskey="p" href="gimp-tool-brightness-contrast.html"><img src="../images/prev.png" alt="Prev" /></a> </td>
- <td width="20%" align="center">
- <a accesskey="u" href="gimp-tools-color.html">
- <img src="../images/up.png" alt="Up" />
- </a>
- </td>
- <td width="40%" align="right"> <a accesskey="n" href="gimp-tool-levels.html"><img src="../images/next.png" alt="Next" /></a></td>
- </tr>
- <tr>
- <td width="40%" align="left" valign="top"><a accesskey="p" href="gimp-tool-brightness-contrast.html">5.4. 
- <span lang="en" xml:lang="en">Brightness-Contrast tool</span>
- </a> </td>
- <td width="20%" align="center">
- <a accesskey="h" href="index.html">
- <img src="../images/home.png" alt="Home" />
- </a>
- </td>
- <td width="40%" align="right" valign="top"> <a accesskey="n" href="gimp-tool-levels.html">5.6. 
- <span lang="en" xml:lang="en">Levels</span>
- </a></td>
- </tr>
- </table>
- </div>
- </body>
- </html>
-