diff --git a/.editorconfig b/.editorconfig
index 7f5eab056..07f02c236 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -15,7 +15,7 @@ trim_trailing_whitespace = true
[*.rst]
# Three-space indentation
-indent_size = 3
+indent_size = 4
[*.yml]
# Two-space indentation
diff --git a/docs/installation.rst b/docs/installation.rst
index 00924eab9..89b2e558f 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -45,59 +45,59 @@ Install Pillow with :command:`pip`::
.. tab:: Linux
- We provide binaries for Linux for each of the supported Python
- versions in the manylinux wheel format. These include support for all
- optional libraries except libimagequant. Raqm support requires
- FriBiDi to be installed separately::
+ We provide binaries for Linux for each of the supported Python
+ versions in the manylinux wheel format. These include support for all
+ optional libraries except libimagequant. Raqm support requires
+ FriBiDi to be installed separately::
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade Pillow
+ python3 -m pip install --upgrade pip
+ python3 -m pip install --upgrade Pillow
- Most major Linux distributions, including Fedora, Ubuntu and ArchLinux
- also include Pillow in packages that previously contained PIL e.g.
- ``python-imaging``. Debian splits it into two packages, ``python3-pil``
- and ``python3-pil.imagetk``.
+ Most major Linux distributions, including Fedora, Ubuntu and ArchLinux
+ also include Pillow in packages that previously contained PIL e.g.
+ ``python-imaging``. Debian splits it into two packages, ``python3-pil``
+ and ``python3-pil.imagetk``.
.. tab:: macOS
- We provide binaries for macOS for each of the supported Python
- versions in the wheel format. These include support for all optional
- libraries except libimagequant. Raqm support requires
- FriBiDi to be installed separately::
+ We provide binaries for macOS for each of the supported Python
+ versions in the wheel format. These include support for all optional
+ libraries except libimagequant. Raqm support requires
+ FriBiDi to be installed separately::
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade Pillow
+ python3 -m pip install --upgrade pip
+ python3 -m pip install --upgrade Pillow
.. tab:: Windows
- We provide Pillow binaries for Windows compiled for the matrix of
- supported Pythons in both 32 and 64-bit versions in the wheel format.
- These binaries include support for all optional libraries except
- libimagequant and libxcb. Raqm support requires
- FriBiDi to be installed separately::
+ We provide Pillow binaries for Windows compiled for the matrix of
+ supported Pythons in both 32 and 64-bit versions in the wheel format.
+ These binaries include support for all optional libraries except
+ libimagequant and libxcb. Raqm support requires
+ FriBiDi to be installed separately::
- python3 -m pip install --upgrade pip
- python3 -m pip install --upgrade Pillow
+ python3 -m pip install --upgrade pip
+ python3 -m pip install --upgrade Pillow
- To install Pillow in MSYS2, see `Building on Windows using MSYS2/MinGW`_.
+ To install Pillow in MSYS2, see `Building on Windows using MSYS2/MinGW`_.
.. tab:: FreeBSD
- Pillow can be installed on FreeBSD via the official Ports or Packages systems:
+ Pillow can be installed on FreeBSD via the official Ports or Packages systems:
- **Ports**::
+ **Ports**::
- cd /usr/ports/graphics/py-pillow && make install clean
+ cd /usr/ports/graphics/py-pillow && make install clean
- **Packages**::
+ **Packages**::
- pkg install py38-pillow
+ pkg install py38-pillow
- .. note::
+ .. note::
- The `Pillow FreeBSD port
- `_ and packages
- are tested by the ports team with all supported FreeBSD versions.
+ The `Pillow FreeBSD port
+ `_ and packages
+ are tested by the ports team with all supported FreeBSD versions.
.. _Building on Linux:
@@ -196,133 +196,133 @@ Many of Pillow's features require external libraries:
.. tab:: Linux
- If you didn't build Python from source, make sure you have Python's
- development libraries installed.
+ If you didn't build Python from source, make sure you have Python's
+ development libraries installed.
- In Debian or Ubuntu::
+ In Debian or Ubuntu::
- sudo apt-get install python3-dev python3-setuptools
+ sudo apt-get install python3-dev python3-setuptools
- In Fedora, the command is::
+ In Fedora, the command is::
sudo dnf install python3-devel redhat-rpm-config
- In Alpine, the command is::
+ In Alpine, the command is::
sudo apk add python3-dev py3-setuptools
- .. Note:: ``redhat-rpm-config`` is required on Fedora 23, but not earlier versions.
+ .. Note:: ``redhat-rpm-config`` is required on Fedora 23, but not earlier versions.
- Prerequisites for **Ubuntu 16.04 LTS - 22.04 LTS** are installed with::
+ Prerequisites for **Ubuntu 16.04 LTS - 22.04 LTS** are installed with::
- sudo apt-get install libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
- libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
- libharfbuzz-dev libfribidi-dev libxcb1-dev
+ sudo apt-get install libtiff5-dev libjpeg8-dev libopenjp2-7-dev zlib1g-dev \
+ libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python3-tk \
+ libharfbuzz-dev libfribidi-dev libxcb1-dev
- To install libraqm, ``sudo apt-get install meson`` and then see
- ``depends/install_raqm.sh``.
+ To install libraqm, ``sudo apt-get install meson`` and then see
+ ``depends/install_raqm.sh``.
- Prerequisites are installed on recent **Red Hat**, **CentOS** or **Fedora** with::
+ Prerequisites are installed on recent **Red Hat**, **CentOS** or **Fedora** with::
- sudo dnf install libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel \
- freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel \
- harfbuzz-devel fribidi-devel libraqm-devel libimagequant-devel libxcb-devel
+ sudo dnf install libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel \
+ freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel \
+ harfbuzz-devel fribidi-devel libraqm-devel libimagequant-devel libxcb-devel
- Note that the package manager may be yum or DNF, depending on the
- exact distribution.
+ Note that the package manager may be yum or DNF, depending on the
+ exact distribution.
- Prerequisites are installed for **Alpine** with::
+ Prerequisites are installed for **Alpine** with::
- sudo apk add tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \
- libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev \
- libxcb-dev libpng-dev
+ sudo apk add tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \
+ libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev libimagequant-dev \
+ libxcb-dev libpng-dev
- See also the ``Dockerfile``\s in the Test Infrastructure repo
- (https://github.com/python-pillow/docker-images) for a known working
- install process for other tested distros.
+ See also the ``Dockerfile``\s in the Test Infrastructure repo
+ (https://github.com/python-pillow/docker-images) for a known working
+ install process for other tested distros.
.. tab:: macOS
- The Xcode command line tools are required to compile portions of
- Pillow. The tools are installed by running ``xcode-select --install``
- from the command line. The command line tools are required even if you
- have the full Xcode package installed. It may be necessary to run
- ``sudo xcodebuild -license`` to accept the license prior to using the
- tools.
+ The Xcode command line tools are required to compile portions of
+ Pillow. The tools are installed by running ``xcode-select --install``
+ from the command line. The command line tools are required even if you
+ have the full Xcode package installed. It may be necessary to run
+ ``sudo xcodebuild -license`` to accept the license prior to using the
+ tools.
- The easiest way to install external libraries is via `Homebrew
- `_. After you install Homebrew, run::
+ The easiest way to install external libraries is via `Homebrew
+ `_. After you install Homebrew, run::
- brew install libjpeg libtiff little-cms2 openjpeg webp
+ brew install libjpeg libtiff little-cms2 openjpeg webp
- To install libraqm on macOS use Homebrew to install its dependencies::
+ To install libraqm on macOS use Homebrew to install its dependencies::
- brew install freetype harfbuzz fribidi
+ brew install freetype harfbuzz fribidi
- Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
+ Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
.. tab:: Windows
- We recommend you use prebuilt wheels from PyPI.
- If you wish to compile Pillow manually, you can use the build scripts
- in the ``winbuild`` directory used for CI testing and development.
- These scripts require Visual Studio 2017 or newer and NASM.
+ We recommend you use prebuilt wheels from PyPI.
+ If you wish to compile Pillow manually, you can use the build scripts
+ in the ``winbuild`` directory used for CI testing and development.
+ These scripts require Visual Studio 2017 or newer and NASM.
- The scripts also install Pillow from the local copy of the source code, so the
- `Installing`_ instructions will not be necessary afterwards.
+ The scripts also install Pillow from the local copy of the source code, so the
+ `Installing`_ instructions will not be necessary afterwards.
.. tab:: Windows using MSYS2/MinGW
- To build Pillow using MSYS2, make sure you run the **MSYS2 MinGW 32-bit** or
- **MSYS2 MinGW 64-bit** console, *not* **MSYS2** directly.
+ To build Pillow using MSYS2, make sure you run the **MSYS2 MinGW 32-bit** or
+ **MSYS2 MinGW 64-bit** console, *not* **MSYS2** directly.
- The following instructions target the 64-bit build, for 32-bit
- replace all occurrences of ``mingw-w64-x86_64-`` with ``mingw-w64-i686-``.
+ The following instructions target the 64-bit build, for 32-bit
+ replace all occurrences of ``mingw-w64-x86_64-`` with ``mingw-w64-i686-``.
- Make sure you have Python and GCC installed::
+ Make sure you have Python and GCC installed::
- pacman -S \
- mingw-w64-x86_64-gcc \
- mingw-w64-x86_64-python3 \
- mingw-w64-x86_64-python3-pip \
- mingw-w64-x86_64-python3-setuptools
+ pacman -S \
+ mingw-w64-x86_64-gcc \
+ mingw-w64-x86_64-python3 \
+ mingw-w64-x86_64-python3-pip \
+ mingw-w64-x86_64-python3-setuptools
- Prerequisites are installed on **MSYS2 MinGW 64-bit** with::
+ Prerequisites are installed on **MSYS2 MinGW 64-bit** with::
- pacman -S \
- mingw-w64-x86_64-libjpeg-turbo \
- mingw-w64-x86_64-zlib \
- mingw-w64-x86_64-libtiff \
- mingw-w64-x86_64-freetype \
- mingw-w64-x86_64-lcms2 \
- mingw-w64-x86_64-libwebp \
- mingw-w64-x86_64-openjpeg2 \
- mingw-w64-x86_64-libimagequant \
- mingw-w64-x86_64-libraqm
+ pacman -S \
+ mingw-w64-x86_64-libjpeg-turbo \
+ mingw-w64-x86_64-zlib \
+ mingw-w64-x86_64-libtiff \
+ mingw-w64-x86_64-freetype \
+ mingw-w64-x86_64-lcms2 \
+ mingw-w64-x86_64-libwebp \
+ mingw-w64-x86_64-openjpeg2 \
+ mingw-w64-x86_64-libimagequant \
+ mingw-w64-x86_64-libraqm
.. tab:: FreeBSD
- .. Note:: Only FreeBSD 10 and 11 tested
+ .. Note:: Only FreeBSD 10 and 11 tested
- Make sure you have Python's development libraries installed::
+ Make sure you have Python's development libraries installed::
- sudo pkg install python3
+ sudo pkg install python3
- Prerequisites are installed on **FreeBSD 10 or 11** with::
+ Prerequisites are installed on **FreeBSD 10 or 11** with::
- sudo pkg install jpeg-turbo tiff webp lcms2 freetype2 openjpeg harfbuzz fribidi libxcb
+ sudo pkg install jpeg-turbo tiff webp lcms2 freetype2 openjpeg harfbuzz fribidi libxcb
- Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
+ Then see ``depends/install_raqm_cmake.sh`` to install libraqm.
.. tab:: Android
- Basic Android support has been added for compilation within the Termux
- environment. The dependencies can be installed by::
+ Basic Android support has been added for compilation within the Termux
+ environment. The dependencies can be installed by::
- pkg install -y python ndk-sysroot clang make \
- libjpeg-turbo
+ pkg install -y python ndk-sysroot clang make \
+ libjpeg-turbo
- This has been tested within the Termux app on ChromeOS, on x86.
+ This has been tested within the Termux app on ChromeOS, on x86.
Installing
^^^^^^^^^^