Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > e5936adde9b1ea7ed6dc23c107bda8ab > files > 237

python3-pillow-doc-5.4.1-1.1.mga7.noarch.rpm



<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>ImageOps Module &mdash; Pillow (PIL Fork) 5.4.1 documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script type="text/javascript" src="../_static/jquery.js"></script>
        <script type="text/javascript" src="../_static/underscore.js"></script>
        <script type="text/javascript" src="../_static/doctools.js"></script>
        <script type="text/javascript" src="../_static/language_data.js"></script>
        <script type="text/javascript" src="../_static/js/script.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="ImagePalette Module" href="ImagePalette.html" />
    <link rel="prev" title="ImageMorph Module" href="ImageMorph.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> Pillow (PIL Fork)
          

          
          </a>

          
            
            
              <div class="version">
                5.4.1
              </div>
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../handbook/index.html">Handbook</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="index.html">Reference</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="Image.html"><code class="docutils literal notranslate"><span class="pre">Image</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageChops.html"><code class="docutils literal notranslate"><span class="pre">ImageChops</span></code> (“Channel Operations”) Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageColor.html"><code class="docutils literal notranslate"><span class="pre">ImageColor</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageCms.html"><code class="docutils literal notranslate"><span class="pre">ImageCms</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageDraw.html"><code class="docutils literal notranslate"><span class="pre">ImageDraw</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageEnhance.html"><code class="docutils literal notranslate"><span class="pre">ImageEnhance</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageFile.html"><code class="docutils literal notranslate"><span class="pre">ImageFile</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageFilter.html"><code class="docutils literal notranslate"><span class="pre">ImageFilter</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageFont.html"><code class="docutils literal notranslate"><span class="pre">ImageFont</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageGrab.html"><code class="docutils literal notranslate"><span class="pre">ImageGrab</span></code> Module (macOS and Windows only)</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageMath.html"><code class="docutils literal notranslate"><span class="pre">ImageMath</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageMorph.html"><code class="docutils literal notranslate"><span class="pre">ImageMorph</span></code> Module</a></li>
<li class="toctree-l2 current"><a class="current reference internal" href="#"><code class="docutils literal notranslate"><span class="pre">ImageOps</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImagePalette.html"><code class="docutils literal notranslate"><span class="pre">ImagePalette</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImagePath.html"><code class="docutils literal notranslate"><span class="pre">ImagePath</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageQt.html"><code class="docutils literal notranslate"><span class="pre">ImageQt</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageSequence.html"><code class="docutils literal notranslate"><span class="pre">ImageSequence</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageStat.html"><code class="docutils literal notranslate"><span class="pre">ImageStat</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageTk.html"><code class="docutils literal notranslate"><span class="pre">ImageTk</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="ImageWin.html"><code class="docutils literal notranslate"><span class="pre">ImageWin</span></code> Module (Windows-only)</a></li>
<li class="toctree-l2"><a class="reference internal" href="ExifTags.html"><code class="docutils literal notranslate"><span class="pre">ExifTags</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="TiffTags.html"><code class="docutils literal notranslate"><span class="pre">TiffTags</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PSDraw.html"><code class="docutils literal notranslate"><span class="pre">PSDraw</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="PixelAccess.html"><code class="docutils literal notranslate"><span class="pre">PixelAccess</span></code> Class</a></li>
<li class="toctree-l2"><a class="reference internal" href="PyAccess.html"><code class="docutils literal notranslate"><span class="pre">PyAccess</span></code> Module</a></li>
<li class="toctree-l2"><a class="reference internal" href="../PIL.html">PIL Package (autodoc of remaining modules)</a></li>
<li class="toctree-l2"><a class="reference internal" href="plugins.html">Plugin reference</a></li>
<li class="toctree-l2"><a class="reference internal" href="internal_design.html">Internal Reference Docs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../porting.html">Porting</a></li>
<li class="toctree-l1"><a class="reference internal" href="../about.html">About</a></li>
<li class="toctree-l1"><a class="reference internal" href="../releasenotes/index.html">Release Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../deprecations.html">Deprecations and removals</a></li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">Pillow (PIL Fork)</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> &raquo;</li>
        
          <li><a href="index.html">Reference</a> &raquo;</li>
        
      <li><code class="docutils literal notranslate"><span class="pre">ImageOps</span></code> Module</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/reference/ImageOps.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <span class="target" id="module-PIL.ImageOps"></span><div class="section" id="imageops-module">
<h1><code class="xref py py-mod docutils literal notranslate"><span class="pre">ImageOps</span></code> Module<a class="headerlink" href="#imageops-module" title="Permalink to this headline">¶</a></h1>
<p>The <code class="xref py py-mod docutils literal notranslate"><span class="pre">ImageOps</span></code> module contains a number of ‘ready-made’ image
processing operations. This module is somewhat experimental, and most operators
only work on L and RGB images.</p>
<p>Only bug fixes have been added since the Pillow fork.</p>
<div class="versionadded">
<p><span class="versionmodified">New in version 1.1.3.</span></p>
</div>
<dl class="function">
<dt id="PIL.ImageOps.autocontrast">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">autocontrast</code><span class="sig-paren">(</span><em>image</em>, <em>cutoff=0</em>, <em>ignore=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#autocontrast"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.autocontrast" title="Permalink to this definition">¶</a></dt>
<dd><p>Maximize (normalize) image contrast. This function calculates a
histogram of the input image, removes <strong>cutoff</strong> percent of the
lightest and darkest pixels from the histogram, and remaps the image
so that the darkest pixel becomes black (0), and the lightest
becomes white (255).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to process.</li>
<li><strong>cutoff</strong> – How many percent to cut off from the histogram.</li>
<li><strong>ignore</strong> – The background pixel value (use None for no background).</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.colorize">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">colorize</code><span class="sig-paren">(</span><em>image</em>, <em>black</em>, <em>white</em>, <em>mid=None</em>, <em>blackpoint=0</em>, <em>whitepoint=255</em>, <em>midpoint=127</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#colorize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.colorize" title="Permalink to this definition">¶</a></dt>
<dd><p>Colorize grayscale image.
This function calculates a color wedge which maps all black pixels in
the source image to the first color and all white pixels to the
second color. If <strong>mid</strong> is specified, it uses three-color mapping.
The <strong>black</strong> and <strong>white</strong> arguments should be RGB tuples or color names;
optionally you can use three-color mapping by also specifying <strong>mid</strong>.
Mapping positions for any of the colors can be specified
(e.g. <strong>blackpoint</strong>), where these parameters are the integer
value corresponding to where the corresponding color should be mapped.
These parameters must have logical order, such that
<strong>blackpoint</strong> &lt;= <strong>midpoint</strong> &lt;= <strong>whitepoint</strong> (if <strong>mid</strong> is specified).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to colorize.</li>
<li><strong>black</strong> – The color to use for black input pixels.</li>
<li><strong>white</strong> – The color to use for white input pixels.</li>
<li><strong>mid</strong> – The color to use for midtone input pixels.</li>
<li><strong>blackpoint</strong> – an int value [0, 255] for the black mapping.</li>
<li><strong>whitepoint</strong> – an int value [0, 255] for the white mapping.</li>
<li><strong>midpoint</strong> – an int value [0, 255] for the midtone mapping.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.crop">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">crop</code><span class="sig-paren">(</span><em>image</em>, <em>border=0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#crop"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.crop" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove border from image.  The same amount of pixels are removed
from all four sides.  This function works on all image modes.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="Image.html#PIL.Image.Image.crop" title="PIL.Image.Image.crop"><code class="xref py py-meth docutils literal notranslate"><span class="pre">crop()</span></code></a></p>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to crop.</li>
<li><strong>border</strong> – The number of pixels to remove.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.deform">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">deform</code><span class="sig-paren">(</span><em>image</em>, <em>deformer</em>, <em>resample=2</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#deform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.deform" title="Permalink to this definition">¶</a></dt>
<dd><p>Deform the image.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to deform.</li>
<li><strong>deformer</strong> – A deformer object.  Any object that implements a
<strong>getmesh</strong> method can be used.</li>
<li><strong>resample</strong> – An optional resampling filter. Same values possible as
in the PIL.Image.transform function.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.equalize">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">equalize</code><span class="sig-paren">(</span><em>image</em>, <em>mask=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#equalize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.equalize" title="Permalink to this definition">¶</a></dt>
<dd><p>Equalize the image histogram. This function applies a non-linear
mapping to the input image, in order to create a uniform
distribution of grayscale values in the output image.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to equalize.</li>
<li><strong>mask</strong> – An optional mask.  If given, only the pixels selected by
the mask are included in the analysis.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.expand">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">expand</code><span class="sig-paren">(</span><em>image</em>, <em>border=0</em>, <em>fill=0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#expand"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.expand" title="Permalink to this definition">¶</a></dt>
<dd><p>Add border to the image</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to expand.</li>
<li><strong>border</strong> – Border width, in pixels.</li>
<li><strong>fill</strong> – Pixel fill value (a color value).  Default is 0 (black).</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.fit">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">fit</code><span class="sig-paren">(</span><em>image</em>, <em>size</em>, <em>method=0</em>, <em>bleed=0.0</em>, <em>centering=(0.5</em>, <em>0.5)</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#fit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.fit" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a sized and cropped version of the image, cropped to the
requested aspect ratio and size.</p>
<p>This function was contributed by Kevin Cazabon.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to size and crop.</li>
<li><strong>size</strong> – The requested output size in pixels, given as a
(width, height) tuple.</li>
<li><strong>method</strong> – What resampling method to use. Default is
<code class="xref py py-attr docutils literal notranslate"><span class="pre">PIL.Image.NEAREST</span></code>.</li>
<li><strong>bleed</strong> – Remove a border around the outside of the image from all
four edges. The value is a decimal percentage (use 0.01 for
one percent). The default value is 0 (no border).
Cannot be greater than or equal to 0.5.</li>
<li><strong>centering</strong> – Control the cropping position.  Use (0.5, 0.5) for
center cropping (e.g. if cropping the width, take 50% off
of the left side, and therefore 50% off the right side).
(0.0, 0.0) will crop from the top left corner (i.e. if
cropping the width, take all of the crop off of the right
side, and if cropping the height, take all of it off the
bottom).  (1.0, 0.0) will crop from the bottom left
corner, etc. (i.e. if cropping the width, take all of the
crop off the left side, and if cropping the height take
none from the top, and therefore all off the bottom).</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.flip">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">flip</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#flip"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.flip" title="Permalink to this definition">¶</a></dt>
<dd><p>Flip the image vertically (top to bottom).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>image</strong> – The image to flip.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">An image.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.grayscale">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">grayscale</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#grayscale"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.grayscale" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert the image to grayscale.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>image</strong> – The image to convert.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">An image.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.invert">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">invert</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#invert"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.invert" title="Permalink to this definition">¶</a></dt>
<dd><p>Invert (negate) the image.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>image</strong> – The image to invert.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">An image.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.mirror">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">mirror</code><span class="sig-paren">(</span><em>image</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#mirror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.mirror" title="Permalink to this definition">¶</a></dt>
<dd><p>Flip image horizontally (left to right).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>image</strong> – The image to mirror.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">An image.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.posterize">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">posterize</code><span class="sig-paren">(</span><em>image</em>, <em>bits</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#posterize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.posterize" title="Permalink to this definition">¶</a></dt>
<dd><p>Reduce the number of bits for each color channel.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to posterize.</li>
<li><strong>bits</strong> – The number of bits to keep for each channel (1-8).</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="PIL.ImageOps.solarize">
<code class="descclassname">PIL.ImageOps.</code><code class="descname">solarize</code><span class="sig-paren">(</span><em>image</em>, <em>threshold=128</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/PIL/ImageOps.html#solarize"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#PIL.ImageOps.solarize" title="Permalink to this definition">¶</a></dt>
<dd><p>Invert all pixel values above a threshold.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>image</strong> – The image to solarize.</li>
<li><strong>threshold</strong> – All pixels above this greyscale level are inverted.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">An image.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="ImagePalette.html" class="btn btn-neutral float-right" title="ImagePalette Module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="ImageMorph.html" class="btn btn-neutral float-left" title="ImageMorph Module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 1995-2011 Fredrik Lundh, 2010-2018 Alex Clark and Contributors

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>