home *** CD-ROM | disk | FTP | other *** search
Wrap
<?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>12.  Palettes</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-painting.html" title="Chapter 7.  Painting with GIMP" /> <link rel="prev" href="gimp-concepts-patterns.html" title="11.  Patterns" /> <link rel="next" href="gimp-using-simpleobjects.html" title="13.  Drawing Simple Objects" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">12.  <span lang="en" xml:lang="en">Palettes</span> </th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="gimp-concepts-patterns.html"><img src="../images/prev.png" alt="Prev" /></a> </td> <th width="60%" align="center">Chapter 7.  <span lang="en" xml:lang="en">Painting with GIMP</span> </th> <td width="20%" align="right"> <a accesskey="n" href="gimp-using-simpleobjects.html"><img src="../images/next.png" alt="Next" /></a></td> </tr> </table> <hr /> </div> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both"><a id="gimp-concepts-palettes"></a>12.  <span lang="en" xml:lang="en">Palettes</span> </h2> </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: 2419 $</td> <td align="left">2008-01-05</td> <td align="left">jpl</td> </tr> </table> </div> </div> </div> </div> <a id="id2597976" class="indexterm"></a> <a id="id2597989" class="indexterm"></a> <a id="id2598002" class="indexterm"></a> <p> A <span class="emphasis"><em>palette</em></span> is a set of discrete colors. In GIMP, palettes are used mainly for two purposes: </p> <div class="itemizedlist"> <ul type="disc"> <li> <p> They allow you to paint with a selected set of colors, in the same way an oil painter works with colors from a limited number of tubes. </p> </li> <li> <p> They form the colormaps of indexed images. An indexed image can use a maximum of 256 different colors, but these can be any colors. The colormap of an indexed image is called an "indexed palette" in GIMP. </p> </li> </ul> </div> <p> Actually neither of these functions fall very much into the mainstream of GIMP usage: it is possible to do rather sophisticated things in GIMP without ever dealing with palettes. Still, they are something that an advanced user should understand, and even a less advanced user may need to think about them in some situations, as for example when working with GIF files. </p> <div class="figure"> <a id="id2598059"></a> <p class="title"> <b>Figure 7.31.  <span lang="en" xml:lang="en">The Palettes dialog</span> </b> </p> <div class="figure-contents"> <div class="mediaobject"> <img src="../images/dialogs/dialogs-palettes.png" alt="The Palettes dialog" /> </div> </div> </div> <br class="figure-break" /> <p> When you install GIMP, it comes supplied with several dozen predefined palettes, and you can also create new ones. Some of the predefined palettes are commonly useful, such as the “<span class="quote">Web</span>” palette, which contains the set of colors considered “<span class="quote">web safe</span>”; many of the palettes seem to have been chosen more or less whimsically. You can access all of the available palettes using the <a class="link" href="gimp-palette-dialog.html" title="3.5.  Palettes Dialog">Palettes dialog</a>. This is also the starting point if you want to create a new palette. </p> <div class="figure"> <a id="id2598113"></a> <p class="title"> <b>Figure 7.32.  <span lang="en" xml:lang="en">The Palette Editor</span> </b> </p> <div class="figure-contents"> <div class="mediaobject"> <img src="../images/dialogs/palette-editor.png" alt="The Palette Editor" /> </div> </div> </div> <br class="figure-break" /> <p> Double-clicking on a palette in the Palettes dialog brings up the <a class="link" href="gimp-palette-dialog.html#gimp-palette-editor-dialog" title="3.5.4.  Palette Editor">Palette Editor</a>, showing the colors from the palette you clicked on. You can use this to paint with the palette: clicking on a color sets GIMP's foreground to that color, as shown in the Color Area of the Toolbox. Holding down the <span class="keycap"><strong>Ctrl</strong></span> key while clicking, on the other hand, sets GIMP's background color to the color you click on. </p> <p> You can also, as the name implies, use the Palette Editor to change the colors in a palette, so long as it is a palette that you have created yourself. You cannot edit the palettes that are supplied with GIMP; however you can duplicate them and then edit the copies. </p> <p> When you create palettes using the Palette Editor, they are automatically saved as soon as you exit GIMP, in the <code class="filename">palettes</code> folder of your personal GIMP directory. Any palette files in this directory, or in the system <code class="filename">palettes</code> directory created when GIMP is installed, are automatically loaded and shown in the Palettes dialog the next time you start GIMP. You can also add other folders to the palette search path using the <a class="link" href="gimp-pimping.html#gimp-prefs-folders-data" title="1.19.  Data Folders">Palette Folders</a> page of the Preferences dialog. </p> <p> GIMP palettes are stored using a special file format, in files with the extension <code class="filename">.gpl</code>. It is a very simple format, and they are ASCII files, so if you happen to obtain palettes from another source, and would like to use them in GIMP, it probably won't be very hard to convert them: just take a look at any <code class="filename">.gpl</code> and you will see what to do. </p> <div class="sect2" lang="en" xml:lang="en"> <div class="titlepage"> <div> <div> <h3 class="title"><a id="id2598226"></a>12.1.  <span lang="en" xml:lang="en">Colormap</span> </h3> </div> </div> </div> <p> Confusingly, GIMP makes use of two types of palettes. The more noticeable are the type shown in the Palettes dialog: palettes that exist independently of any image. The second type, <span class="emphasis"><em>indexed palettes</em></span>, form the colormaps of indexed images. Each indexed image has its own private indexed palette, defining the set of colors available in the image: the maximum number of colors allowed in an indexed palette is 256. These palettes are called “<span class="quote">indexed</span>” because each color is associated with an index number. (Actually, the colors in ordinary palettes are numbered as well, but the numbers have no functional significance.) </p> <div class="figure"> <a id="id2598260"></a> <p class="title"> <b>Figure 7.33.  <span lang="en" xml:lang="en">The Colormap dialog</span> </b> </p> <div class="figure-contents"> <div class="mediaobject"> <img src="../images/dialogs/colormap-dialog.png" alt="The Colormap dialog" /> </div> </div> </div> <br class="figure-break" /> <p> The colormap of an indexed image is shown in the <a class="link" href="gimp-indexed-palette-dialog.html" title="2.4.  Colormap Dialog"> Indexed Palette dialog </a>, which should not be confused with the Palettes dialog. The Palettes dialog shows a list of all of the palettes available; the Colormap dialog shows the colormap of the currently active image, if it is an indexed image - otherwise it shows nothing. </p> <p> You can, however, create an ordinary palette from the colors in an indexed image---actually from the colors in any image. To do this, choose <span class="guimenuitem">Import Palette</span> from the right-click popup menu in the Palettes dialog: this pops up a dialog that gives you several options, including the option to import the palette from an image. (You can also import any of GIMP's gradients as a palette.) This possibility becomes important if you want to create a set of indexed images that all use the same set of colors. </p> <p> When you convert an image into indexed mode, a major part of the process is the creation of an indexed palette for the image. How this happens is described in detail in <a class="xref" href="gimp-image-convert-indexed.html" title="9.6.  Indexed mode">Section 9.6, “ <span lang="en" xml:lang="en">Indexed mode</span> ”</a>. Briefly, you have several methods to choose from, one of which is to use a specified palette from the Palettes dialog. </p> <p> Thus, to sum up the foregoing, ordinary palettes can be turned into indexed palettes when you convert an image into indexed mode; indexed palettes can be turned into ordinary palettes by importing them into the Palettes dialog. </p> <div class="figure"> <a id="id2598349"></a> <p class="title"> <b>Figure 7.34.  <span lang="en" xml:lang="en">Colormap dialog (1) and Palette dialog (2)</span> </b> </p> <div class="figure-contents"> <div class="mediaobject"> <img src="../images/using/palettes.png" alt="Colormap dialog (1) and Palette dialog (2)" /> </div> </div> </div> <br class="figure-break" /> </div> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="gimp-concepts-patterns.html"><img src="../images/prev.png" alt="Prev" /></a> </td> <td width="20%" align="center"> <a accesskey="u" href="gimp-painting.html"> <img src="../images/up.png" alt="Up" /> </a> </td> <td width="40%" align="right"> <a accesskey="n" href="gimp-using-simpleobjects.html"><img src="../images/next.png" alt="Next" /></a></td> </tr> <tr> <td width="40%" align="left" valign="top"><a accesskey="p" href="gimp-concepts-patterns.html">11.  <span lang="en" xml:lang="en">Patterns</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-using-simpleobjects.html">13.  <span lang="en" xml:lang="en">Drawing Simple Objects</span> </a></td> </tr> </table> </div> </body> </html>