]> granicus.if.org Git - imagemagick/blobdiff - www/color.html
...
[imagemagick] / www / color.html
index f85024fb1a8f4a7743d03323aa5e13153303c363..04d6f10227db15819ba418c957620f9f7581e6d5 100644 (file)
@@ -6,11 +6,11 @@
 <html lang="en">
 <head>
   <meta charset="utf-8"  />
-  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"  />
+  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
   <title>Color Names @ ImageMagick</title>
   <meta name="application-name" content="ImageMagick" />
-  <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves." />
-  <meta name="application-url" content="https://www.imagemagick.org" />
+  <meta name="description" content="Use ImageMagick® to create, edit, compose, convert bitmap images. With ImageMagick you can resize your image, crop it, change its shades and colors, add captions, among other operations." />
+  <meta name="application-url" content="https://imagemagick.org" />
   <meta name="generator" content="PHP" />
   <meta name="keywords" content="color, names, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert" />
   <meta name="rating" content="GENERAL" />
   <meta name="distribution" content="Global" />
   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
-  <link href="https://www.imagemagick.org/script/color.html" rel="canonical" />
+  <link href="color.html" rel="canonical" />
   <link href="../images/wand.png" rel="icon" />
   <link href="../images/wand.ico" rel="shortcut icon" />
-  <link href="css/magick.css" rel="stylesheet" />
+  <link href="assets/magick.css" rel="stylesheet" />
 </head>
 <body>
-<div class="magick-masthead">
+  <header>
+  <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
+    <a class="navbar-brand" href="../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
+    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
+      <span class="navbar-toggler-icon"></span>
+    </button>
+
+    <div class="navbar-collapse collapse" id="navbarsExampleDefault" style="">
+    <ul class="navbar-nav mr-auto">
+      <li class="nav-item ">
+        <a class="nav-link" href="../index.html">Home <span class="sr-only">(current)</span></a>
+      </li>
+      <li class="nav-item ">
+        <a class="nav-link" href="../www/download.html">Download</a>
+      </li>
+      <li class="nav-item ">
+        <a class="nav-link" href="../www/command-line-tools.html">Tools</a>
+      </li>
+      <li class="nav-item ">
+        <a class="nav-link" href="../www/command-line-processing.html">Command-line</a>
+      </li>
+      <li class="nav-item ">
+        <a class="nav-link" href="../www/resources.html">Resources</a>
+      </li>
+      <li class="nav-item ">
+        <a class="nav-link" href="../www/develop.html">Develop</a>
+      </li>
+      <li class="nav-item">
+        <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a>
+      </li>
+    </ul>
+    <form class="form-inline my-2 my-lg-0" action="https://imagemagick.org/script/search.php">
+      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
+      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
+    </form>
+    </div>
+  </nav>
   <div class="container">
-    <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
+   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
          style="display:block"
          data-ad-client="ca-pub-3129977114552745"
          data-ad-slot="6345125851"
     <script>
       (adsbygoogle = window.adsbygoogle || []).push({});
     </script>
-    <nav class="nav magick-nav">
-      <a class="nav-link " href="../index.html">Home</a>
-      <a class="nav-link " href="download.html">Download</a>
-      <a class="nav-link " href="command-line-tools.html">Tools</a>
-      <a class="nav-link " href="command-line-processing.html">Command-line</a>
-      <a class="nav-link " href="resources.html">Resources</a>
-      <a class="nav-link " href="develop.html">Develop</a>
-      <a class="nav-link " href="https://www.imagemagick.org/script/search.php">Search</a>
-      <a class="nav-link float-right" href="https://www.imagemagick.org/discourse-server/">Community</a>
-    </nav>
+
   </div>
-</div>
-<div class="container">
+  </header>
+  <main class="container">
+    <div class="magick-template">
 <div class="magick-header">
 <p class="text-center"><a href="color.html#usage">Example Usage</a> • <a href="color.html#models">Color Model Specification</a> • <a href="color.html#color_names">List of Color Names</a></p>
 
 
 <p>Use the <a href="../contrib/color-converter.html">Color Converter</a> to supply any valid ImageMagick color specification as described below to see a color swatch of that color and to convert to all the other color models.</p>
 
-<h2 class="magick-post-title"><a id="usage"></a>Example Usage</h2>
+<h2 class="magick-post-title"><a class="anchor" id="usage"></a>Example Usage</h2>
 
 <p>Each of the following commands produces the same <var>lime</var> border around the image. (Use "double quotes" for Windows.)</p>
 
-<pre><code>magick -bordercolor lime -border 10 image.jpg image.png
+<pre class="highlight"><code>magick -bordercolor lime -border 10 image.jpg image.png
 magick -bordercolor '#0f0' -border 10 image.jpg image.png
 magick -bordercolor '#00ff00' -border 10 image.jpg image.png
 magick -bordercolor 'rgb(0,255,0)' -border 10 image.jpg image.png
@@ -71,11 +99,11 @@ magick -bordercolor 'rgb(0,100%,0)' -border 10 image.jpg image.png</code></pre>
 
 <p>The list of recognized color names (for example, <var>aqua</var>, <var>black</var>, <var>blue</var>, <var>fuchsia</var>, <var>gray</var>, <var>green</var>, <var>lime</var>, <var>maroon</var>, <var>navy</var>, <var>olive</var>, <var>purple</var>, <var>red</var>, <var>silver</var>, <var>teal</var>, <var>white</var>, <var>yellow</var>, and others) is shown in a table further below.</p>
 
-<h2 class="magick-post-title"><a id="models"></a>Color Model Specification</h2>
+<h2 class="magick-post-title"><a class="anchor" id="models"></a>Color Model Specification</h2>
 
 <p>The sRGB, CMYK, HSL and HSB color models are used in numerical color specifications. These examples all specify the same red sRGB color:</p>
 
-<pre><code>#f00                      #rgb
+<pre class="highlight"><code>#f00                      #rgb
 #ff0000                   #rrggbb
 #ff0000ff                 #rrggbbaa
 #ffff00000000             #rrrrggggbbbb
@@ -91,7 +119,7 @@ rgb(100.0%, 0.0%, 0.0%)   a float in the range 0—100% for each component</code
 
 <p>The sRGB color model is extended in this specification to include <var>alpha</var> to allow specification of the transparency of a color. These examples all specify the same color:</p>
 
-<pre><code>rgb(255, 0, 0)                 range 0 - 255
+<pre class="highlight"><code>rgb(255, 0, 0)                 range 0 - 255
 rgba(255, 0, 0, 1.0)           the same, with an explicit alpha value
 rgb(100%, 0%, 0%)              range 0.0% - 100.0%
 rgba(100%, 0%, 0%, 1.0)        the same, with an explicit alpha value</code></pre>
@@ -100,10 +128,15 @@ rgba(100%, 0%, 0%, 1.0)        the same, with an explicit alpha value</code></pr
 
 <p>There is also a color called 'none' that is fully transparent.  This color is shorthand for <code>rgba(0, 0, 0, 0.0)</code>.</p>
 
-<p>Gray values are conveniently defined with a single intensity value or an intensity value and an alpha value:</p>
+<p>Non-linear gray values are conveniently defined with a name, single intensity value or an intensity value and an alpha value:</p>
+
+<pre class="highlight"><code>
+gray50            near mid gray
+gray(127)         near mid gray
+gray(50%)         mid gray
+graya(50%, 0.5)   semi-transparent mid gray</code></pre>
 
-<pre><code>gray(50%)        mid gray
-graya(50%, 0.5)  semi-transparent mid gray</code></pre>
+<p>For linear gray values add -colorspace RGB -colorspace Gray or -colorspace LinearGray when creating gray colors. The latter is new as of Imagemagick 6.9.9-29 and 7.0.7-17.</p>
 
 <p>The ImageMagick color model also supports hue-saturation-lightness (HSL) and hue-saturation-brightness (HSB) colors as a complement to numerical sRGB colors. HSL colors are encoding as a triple (hue, saturation, lightness). Likewise HSB colors are encoding as a triple (hue, saturation, brightness). HSL or HSB triples are either direct values (hue 0—360, saturation 0—255, lightness or brightness 0—255) or with S,L,B as percentage values relative to these ranges.</p>
 
@@ -121,7 +154,7 @@ graya(50%, 0.5)  semi-transparent mid gray</code></pre>
 
 <p>The HSB color system is a little easier to understand than the HSL color system. In the HSB color system, black is at the bottom apex and white is at the top center of the cone on the central axis. The most colorful or saturated colors will then be at the outer edge of the top of the cone at the widest part. Thus at Saturation=100% and Brightness=100%</p>
 
-<pre><code>hsb(0,   100%,  100%)    or    hsb(0,   255,   255)          full red
+<pre class="highlight"><code>hsb(0,   100%,  100%)    or    hsb(0,   255,   255)          full red
 hsb(120, 100%,  100%)    or    hsb(120, 255,   255)       full green
 hsb(120, 100%,  75%)     or    hsb(120, 255,   191.25)    medium green
 hsb(120, 100%,  50%)     or    hsb(120, 255,   127.5)     dark green
@@ -130,7 +163,7 @@ hsb(120, 50%,   50%)     or    hsb(120, 127.5, 127.5)     pastel green</code></p
 
 <p>In the HSL color system, black is at the bottom apex and white is at the top apex. However, saturation is largest at the middle of the double cone on its outer perimeter and thus at a lightness value of 50%. The most colorful or saturated colors will then be at the outer edge of the double cone at its widest part. Thus at Saturation=100% and Brightness=50%</p>
 
-<pre><code>hsl(0,   100%,  50%)     or    hsl(0,   255,   127.5)        full red
+<pre class="highlight"><code>hsl(0,   100%,  50%)     or    hsl(0,   255,   127.5)        full red
 hsl(120, 100%,  100%)    or    hsl(120, 255,   255)       white
 hsl(120, 100%,  75%)     or    hsl(120, 255,   191.25)    pastel green
 hsl(120, 100%,  50%)     or    hsl(120, 255,   127.5)     full green
@@ -141,7 +174,7 @@ hsl(120, 50%,   50%)     or    hsl(120, 127.5, 127.5)     medium green</code></p
 
 <p>Just as the 'rgb()' functional notation has the 'rgba()' alpha counterpart, the 'hsl()' and 'hsb()' functional notations have their 'hsla()' 'hsba()' alpha counterparts. These examples specify the same color:</p>
 
-<pre><code>hsb(120, 100%,  100%)              full green in hsb
+<pre class="highlight"><code>hsb(120, 100%,  100%)              full green in hsb
 hsba(120, 100%,  100%,  1.0)       the same, with an alpha value of 1.0
 hsb(120, 255,  255)                full green in hsb
 hsba(120, 255,  255,  1.0)         the same, with an alpha value of 1.0
@@ -154,24 +187,31 @@ hsla(120, 255,  127.5,  1.0)       the same, with an alpha value of 1.0</code></
 <p>For ImageMagick between 6.5.6-6 and 6.9.2-0, HSL (HSB) could only be specified with Hue as percent in range 0—100%, when Saturation and Lightness (Brightness) were also specified as percent in range 0—100%.</p>
 
 <p>Specify the Lab colors like this:</p>
-<pre><code>cielab(62.253188, 23.950124, 48.410653)</code></pre>
+<pre class="highlight"><code>cielab(62.253188, 23.950124, 48.410653)</code></pre>
 <p>Note, the <code>a</code> and <code>b</code> components of any Lab color you specify are biased internally by 50% to ensure it fits in the quantum range (typically 0 to 65535).  The bias is retained when writing to the TIFF and MIFF image formats.  However, the TXT format supports negative pixel values so the bias is removed when writing to this format:</p>
-<pre><code>-> magick xc:cyan -colorspace LAB txt:
+<pre class="highlight"><code>-> magick xc:cyan -colorspace LAB txt:
 # ImageMagick pixel enumeration: 1,1,65535,cielab
 0,0: (91.1131%,-18.8571%,-5.5436%)  #E93F00000000  cielab(91.1131%,-18.8571%,-5.5436%)
 
 -> magick -size 100x100 xc:"cielab(91.1131%,-18.8571%,-5.5436%)" -colorspace sRGB cyan.png</code></pre>
 
 <p>Or specify colors generically with the <code>icc-color</code> keyword, for example:</p>
-<pre><code>icc-color(cmyk, 0.11, 0.48, 0.83, 0.00)
-icc-color(rgb, white)</code></pre>
+<pre class="highlight"><code>
+icc-color(cmyk, 0.11, 0.48, 0.83, 0.00)  cymk
+icc-color(rgb, 1, 0, 0)                  linear rgb
+icc-color(rgb, red)                      linear rgb
+icc-color(lineargray, 0.5)               linear gray
+icc-color(srgb, 1, 0, 0)                 non-linear rgb
+icc-color(srgb, red)                     non-linear rgb
+icc-color(gray, 0.5)                     non-linear gray
+</code></pre>
 
 <p>Or specify uncalibrated device colors with the <code>device-</code> keyword, for example:</p>
-<pre><code>device-gray(0.5)
+<pre class="highlight"><code>device-gray(0.5)
 device-rgb(0.5, 1.0, 0.0)
 device-cmyk(0.11, 0.48, 0.83, 0.00)</code></pre>
 
-<h2 class="magick-post-title"><a id="color_names"></a>List of Color Names</h2>
+<h2 class="magick-post-title"><a class="anchor" id="color_names"></a>List of Color Names</h2>
 
 <p>The table below provides a list of named colors recognized by ImageMagick:</p>
 
@@ -4906,22 +4946,25 @@ device-cmyk(0.11, 0.48, 0.83, 0.00)</code></pre>
 </table>
 
 </div>
+    </div>
+  </main><!-- /.container -->
   <footer class="magick-footer">
-    <p><a href="support.html">Donate</a> •
-     <a href="sitemap.html">Sitemap</a> •
-    <a href="links.html">Related</a> •
-    <a href="security-policy.html">Security</a> •
-    <a href="architecture.html">Architecture</a>
-</p>
-    <p><a href="color.html#">Back to top</a> •
-    <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
-    <a href="https://www.imagemagick.org/script/contact.php">Contact Us</a></p>
-        <p><small>© 1999-2017 ImageMagick Studio LLC</small></p>
+    <p><a href="../www/security-policy.html">Security</a> •
+    <a href="../www/architecture.html">Architecture</a> •
+    <a href="../www/links.html">Related</a> •
+     <a href="../www/sitemap.html">Sitemap</a>
+       
+    <a href="color.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
+       
+    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
+    <a href="../www/support.html">Donate</a> •
+    <a href="../www/https://imagemagick.org/script/contact.php">Contact Us</a>
+    <br/>
+        <small>© 1999-2018 ImageMagick Studio LLC</small></p>
   </footer>
-</div><!-- /.container -->
 
-  <script src="https://localhost/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
-  <script src="../js/magick.html"></script>
+  <!-- Javascript assets -->
+  <script src="assets/magick.js" crossorigin="anonymous"></script>
+  <script>window.jQuery || document.write('<script src="assets/jquery.min.js"><\/script>')</script>
 </body>
 </html>
-<!-- Magick Cache 9th September 2017 08:02 -->
\ No newline at end of file