<!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>Deprecations and removals — 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="prev" title="2.7.0" href="releasenotes/2.7.0.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"><a class="reference internal" href="reference/index.html">Reference</a></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 current"><a class="current reference internal" href="#">Deprecations and removals</a><ul> <li class="toctree-l2"><a class="reference internal" href="#deprecated-features">Deprecated features</a><ul> <li class="toctree-l3"><a class="reference internal" href="#setting-the-size-of-tiff-images">Setting the size of TIFF images</a></li> <li class="toctree-l3"><a class="reference internal" href="#pillow-version-and-version-constants">PILLOW_VERSION and VERSION constants</a></li> <li class="toctree-l3"><a class="reference internal" href="#undocumented-imageops-functions">Undocumented ImageOps functions</a></li> <li class="toctree-l3"><a class="reference internal" href="#pil-olefileio">PIL.OleFileIO</a></li> </ul> </li> <li class="toctree-l2"><a class="reference internal" href="#removed-features">Removed features</a><ul> <li class="toctree-l3"><a class="reference internal" href="#vendored-olefile">Vendored olefile</a></li> </ul> </li> </ul> </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> »</li> <li>Deprecations and removals</li> <li class="wy-breadcrumbs-aside"> <a href="_sources/deprecations.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"> <div class="section" id="deprecations-and-removals"> <span id="deprecations"></span><h1>Deprecations and removals<a class="headerlink" href="#deprecations-and-removals" title="Permalink to this headline">¶</a></h1> <p>This page lists Pillow features that are deprecated, or have been removed in past major releases, and gives the alternatives to use instead.</p> <div class="section" id="deprecated-features"> <h2>Deprecated features<a class="headerlink" href="#deprecated-features" title="Permalink to this headline">¶</a></h2> <p>Below are features which are considered deprecated. Where appropriate, a <code class="docutils literal notranslate"><span class="pre">DeprecationWarning</span></code> is issued.</p> <div class="section" id="setting-the-size-of-tiff-images"> <h3>Setting the size of TIFF images<a class="headerlink" href="#setting-the-size-of-tiff-images" title="Permalink to this headline">¶</a></h3> <div class="deprecated"> <p><span class="versionmodified">Deprecated since version 5.3.0.</span></p> </div> <p>Setting the image size of a TIFF image (eg. <code class="docutils literal notranslate"><span class="pre">im.size</span> <span class="pre">=</span> <span class="pre">(256,</span> <span class="pre">256)</span></code>) issues a <code class="docutils literal notranslate"><span class="pre">DeprecationWarning</span></code>:</p> <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Setting the size of a TIFF image directly is deprecated, and will be removed in a future version. Use the resize method instead. </pre></div> </div> </div> <div class="section" id="pillow-version-and-version-constants"> <h3>PILLOW_VERSION and VERSION constants<a class="headerlink" href="#pillow-version-and-version-constants" title="Permalink to this headline">¶</a></h3> <div class="deprecated"> <p><span class="versionmodified">Deprecated since version 5.2.0.</span></p> </div> <p>Two version constants – <code class="docutils literal notranslate"><span class="pre">VERSION</span></code> (the old PIL version, always 1.1.7) and <code class="docutils literal notranslate"><span class="pre">PILLOW_VERSION</span></code> – have been deprecated and will be removed in the next major release. Use <code class="docutils literal notranslate"><span class="pre">__version__</span></code> instead.</p> </div> <div class="section" id="undocumented-imageops-functions"> <h3>Undocumented ImageOps functions<a class="headerlink" href="#undocumented-imageops-functions" title="Permalink to this headline">¶</a></h3> <div class="deprecated"> <p><span class="versionmodified">Deprecated since version 4.3.0.</span></p> </div> <p>Several undocumented functions in <code class="docutils literal notranslate"><span class="pre">ImageOps</span></code> have been deprecated. They issue a <code class="docutils literal notranslate"><span class="pre">DeprecationWarning</span></code> informing which equivalent to use from <code class="docutils literal notranslate"><span class="pre">ImageFilter</span></code> instead:</p> <table border="1" class="docutils"> <colgroup> <col width="48%" /> <col width="52%" /> </colgroup> <thead valign="bottom"> <tr class="row-odd"><th class="head">Deprecated</th> <th class="head">Use instead</th> </tr> </thead> <tbody valign="top"> <tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">ImageOps.box_blur</span></code></td> <td><code class="docutils literal notranslate"><span class="pre">ImageFilter.BoxBlur</span></code></td> </tr> <tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">ImageOps.gaussian_blur</span></code></td> <td><code class="docutils literal notranslate"><span class="pre">ImageFilter.GaussianBlur</span></code></td> </tr> <tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">ImageOps.gblur</span></code></td> <td><code class="docutils literal notranslate"><span class="pre">ImageFilter.GaussianBlur</span></code></td> </tr> <tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">ImageOps.usm</span></code></td> <td><code class="docutils literal notranslate"><span class="pre">ImageFilter.UnsharpMask</span></code></td> </tr> <tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">ImageOps.unsharp_mask</span></code></td> <td><code class="docutils literal notranslate"><span class="pre">ImageFilter.UnsharpMask</span></code></td> </tr> </tbody> </table> </div> <div class="section" id="pil-olefileio"> <h3>PIL.OleFileIO<a class="headerlink" href="#pil-olefileio" title="Permalink to this headline">¶</a></h3> <div class="deprecated"> <p><span class="versionmodified">Deprecated since version 4.0.0.</span></p> </div> <p>The vendored version of olefile has been removed. Attempting to import <code class="docutils literal notranslate"><span class="pre">PIL.OleFileIO</span></code> issues a <code class="docutils literal notranslate"><span class="pre">DeprecationWarning</span></code> (from 4.0.0) or raises <code class="docutils literal notranslate"><span class="pre">ImportError</span></code> (from 5.0.0):</p> <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>PIL.OleFileIO is deprecated. Use the olefile Python package instead. This module will be removed in a future version. </pre></div> </div> </div> </div> <div class="section" id="removed-features"> <h2>Removed features<a class="headerlink" href="#removed-features" title="Permalink to this headline">¶</a></h2> <p>Deprecated features are only removed in major releases after an appropriate period of deprecation has passed.</p> <div class="section" id="vendored-olefile"> <h3>Vendored olefile<a class="headerlink" href="#vendored-olefile" title="Permalink to this headline">¶</a></h3> <p><em>Removed in version 4.0.0.</em></p> <p>The vendored version of the olefile Python package was removed in favour of the upstream package. Install if needed (eg. <code class="docutils literal notranslate"><span class="pre">pip</span> <span class="pre">install</span> <span class="pre">olefile</span></code>).</p> </div> </div> </div> </div> </div> <footer> <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation"> <a href="releasenotes/2.7.0.html" class="btn btn-neutral float-left" title="2.7.0" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a> </div> <hr/> <div role="contentinfo"> <p> © 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>