Merge remote-tracking branch 'upstream/main' into valgrind-leakcheck

* Some failing tests are on main but not last released version
This commit is contained in:
Eric Soroos 2025-05-16 12:14:37 +02:00
commit 6391f2c207
131 changed files with 515 additions and 806 deletions

View File

@ -1 +1 @@
cibuildwheel==2.23.2 cibuildwheel==2.23.3

46
.github/ISSUE_TEMPLATE/RELEASE.md vendored Normal file
View File

@ -0,0 +1,46 @@
---
name: "Maintainers only: Release"
about: For maintainers to schedule a quarterly release
labels: Release
---
## Main release
Released quarterly on January 2nd, April 1st, July 1st and October 15th.
* [ ] Open a release ticket e.g. https://github.com/python-pillow/Pillow/issues/3154
* [ ] Develop and prepare release in `main` branch.
* [ ] Add release notes e.g. https://github.com/python-pillow/Pillow/pull/8885
* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions) to confirm passing tests in `main` branch.
* [ ] Check that all the wheel builds pass the tests in the [GitHub Actions "Wheels" workflow](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml) jobs by manually triggering them.
* [ ] In compliance with [PEP 440](https://peps.python.org/pep-0440/), update version identifier in `src/PIL/_version.py`
* [ ] Run pre-release check via `make release-test` in a freshly cloned repo.
* [ ] Create branch and tag for release e.g.:
```bash
git branch [[MAJOR.MINOR]].x
git tag [[MAJOR.MINOR]].0
git push --tags
```
* [ ] Check the [GitHub Actions "Wheels" workflow](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml) has passed, including the "Upload release to PyPI" job. This will have been triggered by the new tag.
* [ ] Publish the [release on GitHub](https://github.com/python-pillow/Pillow/releases).
* [ ] In compliance with [PEP 440](https://peps.python.org/pep-0440/), increment and append `.dev0` to version identifier in `src/PIL/_version.py` and then:
```bash
git push --all
```
## Publicize release
* [ ] Announce release availability via [Mastodon](https://fosstodon.org/@pillow) e.g. https://fosstodon.org/@pillow/110639450470725321
## Documentation
* [ ] Make sure the [default version for Read the Docs](https://pillow.readthedocs.io/en/stable/) is up-to-date with the release changes
## Docker images
* [ ] Update Pillow in the Docker Images repository
```bash
git clone https://github.com/python-pillow/docker-images
cd docker-images
./update-pillow-tag.sh [[release tag]]
```

View File

@ -47,8 +47,8 @@ jobs:
centos-stream-10-amd64, centos-stream-10-amd64,
debian-12-bookworm-x86, debian-12-bookworm-x86,
debian-12-bookworm-amd64, debian-12-bookworm-amd64,
fedora-40-amd64,
fedora-41-amd64, fedora-41-amd64,
fedora-42-amd64,
gentoo, gentoo,
ubuntu-22.04-jammy-amd64, ubuntu-22.04-jammy-amd64,
ubuntu-24.04-noble-amd64, ubuntu-24.04-noble-amd64,

View File

@ -84,7 +84,7 @@ jobs:
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
- name: Install CPython dependencies - name: Install CPython dependencies
if: "!contains(matrix.python-version, 'pypy') && matrix.architecture != 'x86'" if: "!contains(matrix.python-version, 'pypy') && !contains(matrix.python-version, '3.14') && matrix.architecture != 'x86'"
run: | run: |
python3 -m pip install PyQt6 python3 -m pip install PyQt6

View File

@ -38,7 +38,7 @@ ARCHIVE_SDIR=pillow-depends-main
# Package versions for fresh source builds # Package versions for fresh source builds
FREETYPE_VERSION=2.13.3 FREETYPE_VERSION=2.13.3
HARFBUZZ_VERSION=11.0.1 HARFBUZZ_VERSION=11.1.0
LIBPNG_VERSION=1.6.47 LIBPNG_VERSION=1.6.47
JPEGTURBO_VERSION=3.1.0 JPEGTURBO_VERSION=3.1.0
OPENJPEG_VERSION=2.5.3 OPENJPEG_VERSION=2.5.3
@ -92,7 +92,7 @@ function build_harfbuzz {
local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/harfbuzz-$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz) local out_dir=$(fetch_unpack https://github.com/harfbuzz/harfbuzz/releases/download/$HARFBUZZ_VERSION/harfbuzz-$HARFBUZZ_VERSION.tar.xz harfbuzz-$HARFBUZZ_VERSION.tar.xz)
(cd $out_dir \ (cd $out_dir \
&& meson setup build --prefix=$BUILD_PREFIX --libdir=$BUILD_PREFIX/lib --buildtype=release -Dfreetype=enabled -Dglib=disabled -Dtests=disabled) && meson setup build --prefix=$BUILD_PREFIX --libdir=$BUILD_PREFIX/lib --buildtype=minsize -Dfreetype=enabled -Dglib=disabled -Dtests=disabled)
(cd $out_dir/build \ (cd $out_dir/build \
&& meson install) && meson install)
touch harfbuzz-stamp touch harfbuzz-stamp

View File

@ -121,14 +121,17 @@ jobs:
windows: windows:
if: github.event_name != 'schedule' || github.repository_owner == 'python-pillow' if: github.event_name != 'schedule' || github.repository_owner == 'python-pillow'
name: Windows ${{ matrix.cibw_arch }} name: Windows ${{ matrix.cibw_arch }}
runs-on: windows-latest runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- cibw_arch: x86 - cibw_arch: x86
os: windows-latest
- cibw_arch: AMD64 - cibw_arch: AMD64
os: windows-latest
- cibw_arch: ARM64 - cibw_arch: ARM64
os: windows-11-arm
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with: with:

7
.github/zizmor.yml vendored Normal file
View File

@ -0,0 +1,7 @@
# Configuration for the zizmor static analysis tool, run via pre-commit in CI
# https://woodruffw.github.io/zizmor/configuration/
rules:
unpinned-uses:
config:
policies:
"*": ref-pin

View File

@ -1,6 +1,6 @@
repos: repos:
- repo: https://github.com/astral-sh/ruff-pre-commit - repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.4 rev: v0.11.8
hooks: hooks:
- id: ruff - id: ruff
args: [--exit-non-zero-on-fix] args: [--exit-non-zero-on-fix]
@ -24,7 +24,7 @@ repos:
exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$) exclude: (Makefile$|\.bat$|\.cmake$|\.eps$|\.fits$|\.gd$|\.opt$)
- repo: https://github.com/pre-commit/mirrors-clang-format - repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.0 rev: v20.1.3
hooks: hooks:
- id: clang-format - id: clang-format
types: [c] types: [c]
@ -51,14 +51,14 @@ repos:
exclude: ^.github/.*TEMPLATE|^Tests/(fonts|images)/ exclude: ^.github/.*TEMPLATE|^Tests/(fonts|images)/
- repo: https://github.com/python-jsonschema/check-jsonschema - repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.32.1 rev: 0.33.0
hooks: hooks:
- id: check-github-workflows - id: check-github-workflows
- id: check-readthedocs - id: check-readthedocs
- id: check-renovate - id: check-renovate
- repo: https://github.com/woodruffw/zizmor-pre-commit - repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v1.5.2 rev: v1.6.0
hooks: hooks:
- id: zizmor - id: zizmor

View File

@ -23,6 +23,10 @@ doc html:
htmlview: htmlview:
$(MAKE) -C docs htmlview $(MAKE) -C docs htmlview
.PHONY: htmllive
htmllive:
$(MAKE) -C docs htmllive
.PHONY: doccheck .PHONY: doccheck
doccheck: doccheck:
$(MAKE) doc $(MAKE) doc
@ -43,6 +47,7 @@ help:
@echo " docserve run an HTTP server on the docs directory" @echo " docserve run an HTTP server on the docs directory"
@echo " html make HTML docs" @echo " html make HTML docs"
@echo " htmlview open the index page built by the html target in your browser" @echo " htmlview open the index page built by the html target in your browser"
@echo " htmllive rebuild and reload HTML files in your browser"
@echo " install make and install" @echo " install make and install"
@echo " install-coverage make and install with C coverage" @echo " install-coverage make and install with C coverage"
@echo " lint run the lint checks" @echo " lint run the lint checks"

View File

@ -95,7 +95,7 @@ This library provides extensive file format support, an efficient internal repre
The core image library is designed for fast access to data stored in a few basic pixel formats. It should provide a solid foundation for a general image processing tool. The core image library is designed for fast access to data stored in a few basic pixel formats. It should provide a solid foundation for a general image processing tool.
## More Information ## More information
- [Documentation](https://pillow.readthedocs.io/) - [Documentation](https://pillow.readthedocs.io/)
- [Installation](https://pillow.readthedocs.io/en/latest/installation/basic-installation.html) - [Installation](https://pillow.readthedocs.io/en/latest/installation/basic-installation.html)
@ -107,6 +107,6 @@ The core image library is designed for fast access to data stored in a few basic
- [Changelog](https://github.com/python-pillow/Pillow/releases) - [Changelog](https://github.com/python-pillow/Pillow/releases)
- [Pre-fork](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst#pre-fork) - [Pre-fork](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst#pre-fork)
## Report a Vulnerability ## Report a vulnerability
To report a security vulnerability, please follow the procedure described in the [Tidelift security policy](https://tidelift.com/docs/security). To report a security vulnerability, please follow the procedure described in the [Tidelift security policy](https://tidelift.com/docs/security).

View File

@ -1,34 +1,15 @@
# Release Checklist # Release checklist
See https://pillow.readthedocs.io/en/stable/releasenotes/versioning.html for See https://pillow.readthedocs.io/en/stable/releasenotes/versioning.html for
information about how the version numbers line up with releases. information about how the version numbers line up with releases.
## Main Release ## Main release
Released quarterly on January 2nd, April 1st, July 1st and October 15th. Released quarterly on January 2nd, April 1st, July 1st and October 15th.
* [ ] Open a release ticket e.g. https://github.com/python-pillow/Pillow/issues/3154 * [ ] Create a new issue and select the "Maintainers only: Release" template.
* [ ] Develop and prepare release in `main` branch.
* [ ] Check [GitHub Actions](https://github.com/python-pillow/Pillow/actions) to confirm passing tests in `main` branch. ## Point release
* [ ] Check that all the wheel builds pass the tests in the [GitHub Actions "Wheels" workflow](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml) jobs by manually triggering them.
* [ ] In compliance with [PEP 440](https://peps.python.org/pep-0440/), update version identifier in `src/PIL/_version.py`
* [ ] Run pre-release check via `make release-test` in a freshly cloned repo.
* [ ] Create branch and tag for release e.g.:
```bash
git branch 5.2.x
git tag 5.2.0
git push --tags
```
* [ ] Check the [GitHub Actions "Wheels" workflow](https://github.com/python-pillow/Pillow/actions/workflows/wheels.yml)
has passed, including the "Upload release to PyPI" job. This will have been triggered
by the new tag.
* [ ] Publish the [release on GitHub](https://github.com/python-pillow/Pillow/releases).
* [ ] In compliance with [PEP 440](https://peps.python.org/pep-0440/),
increment and append `.dev0` to version identifier in `src/PIL/_version.py` and then:
```bash
git push --all
```
## Point Release
Released as needed for security, installation or critical bug fixes. Released as needed for security, installation or critical bug fixes.
@ -58,7 +39,7 @@ Released as needed for security, installation or critical bug fixes.
git push git push
``` ```
## Embargoed Release ## Embargoed release
Released as needed privately to individual vendors for critical security-related bug fixes. Released as needed privately to individual vendors for critical security-related bug fixes.
@ -82,7 +63,7 @@ Released as needed privately to individual vendors for critical security-related
git push origin 2.5.x git push origin 2.5.x
``` ```
## Publicize Release ## Publicize release
* [ ] Announce release availability via [Mastodon](https://fosstodon.org/@pillow) e.g. https://fosstodon.org/@pillow/110639450470725321 * [ ] Announce release availability via [Mastodon](https://fosstodon.org/@pillow) e.g. https://fosstodon.org/@pillow/110639450470725321
@ -90,7 +71,7 @@ Released as needed privately to individual vendors for critical security-related
* [ ] Make sure the [default version for Read the Docs](https://pillow.readthedocs.io/en/stable/) is up-to-date with the release changes * [ ] Make sure the [default version for Read the Docs](https://pillow.readthedocs.io/en/stable/) is up-to-date with the release changes
## Docker Images ## Docker images
* [ ] Update Pillow in the Docker Images repository * [ ] Update Pillow in the Docker Images repository
```bash ```bash

View File

@ -1,4 +1,4 @@
Pillow Tests Pillow tests
============ ============
Test scripts are named ``test_xxx.py``. Helper classes and functions can be found in ``helper.py``. Test scripts are named ``test_xxx.py``. Helper classes and functions can be found in ``helper.py``.

View File

@ -190,9 +190,9 @@ def test_rle8() -> None:
# Signal end of bitmap before the image is finished # Signal end of bitmap before the image is finished
with open("Tests/images/bmp/g/pal8rle.bmp", "rb") as fp: with open("Tests/images/bmp/g/pal8rle.bmp", "rb") as fp:
data = fp.read(1063) + b"\x01" data = fp.read(1063) + b"\x01"
with Image.open(io.BytesIO(data)) as im: with Image.open(io.BytesIO(data)) as im:
with pytest.raises(ValueError): with pytest.raises(ValueError):
im.load() im.load()
def test_rle4() -> None: def test_rle4() -> None:
@ -214,9 +214,9 @@ def test_rle4() -> None:
def test_rle8_eof(file_name: str, length: int) -> None: def test_rle8_eof(file_name: str, length: int) -> None:
with open(file_name, "rb") as fp: with open(file_name, "rb") as fp:
data = fp.read(length) data = fp.read(length)
with Image.open(io.BytesIO(data)) as im: with Image.open(io.BytesIO(data)) as im:
with pytest.raises(ValueError): with pytest.raises(ValueError):
im.load() im.load()
def test_offset() -> None: def test_offset() -> None:

View File

@ -457,8 +457,8 @@ def test_comment() -> None:
# Test an image that is truncated partway through a codestream # Test an image that is truncated partway through a codestream
with open("Tests/images/comment.jp2", "rb") as fp: with open("Tests/images/comment.jp2", "rb") as fp:
b = BytesIO(fp.read(130)) b = BytesIO(fp.read(130))
with Image.open(b) as im: with Image.open(b) as im:
pass pass
def test_save_comment(card: ImageFile.ImageFile) -> None: def test_save_comment(card: ImageFile.ImageFile) -> None:

View File

@ -81,7 +81,7 @@ class TestFileLibTiff(LibTiffTestCase):
s = io.BytesIO() s = io.BytesIO()
with open(test_file, "rb") as f: with open(test_file, "rb") as f:
s.write(f.read()) s.write(f.read())
s.seek(0) s.seek(0)
with Image.open(s) as im: with Image.open(s) as im:
assert im.size == (500, 500) assert im.size == (500, 500)
self._assert_noerr(tmp_path, im) self._assert_noerr(tmp_path, im)
@ -1050,12 +1050,12 @@ class TestFileLibTiff(LibTiffTestCase):
with open("Tests/images/old-style-jpeg-compression.tif", "rb") as fp: with open("Tests/images/old-style-jpeg-compression.tif", "rb") as fp:
data = fp.read() data = fp.read()
# Set EXIF Orientation to 2 # Set EXIF Orientation to 2
data = data[:102] + b"\x02" + data[103:] data = data[:102] + b"\x02" + data[103:]
with Image.open(io.BytesIO(data)) as im: with Image.open(io.BytesIO(data)) as im:
im = im.transpose(Image.Transpose.FLIP_LEFT_RIGHT) im = im.transpose(Image.Transpose.FLIP_LEFT_RIGHT)
assert_image_equal_tofile(im, "Tests/images/old-style-jpeg-compression.png") assert_image_equal_tofile(im, "Tests/images/old-style-jpeg-compression.png")
def test_open_missing_samplesperpixel(self) -> None: def test_open_missing_samplesperpixel(self) -> None:
with Image.open( with Image.open(

View File

@ -32,7 +32,7 @@ class TestFileLibTiffSmall(LibTiffTestCase):
s = BytesIO() s = BytesIO()
with open(test_file, "rb") as f: with open(test_file, "rb") as f:
s.write(f.read()) s.write(f.read())
s.seek(0) s.seek(0)
with Image.open(s) as im: with Image.open(s) as im:
assert im.size == (128, 128) assert im.size == (128, 128)
self._assert_noerr(tmp_path, im) self._assert_noerr(tmp_path, im)

View File

@ -462,7 +462,7 @@ class TestCoreResampleBox:
im.resize((32, 32), resample, (20, 20, 20, 100)) im.resize((32, 32), resample, (20, 20, 20, 100))
im.resize((32, 32), resample, (20, 20, 100, 20)) im.resize((32, 32), resample, (20, 20, 100, 20))
with pytest.raises(TypeError, match="must be sequence of length 4"): with pytest.raises(TypeError, match="must be (sequence|tuple) of length 4"):
im.resize((32, 32), resample, (im.width, im.height)) # type: ignore[arg-type] im.resize((32, 32), resample, (im.width, im.height)) # type: ignore[arg-type]
with pytest.raises(ValueError, match="can't be negative"): with pytest.raises(ValueError, match="can't be negative"):

View File

@ -43,6 +43,7 @@ class TestImageGrab:
if ( if (
sys.platform not in ("win32", "darwin") sys.platform not in ("win32", "darwin")
and not shutil.which("gnome-screenshot") and not shutil.which("gnome-screenshot")
and not shutil.which("grim")
and not shutil.which("spectacle") and not shutil.which("spectacle")
): ):
with pytest.raises(OSError) as e: with pytest.raises(OSError) as e:

View File

@ -162,3 +162,13 @@ def test_pickle_font_file(tmp_path: Path, protocol: int) -> None:
# Assert # Assert
helper_assert_pickled_font_images(font, unpickled_font) helper_assert_pickled_font_images(font, unpickled_font)
def test_load_earlier_data() -> None:
im = pickle.loads(
b"\x80\x04\x95@\x00\x00\x00\x00\x00\x00\x00\x8c\x12PIL.PngImagePlugin"
b"\x94\x8c\x0cPngImageFile\x94\x93\x94)\x81\x94]\x94(}\x94\x8c\x01L\x94K\x01"
b"K\x01\x86\x94NC\x01\x00\x94eb."
)
assert im.mode == "L"
assert im.size == (1, 1)

View File

@ -1,10 +0,0 @@
#!/usr/bin/env python3
from __future__ import annotations
from livereload.compiler import shell
from livereload.task import Task
Task.add("*.rst", shell("make html"))
Task.add("*/*.rst", shell("make html"))
Task.add("Makefile", shell("make html"))
Task.add("conf.py", shell("make html"))

View File

@ -3,43 +3,34 @@
# You can set these variables from the command line. # You can set these variables from the command line.
PYTHON = python3 PYTHON = python3
SPHINXOPTS =
SPHINXBUILD = $(PYTHON) -m sphinx.cmd.build SPHINXBUILD = $(PYTHON) -m sphinx.cmd.build
PAPER = SPHINXOPTS = --fail-on-warning
BUILDDIR = _build BUILDDIR = _build
BUILDER = html
JOBS = auto
PAPER =
# Internal variables. # Internal variables.
PAPEROPT_a4 = --define latex_paper_size=a4 PAPEROPT_a4 = --define latex_paper_size=a4
PAPEROPT_letter = --define latex_paper_size=letter PAPEROPT_letter = --define latex_paper_size=letter
ALLSPHINXOPTS = --doctree-dir $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others ALLSPHINXOPTS = --builder $(BUILDER) \
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . --doctree-dir $(BUILDDIR)/doctrees \
--jobs $(JOBS) \
$(PAPEROPT_$(PAPER)) \
$(SPHINXOPTS) \
. $(BUILDDIR)/$(BUILDER)
.PHONY: help .PHONY: help
help: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files" @echo " html to make standalone HTML files"
@echo " htmlview to open the index page built by the html target in your browser" @echo " htmlview to open the index page built by the html target in your browser"
@echo " htmllive to rebuild and reload HTML files in your browser"
@echo " serve to start a local server for viewing docs" @echo " serve to start a local server for viewing docs"
@echo " livehtml to start a local server for viewing docs and auto-reload on change"
@echo " dirhtml to make HTML files named index.html in directories" @echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file" @echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity" @echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
.PHONY: clean .PHONY: clean
clean: clean:
@ -51,159 +42,28 @@ install-sphinx:
.PHONY: html .PHONY: html
html: html:
$(MAKE) install-sphinx $(MAKE) install-sphinx
$(SPHINXBUILD) --builder html --fail-on-warning --keep-going $(ALLSPHINXOPTS) $(BUILDDIR)/html $(SPHINXBUILD) $(ALLSPHINXOPTS)
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
.PHONY: dirhtml .PHONY: dirhtml
dirhtml: dirhtml: BUILDER = dirhtml
$(MAKE) install-sphinx dirhtml: html
$(SPHINXBUILD) --builder dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
.PHONY: singlehtml .PHONY: singlehtml
singlehtml: singlehtml: BUILDER = singlehtml
$(MAKE) install-sphinx singlehtml: html
$(SPHINXBUILD) --builder singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
.PHONY: pickle
pickle:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
.PHONY: json
json:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
.PHONY: htmlhelp
htmlhelp:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
.PHONY: qthelp
qthelp:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/PillowPILfork.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/PillowPILfork.qhc"
.PHONY: devhelp
devhelp:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/PillowPILfork"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/PillowPILfork"
@echo "# devhelp"
.PHONY: epub
epub:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
.PHONY: latex
latex:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
.PHONY: latexpdf
latexpdf:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
.PHONY: text
text:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
.PHONY: man
man:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
.PHONY: texinfo
texinfo:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
.PHONY: info
info:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
.PHONY: gettext
gettext:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
.PHONY: changes
changes:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
.PHONY: linkcheck .PHONY: linkcheck
linkcheck: linkcheck: BUILDER = linkcheck
$(MAKE) install-sphinx linkcheck: html
$(SPHINXBUILD) --builder linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck -j auto
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
.PHONY: doctest
doctest:
$(MAKE) install-sphinx
$(SPHINXBUILD) --builder doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
.PHONY: htmlview .PHONY: htmlview
htmlview: html htmlview: html
$(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(BUILDDIR)/html/index.html'))" $(PYTHON) -c "import os, webbrowser; webbrowser.open('file://' + os.path.realpath('$(BUILDDIR)/html/index.html'))"
.PHONY: livehtml .PHONY: htmllive
livehtml: html htmllive: SPHINXBUILD = $(PYTHON) -m sphinx_autobuild
livereload $(BUILDDIR)/html -p 33233 htmllive: SPHINXOPTS = --open-browser --delay 0
htmllive: html
.PHONY: serve .PHONY: serve
serve: serve:

View File

@ -1,10 +1,10 @@
PIL Package (autodoc of remaining modules) PIL package (autodoc of remaining modules)
========================================== ==========================================
Reference for modules whose documentation has not yet been ported or written Reference for modules whose documentation has not yet been ported or written
can be found here. can be found here.
:mod:`PIL` Module :mod:`PIL` module
----------------- -----------------
.. py:module:: PIL .. py:module:: PIL
@ -12,7 +12,7 @@ can be found here.
.. autoexception:: UnidentifiedImageError .. autoexception:: UnidentifiedImageError
:show-inheritance: :show-inheritance:
:mod:`~PIL.BdfFontFile` Module :mod:`~PIL.BdfFontFile` module
------------------------------ ------------------------------
.. automodule:: PIL.BdfFontFile .. automodule:: PIL.BdfFontFile
@ -20,7 +20,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.ContainerIO` Module :mod:`~PIL.ContainerIO` module
------------------------------ ------------------------------
.. automodule:: PIL.ContainerIO .. automodule:: PIL.ContainerIO
@ -28,7 +28,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.FontFile` Module :mod:`~PIL.FontFile` module
--------------------------- ---------------------------
.. automodule:: PIL.FontFile .. automodule:: PIL.FontFile
@ -36,7 +36,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.GdImageFile` Module :mod:`~PIL.GdImageFile` module
------------------------------ ------------------------------
.. automodule:: PIL.GdImageFile .. automodule:: PIL.GdImageFile
@ -44,7 +44,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.GimpGradientFile` Module :mod:`~PIL.GimpGradientFile` module
----------------------------------- -----------------------------------
.. automodule:: PIL.GimpGradientFile .. automodule:: PIL.GimpGradientFile
@ -52,7 +52,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.GimpPaletteFile` Module :mod:`~PIL.GimpPaletteFile` module
---------------------------------- ----------------------------------
.. automodule:: PIL.GimpPaletteFile .. automodule:: PIL.GimpPaletteFile
@ -60,7 +60,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.ImageDraw2` Module :mod:`~PIL.ImageDraw2` module
----------------------------- -----------------------------
.. automodule:: PIL.ImageDraw2 .. automodule:: PIL.ImageDraw2
@ -69,7 +69,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.ImageMode` Module :mod:`~PIL.ImageMode` module
---------------------------- ----------------------------
.. automodule:: PIL.ImageMode .. automodule:: PIL.ImageMode
@ -77,7 +77,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PaletteFile` Module :mod:`~PIL.PaletteFile` module
------------------------------ ------------------------------
.. automodule:: PIL.PaletteFile .. automodule:: PIL.PaletteFile
@ -85,7 +85,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PcfFontFile` Module :mod:`~PIL.PcfFontFile` module
------------------------------ ------------------------------
.. automodule:: PIL.PcfFontFile .. automodule:: PIL.PcfFontFile
@ -93,7 +93,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:class:`.PngImagePlugin.iTXt` Class :class:`.PngImagePlugin.iTXt` class
----------------------------------- -----------------------------------
.. autoclass:: PIL.PngImagePlugin.iTXt .. autoclass:: PIL.PngImagePlugin.iTXt
@ -107,7 +107,7 @@ can be found here.
:param lang: language code :param lang: language code
:param tkey: UTF-8 version of the key name :param tkey: UTF-8 version of the key name
:class:`.PngImagePlugin.PngInfo` Class :class:`.PngImagePlugin.PngInfo` class
-------------------------------------- --------------------------------------
.. autoclass:: PIL.PngImagePlugin.PngInfo .. autoclass:: PIL.PngImagePlugin.PngInfo
@ -116,7 +116,7 @@ can be found here.
:show-inheritance: :show-inheritance:
:mod:`~PIL.TarIO` Module :mod:`~PIL.TarIO` module
------------------------ ------------------------
.. automodule:: PIL.TarIO .. automodule:: PIL.TarIO
@ -124,7 +124,7 @@ can be found here.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.WalImageFile` Module :mod:`~PIL.WalImageFile` module
------------------------------- -------------------------------
.. automodule:: PIL.WalImageFile .. automodule:: PIL.WalImageFile

View File

@ -229,97 +229,6 @@ html_js_files = [
# implements a search results scorer. If empty, the default will be used. # implements a search results scorer. If empty, the default will be used.
# html_search_scorer = 'scorer.js' # html_search_scorer = 'scorer.js'
# Output file base name for HTML help builder.
htmlhelp_basename = "PillowPILForkdoc"
# -- Options for LaTeX output ---------------------------------------------
latex_elements: dict[str, str] = {
# The paper size ('letterpaper' or 'a4paper').
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
# 'preamble': '',
# Latex figure (float) alignment
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(
master_doc,
"PillowPILFork.tex",
"Pillow (PIL Fork) Documentation",
"Jeffrey A. Clark",
"manual",
)
]
# The name of an image file (relative to this directory) to place at the top of
# the title page.
# latex_logo = None
# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
# latex_use_parts = False
# If true, show page references after internal links.
# latex_show_pagerefs = False
# If true, show URL addresses after external links.
# latex_show_urls = False
# Documents to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, "pillowpilfork", "Pillow (PIL Fork) Documentation", [author], 1)
]
# If true, show URL addresses after external links.
# man_show_urls = False
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(
master_doc,
"PillowPILFork",
"Pillow (PIL Fork) Documentation",
author,
"PillowPILFork",
"Pillow is the friendly PIL fork by Jeffrey A. Clark and contributors.",
"Miscellaneous",
)
]
# Documents to append as an appendix to all manuals.
# texinfo_appendices = []
# If false, no module index is generated.
# texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
# texinfo_show_urls = 'footnote'
# If true, do not generate a @detailmenu in the "Top" node's menu.
# texinfo_no_detailmenu = False
linkcheck_allowed_redirects = { linkcheck_allowed_redirects = {
r"https://www.bestpractices.dev/projects/6331": r"https://www.bestpractices.dev/en/.*", r"https://www.bestpractices.dev/projects/6331": r"https://www.bestpractices.dev/en/.*",

View File

@ -155,7 +155,7 @@ JpegImageFile.huffman_ac and JpegImageFile.huffman_dc
The ``huffman_ac`` and ``huffman_dc`` dictionaries on JPEG images were unused. They The ``huffman_ac`` and ``huffman_dc`` dictionaries on JPEG images were unused. They
have been deprecated, and will be removed in Pillow 12 (2025-10-15). have been deprecated, and will be removed in Pillow 12 (2025-10-15).
Specific WebP Feature Checks Specific WebP feature checks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. deprecated:: 11.0.0 .. deprecated:: 11.0.0

View File

@ -8,4 +8,5 @@ Appendices
image-file-formats image-file-formats
text-anchors text-anchors
third-party-plugins
writing-your-own-image-plugin writing-your-own-image-plugin

View File

@ -30,35 +30,35 @@ image. Each pixel uses the full range of the bit depth. So a 1-bit pixel has a r
INT32 and a 32-bit floating point pixel has the range of FLOAT32. The current release INT32 and a 32-bit floating point pixel has the range of FLOAT32. The current release
supports the following standard modes: supports the following standard modes:
* ``1`` (1-bit pixels, black and white, stored with one pixel per byte) * ``1`` (1-bit pixels, black and white, stored with one pixel per byte)
* ``L`` (8-bit pixels, grayscale) * ``L`` (8-bit pixels, grayscale)
* ``P`` (8-bit pixels, mapped to any other mode using a color palette) * ``P`` (8-bit pixels, mapped to any other mode using a color palette)
* ``RGB`` (3x8-bit pixels, true color) * ``RGB`` (3x8-bit pixels, true color)
* ``RGBA`` (4x8-bit pixels, true color with transparency mask) * ``RGBA`` (4x8-bit pixels, true color with transparency mask)
* ``CMYK`` (4x8-bit pixels, color separation) * ``CMYK`` (4x8-bit pixels, color separation)
* ``YCbCr`` (3x8-bit pixels, color video format) * ``YCbCr`` (3x8-bit pixels, color video format)
* Note that this refers to the JPEG, and not the ITU-R BT.2020, standard * Note that this refers to the JPEG, and not the ITU-R BT.2020, standard
* ``LAB`` (3x8-bit pixels, the L*a*b color space) * ``LAB`` (3x8-bit pixels, the L*a*b color space)
* ``HSV`` (3x8-bit pixels, Hue, Saturation, Value color space) * ``HSV`` (3x8-bit pixels, Hue, Saturation, Value color space)
* Hue's range of 0-255 is a scaled version of 0 degrees <= Hue < 360 degrees * Hue's range of 0-255 is a scaled version of 0 degrees <= Hue < 360 degrees
* ``I`` (32-bit signed integer pixels) * ``I`` (32-bit signed integer pixels)
* ``F`` (32-bit floating point pixels) * ``F`` (32-bit floating point pixels)
Pillow also provides limited support for a few additional modes, including: Pillow also provides limited support for a few additional modes, including:
* ``LA`` (L with alpha) * ``LA`` (L with alpha)
* ``PA`` (P with alpha) * ``PA`` (P with alpha)
* ``RGBX`` (true color with padding) * ``RGBX`` (true color with padding)
* ``RGBa`` (true color with premultiplied alpha) * ``RGBa`` (true color with premultiplied alpha)
* ``La`` (L with premultiplied alpha) * ``La`` (L with premultiplied alpha)
* ``I;16`` (16-bit unsigned integer pixels) * ``I;16`` (16-bit unsigned integer pixels)
* ``I;16L`` (16-bit little endian unsigned integer pixels) * ``I;16L`` (16-bit little endian unsigned integer pixels)
* ``I;16B`` (16-bit big endian unsigned integer pixels) * ``I;16B`` (16-bit big endian unsigned integer pixels)
* ``I;16N`` (16-bit native endian unsigned integer pixels) * ``I;16N`` (16-bit native endian unsigned integer pixels)
Premultiplied alpha is where the values for each other channel have been Premultiplied alpha is where the values for each other channel have been
multiplied by the alpha. For example, an RGBA pixel of ``(10, 20, 30, 127)`` multiplied by the alpha. For example, an RGBA pixel of ``(10, 20, 30, 127)``
@ -84,7 +84,7 @@ pixels.
.. _coordinate-system: .. _coordinate-system:
Coordinate System Coordinate system
----------------- -----------------
The Python Imaging Library uses a Cartesian pixel coordinate system, with (0,0) The Python Imaging Library uses a Cartesian pixel coordinate system, with (0,0)

View File

@ -1222,7 +1222,7 @@ numbers are returned as a tuple of ``(numerator, denominator)``.
.. deprecated:: 3.0.0 .. deprecated:: 3.0.0
Reading Multi-frame TIFF Images Reading multi-frame TIFF images
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The TIFF loader supports the :py:meth:`~PIL.Image.Image.seek` and The TIFF loader supports the :py:meth:`~PIL.Image.Image.seek` and
@ -1664,6 +1664,11 @@ The :py:meth:`~PIL.Image.open` method sets the following
Transparency color index. This key is omitted if the image is not Transparency color index. This key is omitted if the image is not
transparent. transparent.
XV thumbnails
^^^^^^^^^^^^^
Pillow can read XV thumbnail files.
Write-only formats Write-only formats
------------------ ------------------
@ -1769,11 +1774,6 @@ The :py:meth:`~PIL.Image.Image.save` method can take the following keyword argum
.. versionadded:: 5.3.0 .. versionadded:: 5.3.0
XV Thumbnails
^^^^^^^^^^^^^
Pillow can read XV thumbnail files.
Identify-only formats Identify-only formats
--------------------- ---------------------

View File

@ -13,7 +13,7 @@ processing tool.
Lets look at a few possible uses of this library. Lets look at a few possible uses of this library.
Image Archives Image archives
-------------- --------------
The Python Imaging Library is ideal for image archival and batch processing The Python Imaging Library is ideal for image archival and batch processing
@ -24,7 +24,7 @@ The current version identifies and reads a large number of formats. Write
support is intentionally restricted to the most commonly used interchange and support is intentionally restricted to the most commonly used interchange and
presentation formats. presentation formats.
Image Display Image display
------------- -------------
The current release includes Tk :py:class:`~PIL.ImageTk.PhotoImage` and The current release includes Tk :py:class:`~PIL.ImageTk.PhotoImage` and
@ -36,7 +36,7 @@ support.
For debugging, theres also a :py:meth:`~PIL.Image.Image.show` method which saves an image to For debugging, theres also a :py:meth:`~PIL.Image.Image.show` method which saves an image to
disk, and calls an external display utility. disk, and calls an external display utility.
Image Processing Image processing
---------------- ----------------
The library contains basic image processing functionality, including point operations, filtering with a set of built-in convolution kernels, and colour space conversions. The library contains basic image processing functionality, including point operations, filtering with a set of built-in convolution kernels, and colour space conversions.

View File

@ -0,0 +1,18 @@
Third-party plugins
===================
Pillow uses a plugin model which allows users to add their own
decoders and encoders to the library, without any changes to the library
itself.
Here is a list of PyPI projects that offer additional plugins:
* :pypi:`DjvuRleImagePlugin`: Plugin for the DjVu RLE image format as defined in the DjVuLibre docs.
* :pypi:`heif-image-plugin`: Simple HEIF/HEIC images plugin, based on the pyheif library.
* :pypi:`jxlpy`: Introduces reading and writing support for JPEG XL.
* :pypi:`pillow-heif`: Python bindings to libheif for working with HEIF images.
* :pypi:`pillow-jpls`: Plugin for the JPEG-LS codec, based on the Charls JPEG-LS implemetation. Python bindings implemented using pybind11.
* :pypi:`pillow-jxl-plugin`: Plugin for JPEG-XL, using Rust for bindings.
* :pypi:`pillow-mbm`: Adds support for KSP's proprietary MBM texture format.
* :pypi:`pillow-svg`: Implements basic SVG read support. Supports basic paths, shapes, and text.
* :pypi:`raw-pillow-opener`: Simple camera raw opener, based on the rawpy library.

View File

@ -122,7 +122,7 @@ This means that opening an image file is a fast operation, which is independent
of the file size and compression type. Heres a simple script to quickly of the file size and compression type. Heres a simple script to quickly
identify a set of image files: identify a set of image files:
Identify Image Files Identify image files
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
:: ::
@ -399,7 +399,7 @@ Applying filters
.. image:: enhanced_hopper.webp .. image:: enhanced_hopper.webp
:align: center :align: center
Point Operations Point operations
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
The :py:meth:`~PIL.Image.Image.point` method can be used to translate the pixel The :py:meth:`~PIL.Image.Image.point` method can be used to translate the pixel

View File

@ -1,6 +1,6 @@
.. _image-plugins: .. _image-plugins:
Writing Your Own Image Plugin Writing your own image plugin
============================= =============================
Pillow uses a plugin model which allows you to add your own Pillow uses a plugin model which allows you to add your own
@ -329,7 +329,7 @@ The fields are used as follows:
.. _file-codecs: .. _file-codecs:
Writing Your Own File Codec in C Writing your own file codec in C
================================ ================================
There are 3 stages in a file codec's lifetime: There are 3 stages in a file codec's lifetime:
@ -414,7 +414,7 @@ memory and release any resources from external libraries.
.. _file-codecs-py: .. _file-codecs-py:
Writing Your Own File Codec in Python Writing your own file codec in Python
===================================== =====================================
Python file decoders and encoders should derive from Python file decoders and encoders should derive from

View File

@ -3,27 +3,27 @@
Installation Installation
============ ============
Basic Installation Basic installation
------------------ ------------------
.. Note:: This section has moved to :ref:`basic-installation`. Please update references accordingly. .. Note:: This section has moved to :ref:`basic-installation`. Please update references accordingly.
Python Support Python support
-------------- --------------
.. Note:: This section has moved to :ref:`python-support`. Please update references accordingly. .. Note:: This section has moved to :ref:`python-support`. Please update references accordingly.
Platform Support Platform support
---------------- ----------------
.. Note:: This section has moved to :ref:`platform-support`. Please update references accordingly. .. Note:: This section has moved to :ref:`platform-support`. Please update references accordingly.
Building From Source Building from source
-------------------- --------------------
.. Note:: This section has moved to :ref:`building-from-source`. Please update references accordingly. .. Note:: This section has moved to :ref:`building-from-source`. Please update references accordingly.
Old Versions Old versions
------------ ------------
.. Note:: This section has moved to :ref:`old-versions`. Please update references accordingly. .. Note:: This section has moved to :ref:`old-versions`. Please update references accordingly.

View File

@ -8,7 +8,7 @@
.. _basic-installation: .. _basic-installation:
Basic Installation Basic installation
================== ==================
.. note:: .. note::

View File

@ -8,12 +8,12 @@
.. _building-from-source: .. _building-from-source:
Building From Source Building from source
==================== ====================
.. _external-libraries: .. _external-libraries:
External Libraries External libraries
------------------ ------------------
.. note:: .. note::
@ -271,7 +271,7 @@ After navigating to the Pillow directory, run::
.. _compressed archive from PyPI: https://pypi.org/project/pillow/#files .. _compressed archive from PyPI: https://pypi.org/project/pillow/#files
Build Options Build options
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
* Config setting: ``-C parallel=n``. Can also be given * Config setting: ``-C parallel=n``. Can also be given
@ -319,7 +319,7 @@ Sample usage::
.. _old-versions: .. _old-versions:
Old Versions Old versions
============ ============
You can download old distributions from the `release history at PyPI You can download old distributions from the `release history at PyPI

View File

@ -1,6 +1,6 @@
.. _platform-support: .. _platform-support:
Platform Support Platform support
================ ================
Current platform support for Pillow. Binary distributions are Current platform support for Pillow. Binary distributions are
@ -9,7 +9,7 @@ should compile and run everywhere platform support is listed. In
general, we aim to support all current versions of Linux, macOS, and general, we aim to support all current versions of Linux, macOS, and
Windows. Windows.
Continuous Integration Targets Continuous integration targets
------------------------------ ------------------------------
These platforms are built and tested for every change. These platforms are built and tested for every change.
@ -23,7 +23,7 @@ These platforms are built and tested for every change.
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Amazon Linux 2023 | 3.9 | x86-64 | | Amazon Linux 2023 | 3.9 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Arch | 3.12 | x86-64 | | Arch | 3.13 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| CentOS Stream 9 | 3.9 | x86-64 | | CentOS Stream 9 | 3.9 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
@ -31,10 +31,10 @@ These platforms are built and tested for every change.
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Debian 12 Bookworm | 3.11 | x86, x86-64 | | Debian 12 Bookworm | 3.11 | x86, x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Fedora 40 | 3.12 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Fedora 41 | 3.13 | x86-64 | | Fedora 41 | 3.13 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| Fedora 42 | 3.13 | x86-64 |
+----------------------------------+----------------------------+---------------------+
| Gentoo | 3.12 | x86-64 | | Gentoo | 3.12 | x86-64 |
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
| macOS 13 Ventura | 3.9 | x86-64 | | macOS 13 Ventura | 3.9 | x86-64 |
@ -59,7 +59,7 @@ These platforms are built and tested for every change.
+----------------------------------+----------------------------+---------------------+ +----------------------------------+----------------------------+---------------------+
Other Platforms Other platforms
--------------- ---------------
These platforms have been reported to work at the versions mentioned. These platforms have been reported to work at the versions mentioned.
@ -73,7 +73,7 @@ These platforms have been reported to work at the versions mentioned.
| Operating system | | Tested Python | | Latest tested | | Tested | | Operating system | | Tested Python | | Latest tested | | Tested |
| | | versions | | Pillow version | | processors | | | | versions | | Pillow version | | processors |
+==================================+============================+==================+==============+ +==================================+============================+==================+==============+
| macOS 15 Sequoia | 3.9, 3.10, 3.11, 3.12, 3.13| 11.1.0 |arm | | macOS 15 Sequoia | 3.9, 3.10, 3.11, 3.12, 3.13| 11.2.1 |arm |
| +----------------------------+------------------+ | | +----------------------------+------------------+ |
| | 3.8 | 10.4.0 | | | | 3.8 | 10.4.0 | |
+----------------------------------+----------------------------+------------------+--------------+ +----------------------------------+----------------------------+------------------+--------------+

View File

@ -1,6 +1,6 @@
.. _python-support: .. _python-support:
Python Support Python support
============== ==============
Pillow supports these Python versions. Pillow supports these Python versions.

View File

@ -7,10 +7,8 @@ if "%SPHINXBUILD%" == "" (
) )
set BUILDDIR=_build set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
set I18NSPHINXOPTS=%SPHINXOPTS% .
if NOT "%PAPER%" == "" ( if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%
) )
if "%1" == "" goto help if "%1" == "" goto help
@ -22,20 +20,7 @@ if "%1" == "help" (
echo. htmlview to open the index page built by the html target in your browser echo. htmlview to open the index page built by the html target in your browser
echo. dirhtml to make HTML files named index.html in directories echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. texinfo to make Texinfo files
echo. gettext to make PO message catalogs
echo. changes to make an overview over all changed/added/deprecated items
echo. linkcheck to check all external links for integrity echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end goto end
) )
@ -80,107 +65,6 @@ if "%1" == "singlehtml" (
goto end goto end
) )
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\PillowPILfork.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\PillowPILfork.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "texinfo" (
%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.
goto end
)
if "%1" == "gettext" (
%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The message catalogs are in %BUILDDIR%/locale.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" ( if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1 if errorlevel 1 exit /b 1
@ -190,13 +74,4 @@ or in %BUILDDIR%/linkcheck/output.txt.
goto end goto end
) )
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
:end :end

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ExifTags .. py:module:: PIL.ExifTags
.. py:currentmodule:: PIL.ExifTags .. py:currentmodule:: PIL.ExifTags
:py:mod:`~PIL.ExifTags` Module :py:mod:`~PIL.ExifTags` module
============================== ==============================
The :py:mod:`~PIL.ExifTags` module exposes several :py:class:`enum.IntEnum` The :py:mod:`~PIL.ExifTags` module exposes several :py:class:`enum.IntEnum`

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.Image .. py:module:: PIL.Image
.. py:currentmodule:: PIL.Image .. py:currentmodule:: PIL.Image
:py:mod:`~PIL.Image` Module :py:mod:`~PIL.Image` module
=========================== ===========================
The :py:mod:`~PIL.Image` module provides a class with the same name which is The :py:mod:`~PIL.Image` module provides a class with the same name which is
@ -113,7 +113,7 @@ Registering plugins
.. autofunction:: register_decoder .. autofunction:: register_decoder
.. autofunction:: register_encoder .. autofunction:: register_encoder
The Image Class The Image class
--------------- ---------------
.. autoclass:: PIL.Image.Image .. autoclass:: PIL.Image.Image
@ -261,7 +261,7 @@ method. ::
.. automethod:: PIL.Image.Image.load .. automethod:: PIL.Image.Image.load
.. automethod:: PIL.Image.Image.close .. automethod:: PIL.Image.Image.close
Image Attributes Image attributes
---------------- ----------------
Instances of the :py:class:`Image` class have the following attributes: Instances of the :py:class:`Image` class have the following attributes:

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageChops .. py:module:: PIL.ImageChops
.. py:currentmodule:: PIL.ImageChops .. py:currentmodule:: PIL.ImageChops
:py:mod:`~PIL.ImageChops` ("Channel Operations") Module :py:mod:`~PIL.ImageChops` ("channel operations") module
======================================================= =======================================================
The :py:mod:`~PIL.ImageChops` module contains a number of arithmetical image The :py:mod:`~PIL.ImageChops` module contains a number of arithmetical image

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageCms .. py:module:: PIL.ImageCms
.. py:currentmodule:: PIL.ImageCms .. py:currentmodule:: PIL.ImageCms
:py:mod:`~PIL.ImageCms` Module :py:mod:`~PIL.ImageCms` module
============================== ==============================
The :py:mod:`~PIL.ImageCms` module provides color profile management The :py:mod:`~PIL.ImageCms` module provides color profile management

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageColor .. py:module:: PIL.ImageColor
.. py:currentmodule:: PIL.ImageColor .. py:currentmodule:: PIL.ImageColor
:py:mod:`~PIL.ImageColor` Module :py:mod:`~PIL.ImageColor` module
================================ ================================
The :py:mod:`~PIL.ImageColor` module contains color tables and converters from The :py:mod:`~PIL.ImageColor` module contains color tables and converters from
@ -11,7 +11,7 @@ others.
.. _color-names: .. _color-names:
Color Names Color names
----------- -----------
The ImageColor module supports the following string formats: The ImageColor module supports the following string formats:

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageDraw .. py:module:: PIL.ImageDraw
.. py:currentmodule:: PIL.ImageDraw .. py:currentmodule:: PIL.ImageDraw
:py:mod:`~PIL.ImageDraw` Module :py:mod:`~PIL.ImageDraw` module
=============================== ===============================
The :py:mod:`~PIL.ImageDraw` module provides simple 2D graphics for The :py:mod:`~PIL.ImageDraw` module provides simple 2D graphics for
@ -54,7 +54,7 @@ later, you can also use RGB 3-tuples or color names (see below). The drawing
layer will automatically assign color indexes, as long as you dont draw with layer will automatically assign color indexes, as long as you dont draw with
more than 256 colors. more than 256 colors.
Color Names Color names
^^^^^^^^^^^ ^^^^^^^^^^^
See :ref:`color-names` for the color names supported by Pillow. See :ref:`color-names` for the color names supported by Pillow.
@ -75,7 +75,7 @@ To load a OpenType/TrueType font, use the truetype function in the
:py:mod:`~PIL.ImageFont` module. Note that this function depends on third-party :py:mod:`~PIL.ImageFont` module. Note that this function depends on third-party
libraries, and may not available in all PIL builds. libraries, and may not available in all PIL builds.
Example: Draw Partial Opacity Text Example: Draw partial opacity text
---------------------------------- ----------------------------------
:: ::
@ -102,7 +102,7 @@ Example: Draw Partial Opacity Text
out.show() out.show()
Example: Draw Multiline Text Example: Draw multiline text
---------------------------- ----------------------------
:: ::

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageEnhance .. py:module:: PIL.ImageEnhance
.. py:currentmodule:: PIL.ImageEnhance .. py:currentmodule:: PIL.ImageEnhance
:py:mod:`~PIL.ImageEnhance` Module :py:mod:`~PIL.ImageEnhance` module
================================== ==================================
The :py:mod:`~PIL.ImageEnhance` module contains a number of classes that can be used The :py:mod:`~PIL.ImageEnhance` module contains a number of classes that can be used

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageFile .. py:module:: PIL.ImageFile
.. py:currentmodule:: PIL.ImageFile .. py:currentmodule:: PIL.ImageFile
:py:mod:`~PIL.ImageFile` Module :py:mod:`~PIL.ImageFile` module
=============================== ===============================
The :py:mod:`~PIL.ImageFile` module provides support functions for the image open The :py:mod:`~PIL.ImageFile` module provides support functions for the image open

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageFilter .. py:module:: PIL.ImageFilter
.. py:currentmodule:: PIL.ImageFilter .. py:currentmodule:: PIL.ImageFilter
:py:mod:`~PIL.ImageFilter` Module :py:mod:`~PIL.ImageFilter` module
================================= =================================
The :py:mod:`~PIL.ImageFilter` module contains definitions for a pre-defined set of The :py:mod:`~PIL.ImageFilter` module contains definitions for a pre-defined set of

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageFont .. py:module:: PIL.ImageFont
.. py:currentmodule:: PIL.ImageFont .. py:currentmodule:: PIL.ImageFont
:py:mod:`~PIL.ImageFont` Module :py:mod:`~PIL.ImageFont` module
=============================== ===============================
The :py:mod:`~PIL.ImageFont` module defines a class with the same name. Instances of The :py:mod:`~PIL.ImageFont` module defines a class with the same name. Instances of

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageGrab .. py:module:: PIL.ImageGrab
.. py:currentmodule:: PIL.ImageGrab .. py:currentmodule:: PIL.ImageGrab
:py:mod:`~PIL.ImageGrab` Module :py:mod:`~PIL.ImageGrab` module
=============================== ===============================
The :py:mod:`~PIL.ImageGrab` module can be used to copy the contents of the screen The :py:mod:`~PIL.ImageGrab` module can be used to copy the contents of the screen
@ -16,9 +16,9 @@ or the clipboard to a PIL image memory.
the entire screen is copied, and on macOS, it will be at 2x if on a Retina screen. the entire screen is copied, and on macOS, it will be at 2x if on a Retina screen.
On Linux, if ``xdisplay`` is ``None`` and the default X11 display does not return On Linux, if ``xdisplay`` is ``None`` and the default X11 display does not return
a snapshot of the screen, ``gnome-screenshot`` or ``spectacle`` will be used as a a snapshot of the screen, ``gnome-screenshot``, ``grim`` or ``spectacle`` will be
fallback if they are installed. To disable this behaviour, pass ``xdisplay=""`` used as a fallback if they are installed. To disable this behaviour, pass
instead. ``xdisplay=""`` instead.
.. versionadded:: 1.1.3 (Windows), 3.0.0 (macOS), 7.1.0 (Linux) .. versionadded:: 1.1.3 (Windows), 3.0.0 (macOS), 7.1.0 (Linux)

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageMath .. py:module:: PIL.ImageMath
.. py:currentmodule:: PIL.ImageMath .. py:currentmodule:: PIL.ImageMath
:py:mod:`~PIL.ImageMath` Module :py:mod:`~PIL.ImageMath` module
=============================== ===============================
The :py:mod:`~PIL.ImageMath` module can be used to evaluate “image expressions”, that The :py:mod:`~PIL.ImageMath` module can be used to evaluate “image expressions”, that
@ -86,7 +86,7 @@ Expression syntax
It is not recommended to process expressions without considering this. It is not recommended to process expressions without considering this.
:py:meth:`lambda_eval` is a more secure alternative. :py:meth:`lambda_eval` is a more secure alternative.
Standard Operators Standard operators
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
You can use standard arithmetical operators for addition (+), subtraction (-), You can use standard arithmetical operators for addition (+), subtraction (-),
@ -102,7 +102,7 @@ an 8-bit image, the result will be a 32-bit floating point image.
You can force conversion using the ``convert()``, ``float()``, and ``int()`` You can force conversion using the ``convert()``, ``float()``, and ``int()``
functions described below. functions described below.
Bitwise Operators Bitwise operators
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
The module also provides operations that operate on individual bits. This The module also provides operations that operate on individual bits. This
@ -116,7 +116,7 @@ mask off unwanted bits.
Bitwise operators dont work on floating point images. Bitwise operators dont work on floating point images.
Logical Operators Logical operators
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
Logical operators like ``and``, ``or``, and ``not`` work Logical operators like ``and``, ``or``, and ``not`` work
@ -128,7 +128,7 @@ treated as true.
Note that ``and`` and ``or`` return the last evaluated operand, Note that ``and`` and ``or`` return the last evaluated operand,
while not always returns a boolean value. while not always returns a boolean value.
Built-in Functions Built-in functions
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
These functions are applied to each individual pixel. These functions are applied to each individual pixel.

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageMorph .. py:module:: PIL.ImageMorph
.. py:currentmodule:: PIL.ImageMorph .. py:currentmodule:: PIL.ImageMorph
:py:mod:`~PIL.ImageMorph` Module :py:mod:`~PIL.ImageMorph` module
================================ ================================
The :py:mod:`~PIL.ImageMorph` module provides morphology operations on images. The :py:mod:`~PIL.ImageMorph` module provides morphology operations on images.

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageOps .. py:module:: PIL.ImageOps
.. py:currentmodule:: PIL.ImageOps .. py:currentmodule:: PIL.ImageOps
:py:mod:`~PIL.ImageOps` Module :py:mod:`~PIL.ImageOps` module
============================== ==============================
The :py:mod:`~PIL.ImageOps` module contains a number of ready-made image The :py:mod:`~PIL.ImageOps` module contains a number of ready-made image

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImagePalette .. py:module:: PIL.ImagePalette
.. py:currentmodule:: PIL.ImagePalette .. py:currentmodule:: PIL.ImagePalette
:py:mod:`~PIL.ImagePalette` Module :py:mod:`~PIL.ImagePalette` module
================================== ==================================
The :py:mod:`~PIL.ImagePalette` module contains a class of the same name to The :py:mod:`~PIL.ImagePalette` module contains a class of the same name to

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImagePath .. py:module:: PIL.ImagePath
.. py:currentmodule:: PIL.ImagePath .. py:currentmodule:: PIL.ImagePath
:py:mod:`~PIL.ImagePath` Module :py:mod:`~PIL.ImagePath` module
=============================== ===============================
The :py:mod:`~PIL.ImagePath` module is used to store and manipulate 2-dimensional The :py:mod:`~PIL.ImagePath` module is used to store and manipulate 2-dimensional

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageQt .. py:module:: PIL.ImageQt
.. py:currentmodule:: PIL.ImageQt .. py:currentmodule:: PIL.ImageQt
:py:mod:`~PIL.ImageQt` Module :py:mod:`~PIL.ImageQt` module
============================= =============================
The :py:mod:`~PIL.ImageQt` module contains support for creating PyQt6 or PySide6 The :py:mod:`~PIL.ImageQt` module contains support for creating PyQt6 or PySide6

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageSequence .. py:module:: PIL.ImageSequence
.. py:currentmodule:: PIL.ImageSequence .. py:currentmodule:: PIL.ImageSequence
:py:mod:`~PIL.ImageSequence` Module :py:mod:`~PIL.ImageSequence` module
=================================== ===================================
The :py:mod:`~PIL.ImageSequence` module contains a wrapper class that lets you The :py:mod:`~PIL.ImageSequence` module contains a wrapper class that lets you

View File

@ -1,10 +1,10 @@
.. py:module:: PIL.ImageShow .. py:module:: PIL.ImageShow
.. py:currentmodule:: PIL.ImageShow .. py:currentmodule:: PIL.ImageShow
:py:mod:`~PIL.ImageShow` Module :py:mod:`~PIL.ImageShow` module
=============================== ===============================
The :py:mod:`~PIL.ImageShow` Module is used to display images. The :py:mod:`~PIL.ImageShow` module is used to display images.
All default viewers convert the image to be shown to PNG format. All default viewers convert the image to be shown to PNG format.
.. autofunction:: PIL.ImageShow.show .. autofunction:: PIL.ImageShow.show

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageStat .. py:module:: PIL.ImageStat
.. py:currentmodule:: PIL.ImageStat .. py:currentmodule:: PIL.ImageStat
:py:mod:`~PIL.ImageStat` Module :py:mod:`~PIL.ImageStat` module
=============================== ===============================
The :py:mod:`~PIL.ImageStat` module calculates global statistics for an image, or The :py:mod:`~PIL.ImageStat` module calculates global statistics for an image, or

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageTk .. py:module:: PIL.ImageTk
.. py:currentmodule:: PIL.ImageTk .. py:currentmodule:: PIL.ImageTk
:py:mod:`~PIL.ImageTk` Module :py:mod:`~PIL.ImageTk` module
============================= =============================
The :py:mod:`~PIL.ImageTk` module contains support to create and modify Tkinter The :py:mod:`~PIL.ImageTk` module contains support to create and modify Tkinter

View File

@ -2,7 +2,7 @@
.. py:module:: PIL.ImageTransform .. py:module:: PIL.ImageTransform
.. py:currentmodule:: PIL.ImageTransform .. py:currentmodule:: PIL.ImageTransform
:py:mod:`~PIL.ImageTransform` Module :py:mod:`~PIL.ImageTransform` module
==================================== ====================================
The :py:mod:`~PIL.ImageTransform` module contains implementations of The :py:mod:`~PIL.ImageTransform` module contains implementations of

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.ImageWin .. py:module:: PIL.ImageWin
.. py:currentmodule:: PIL.ImageWin .. py:currentmodule:: PIL.ImageWin
:py:mod:`~PIL.ImageWin` Module (Windows-only) :py:mod:`~PIL.ImageWin` module (Windows-only)
============================================= =============================================
The :py:mod:`~PIL.ImageWin` module contains support to create and display images on The :py:mod:`~PIL.ImageWin` module contains support to create and display images on

View File

@ -1,6 +1,6 @@
.. py:currentmodule:: PIL.JpegPresets .. py:currentmodule:: PIL.JpegPresets
:py:mod:`~PIL.JpegPresets` Module :py:mod:`~PIL.JpegPresets` module
================================= =================================
.. automodule:: PIL.JpegPresets .. automodule:: PIL.JpegPresets

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.PSDraw .. py:module:: PIL.PSDraw
.. py:currentmodule:: PIL.PSDraw .. py:currentmodule:: PIL.PSDraw
:py:mod:`~PIL.PSDraw` Module :py:mod:`~PIL.PSDraw` module
============================ ============================
The :py:mod:`~PIL.PSDraw` module provides simple print support for PostScript The :py:mod:`~PIL.PSDraw` module provides simple print support for PostScript

View File

@ -1,6 +1,6 @@
.. _PixelAccess: .. _PixelAccess:
:py:class:`PixelAccess` Class :py:class:`PixelAccess` class
============================= =============================
The PixelAccess class provides read and write access to The PixelAccess class provides read and write access to
@ -40,7 +40,7 @@ Access using negative indexes is also possible. ::
:py:class:`PixelAccess` Class :py:class:`PixelAccess` class
----------------------------- -----------------------------
.. class:: PixelAccess .. class:: PixelAccess

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.TiffTags .. py:module:: PIL.TiffTags
.. py:currentmodule:: PIL.TiffTags .. py:currentmodule:: PIL.TiffTags
:py:mod:`~PIL.TiffTags` Module :py:mod:`~PIL.TiffTags` module
============================== ==============================
The :py:mod:`~PIL.TiffTags` module exposes many of the standard TIFF The :py:mod:`~PIL.TiffTags` module exposes many of the standard TIFF

View File

@ -1,7 +1,7 @@
.. _arrow-support: .. _arrow-support:
============= =============
Arrow Support Arrow support
============= =============
`Arrow <https://arrow.apache.org/>`__ `Arrow <https://arrow.apache.org/>`__
@ -18,7 +18,7 @@ with any Arrow provider or consumer in the Python ecosystem.
full-copy memory cost to reading an Arrow image. full-copy memory cost to reading an Arrow image.
Data Formats Data formats
============ ============
Pillow currently supports exporting Arrow images in all modes Pillow currently supports exporting Arrow images in all modes
@ -43,7 +43,7 @@ interpreted using the mode-specific interpretation of the bytes.
The image mode must match the Arrow band format when reading single The image mode must match the Arrow band format when reading single
channel images. channel images.
Memory Allocator Memory allocator
================ ================
Pillow's default memory allocator, the :ref:`block_allocator`, Pillow's default memory allocator, the :ref:`block_allocator`,
@ -59,7 +59,7 @@ To enable the single block allocator::
Note that this is a global setting, not a per-image setting. Note that this is a global setting, not a per-image setting.
Unsupported Features Unsupported features
==================== ====================
* Table/dataframe protocol. We support a single array. * Table/dataframe protocol. We support a single array.
@ -71,7 +71,7 @@ Unsupported Features
parameter. parameter.
* Array metadata. * Array metadata.
Internal Details Internal details
================ ================
Python Arrow C interface: Python Arrow C interface:

View File

@ -1,10 +1,10 @@
.. _block_allocator: .. _block_allocator:
Block Allocator Block allocator
=============== ===============
Previous Design Previous design
--------------- ---------------
Historically there have been two image allocators in Pillow: Historically there have been two image allocators in Pillow:
@ -16,7 +16,7 @@ large images and makes one allocation for each scan line of size
between one allocation and potentially thousands of small allocations, between one allocation and potentially thousands of small allocations,
leading to unpredictable performance penalties around the transition. leading to unpredictable performance penalties around the transition.
New Design New design
---------- ----------
``ImagingAllocateArray`` now allocates space for images as a chain of ``ImagingAllocateArray`` now allocates space for images as a chain of
@ -28,7 +28,7 @@ line. This is now the default for all internal allocations.
specifically requesting a single segment of memory for sharing with specifically requesting a single segment of memory for sharing with
other code. other code.
Memory Pools Memory pools
------------ ------------
There is now a memory pool to contain a supply of recently freed There is now a memory pool to contain a supply of recently freed
@ -37,14 +37,14 @@ fresh allocation. This caching of free blocks is currently disabled by
default, but can be enabled and tweaked using three environment default, but can be enabled and tweaked using three environment
variables: variables:
* ``PILLOW_ALIGNMENT``, in bytes. Specifies the alignment of memory * ``PILLOW_ALIGNMENT``, in bytes. Specifies the alignment of memory
allocations. Valid values are powers of 2 between 1 and allocations. Valid values are powers of 2 between 1 and
128, inclusive. Defaults to 1. 128, inclusive. Defaults to 1.
* ``PILLOW_BLOCK_SIZE``, in bytes, K, or M. Specifies the maximum * ``PILLOW_BLOCK_SIZE``, in bytes, K, or M. Specifies the maximum
block size for ``ImagingAllocateArray``. Valid values are block size for ``ImagingAllocateArray``. Valid values are
integers, with an optional ``k`` or ``m`` suffix. Defaults to 16M. integers, with an optional ``k`` or ``m`` suffix. Defaults to 16M.
* ``PILLOW_BLOCKS_MAX`` Specifies the number of freed blocks to * ``PILLOW_BLOCKS_MAX`` Specifies the number of freed blocks to
retain to fill future memory requests. Any freed blocks over this retain to fill future memory requests. Any freed blocks over this
threshold will be returned to the OS immediately. Defaults to 0. threshold will be returned to the OS immediately. Defaults to 0.

View File

@ -1,5 +1,5 @@
C Extension debugging on Linux, with gbd/valgrind. C extension debugging on Linux, with GBD/Valgrind
================================================== =================================================
Install the tools Install the tools
----------------- -----------------
@ -17,7 +17,7 @@ Then ``sudo apt-get install libtiff5-dbgsym``
- There's a bug with the ``python3-dbg`` package for at least Python 3.8 on - There's a bug with the ``python3-dbg`` package for at least Python 3.8 on
Ubuntu 20.04, and you need to add a new link or two to make it autoload when Ubuntu 20.04, and you need to add a new link or two to make it autoload when
running python: running Python:
:: ::
@ -49,7 +49,7 @@ Then ``sudo apt-get install libtiff5-dbgsym``
source ~/vpy38-dbg/bin/activate source ~/vpy38-dbg/bin/activate
cd ~/Pillow && make install cd ~/Pillow && make install
Test Case Test case
--------- ---------
Take your test image, and make a really simple harness. Take your test image, and make a really simple harness.

View File

@ -1,7 +1,7 @@
.. py:module:: PIL.features .. py:module:: PIL.features
.. py:currentmodule:: PIL.features .. py:currentmodule:: PIL.features
:py:mod:`~PIL.features` Module :py:mod:`~PIL.features` module
============================== ==============================
The :py:mod:`PIL.features` module can be used to detect which Pillow features are available on your system. The :py:mod:`PIL.features` module can be used to detect which Pillow features are available on your system.

View File

@ -1,4 +1,4 @@
Internal Reference Internal reference
================== ==================
.. toctree:: .. toctree::

View File

@ -1,7 +1,7 @@
Internal Modules Internal modules
================ ================
:mod:`~PIL._binary` Module :mod:`~PIL._binary` module
-------------------------- --------------------------
.. automodule:: PIL._binary .. automodule:: PIL._binary
@ -9,7 +9,7 @@ Internal Modules
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL._deprecate` Module :mod:`~PIL._deprecate` module
----------------------------- -----------------------------
.. automodule:: PIL._deprecate .. automodule:: PIL._deprecate
@ -17,7 +17,7 @@ Internal Modules
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL._tkinter_finder` Module :mod:`~PIL._tkinter_finder` module
---------------------------------- ----------------------------------
.. automodule:: PIL._tkinter_finder .. automodule:: PIL._tkinter_finder
@ -25,7 +25,7 @@ Internal Modules
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL._typing` Module :mod:`~PIL._typing` module
-------------------------- --------------------------
.. module:: PIL._typing .. module:: PIL._typing
@ -58,7 +58,7 @@ on some Python versions.
See :py:obj:`typing.TypeGuard`. See :py:obj:`typing.TypeGuard`.
:mod:`~PIL._util` Module :mod:`~PIL._util` module
------------------------ ------------------------
.. automodule:: PIL._util .. automodule:: PIL._util
@ -66,7 +66,7 @@ on some Python versions.
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL._version` Module :mod:`~PIL._version` module
--------------------------- ---------------------------
.. module:: PIL._version .. module:: PIL._version
@ -78,7 +78,7 @@ on some Python versions.
This is the master version number for Pillow, This is the master version number for Pillow,
all other uses reference this module. all other uses reference this module.
:mod:`PIL.Image.core` Module :mod:`PIL.Image.core` module
---------------------------- ----------------------------
.. module:: PIL._imaging .. module:: PIL._imaging

View File

@ -4,7 +4,7 @@ Limits
This page is documentation to the various fundamental size limits in This page is documentation to the various fundamental size limits in
the Pillow implementation. the Pillow implementation.
Internal Limits Internal limits
=============== ===============
* Image sizes cannot be negative. These are checked both in * Image sizes cannot be negative. These are checked both in
@ -25,10 +25,10 @@ Internal Limits
is smaller than 2GB, as calculated by ``y*stride`` (so 2Gpx for 'L' is smaller than 2GB, as calculated by ``y*stride`` (so 2Gpx for 'L'
images, and .5Gpx for 'RGB' images, and .5Gpx for 'RGB'
Format Size Limits Format size limits
================== ==================
* ICO: Max size is 256x256 * ICO: Max size is 256x256
* Webp: 16383x16383 (underlying library size limit: * WebP: 16383x16383 (underlying library size limit:
https://developers.google.com/speed/webp/docs/api) https://developers.google.com/speed/webp/docs/api)

View File

@ -1,6 +1,6 @@
.. _file-handling: .. _file-handling:
File Handling in Pillow File handling in Pillow
======================= =======================
When opening a file as an image, Pillow requires a filename, ``os.PathLike`` When opening a file as an image, Pillow requires a filename, ``os.PathLike``
@ -36,7 +36,7 @@ have multiple frames.
Pillow cannot in general close and reopen a file, so any access to Pillow cannot in general close and reopen a file, so any access to
that file needs to be prior to the close. that file needs to be prior to the close.
Image Lifecycle Image lifecycle
--------------- ---------------
* ``Image.open()`` Filenames and ``Path`` objects are opened as a file. * ``Image.open()`` Filenames and ``Path`` objects are opened as a file.
@ -97,7 +97,7 @@ Complications
im6.load() # FAILS, closed file im6.load() # FAILS, closed file
Proposed File Handling Proposed file handling
---------------------- ----------------------
* ``Image.Image.load()`` should close the image file, unless there are * ``Image.Image.load()`` should close the image file, unless there are

View File

@ -1,7 +1,7 @@
Plugin reference Plugin reference
================ ================
:mod:`~PIL.AvifImagePlugin` Module :mod:`~PIL.AvifImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.AvifImagePlugin .. automodule:: PIL.AvifImagePlugin
@ -9,7 +9,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.BmpImagePlugin` Module :mod:`~PIL.BmpImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.BmpImagePlugin .. automodule:: PIL.BmpImagePlugin
@ -17,7 +17,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.BufrStubImagePlugin` Module :mod:`~PIL.BufrStubImagePlugin` module
-------------------------------------- --------------------------------------
.. automodule:: PIL.BufrStubImagePlugin .. automodule:: PIL.BufrStubImagePlugin
@ -25,7 +25,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.CurImagePlugin` Module :mod:`~PIL.CurImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.CurImagePlugin .. automodule:: PIL.CurImagePlugin
@ -33,7 +33,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.DcxImagePlugin` Module :mod:`~PIL.DcxImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.DcxImagePlugin .. automodule:: PIL.DcxImagePlugin
@ -41,7 +41,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.DdsImagePlugin` Module :mod:`~PIL.DdsImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.DdsImagePlugin .. automodule:: PIL.DdsImagePlugin
@ -49,7 +49,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.EpsImagePlugin` Module :mod:`~PIL.EpsImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.EpsImagePlugin .. automodule:: PIL.EpsImagePlugin
@ -57,15 +57,15 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.FitsImagePlugin` Module :mod:`~PIL.FitsImagePlugin` module
-------------------------------------- ----------------------------------
.. automodule:: PIL.FitsImagePlugin .. automodule:: PIL.FitsImagePlugin
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.FliImagePlugin` Module :mod:`~PIL.FliImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.FliImagePlugin .. automodule:: PIL.FliImagePlugin
@ -73,7 +73,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.FpxImagePlugin` Module :mod:`~PIL.FpxImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.FpxImagePlugin .. automodule:: PIL.FpxImagePlugin
@ -81,7 +81,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.GbrImagePlugin` Module :mod:`~PIL.GbrImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.GbrImagePlugin .. automodule:: PIL.GbrImagePlugin
@ -89,7 +89,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.GifImagePlugin` Module :mod:`~PIL.GifImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.GifImagePlugin .. automodule:: PIL.GifImagePlugin
@ -97,7 +97,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.GribStubImagePlugin` Module :mod:`~PIL.GribStubImagePlugin` module
-------------------------------------- --------------------------------------
.. automodule:: PIL.GribStubImagePlugin .. automodule:: PIL.GribStubImagePlugin
@ -105,7 +105,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.Hdf5StubImagePlugin` Module :mod:`~PIL.Hdf5StubImagePlugin` module
-------------------------------------- --------------------------------------
.. automodule:: PIL.Hdf5StubImagePlugin .. automodule:: PIL.Hdf5StubImagePlugin
@ -113,7 +113,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.IcnsImagePlugin` Module :mod:`~PIL.IcnsImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.IcnsImagePlugin .. automodule:: PIL.IcnsImagePlugin
@ -121,7 +121,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.IcoImagePlugin` Module :mod:`~PIL.IcoImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.IcoImagePlugin .. automodule:: PIL.IcoImagePlugin
@ -129,7 +129,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.ImImagePlugin` Module :mod:`~PIL.ImImagePlugin` module
-------------------------------- --------------------------------
.. automodule:: PIL.ImImagePlugin .. automodule:: PIL.ImImagePlugin
@ -137,7 +137,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.ImtImagePlugin` Module :mod:`~PIL.ImtImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.ImtImagePlugin .. automodule:: PIL.ImtImagePlugin
@ -145,7 +145,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.IptcImagePlugin` Module :mod:`~PIL.IptcImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.IptcImagePlugin .. automodule:: PIL.IptcImagePlugin
@ -153,7 +153,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.JpegImagePlugin` Module :mod:`~PIL.JpegImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.JpegImagePlugin .. automodule:: PIL.JpegImagePlugin
@ -161,7 +161,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.Jpeg2KImagePlugin` Module :mod:`~PIL.Jpeg2KImagePlugin` module
------------------------------------ ------------------------------------
.. automodule:: PIL.Jpeg2KImagePlugin .. automodule:: PIL.Jpeg2KImagePlugin
@ -169,7 +169,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.McIdasImagePlugin` Module :mod:`~PIL.McIdasImagePlugin` module
------------------------------------ ------------------------------------
.. automodule:: PIL.McIdasImagePlugin .. automodule:: PIL.McIdasImagePlugin
@ -177,7 +177,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.MicImagePlugin` Module :mod:`~PIL.MicImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.MicImagePlugin .. automodule:: PIL.MicImagePlugin
@ -185,7 +185,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.MpegImagePlugin` Module :mod:`~PIL.MpegImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.MpegImagePlugin .. automodule:: PIL.MpegImagePlugin
@ -193,15 +193,15 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.MpoImagePlugin` Module :mod:`~PIL.MpoImagePlugin` module
---------------------------------- ---------------------------------
.. automodule:: PIL.MpoImagePlugin .. automodule:: PIL.MpoImagePlugin
:members: :members:
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.MspImagePlugin` Module :mod:`~PIL.MspImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.MspImagePlugin .. automodule:: PIL.MspImagePlugin
@ -209,7 +209,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PalmImagePlugin` Module :mod:`~PIL.PalmImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.PalmImagePlugin .. automodule:: PIL.PalmImagePlugin
@ -217,7 +217,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PcdImagePlugin` Module :mod:`~PIL.PcdImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.PcdImagePlugin .. automodule:: PIL.PcdImagePlugin
@ -225,7 +225,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PcxImagePlugin` Module :mod:`~PIL.PcxImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.PcxImagePlugin .. automodule:: PIL.PcxImagePlugin
@ -233,7 +233,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PdfImagePlugin` Module :mod:`~PIL.PdfImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.PdfImagePlugin .. automodule:: PIL.PdfImagePlugin
@ -241,7 +241,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PixarImagePlugin` Module :mod:`~PIL.PixarImagePlugin` module
----------------------------------- -----------------------------------
.. automodule:: PIL.PixarImagePlugin .. automodule:: PIL.PixarImagePlugin
@ -249,7 +249,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PngImagePlugin` Module :mod:`~PIL.PngImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.PngImagePlugin .. automodule:: PIL.PngImagePlugin
@ -260,7 +260,7 @@ Plugin reference
:member-order: groupwise :member-order: groupwise
:mod:`~PIL.PpmImagePlugin` Module :mod:`~PIL.PpmImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.PpmImagePlugin .. automodule:: PIL.PpmImagePlugin
@ -268,7 +268,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.PsdImagePlugin` Module :mod:`~PIL.PsdImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.PsdImagePlugin .. automodule:: PIL.PsdImagePlugin
@ -276,7 +276,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.SgiImagePlugin` Module :mod:`~PIL.SgiImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.SgiImagePlugin .. automodule:: PIL.SgiImagePlugin
@ -284,7 +284,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.SpiderImagePlugin` Module :mod:`~PIL.SpiderImagePlugin` module
------------------------------------ ------------------------------------
.. automodule:: PIL.SpiderImagePlugin .. automodule:: PIL.SpiderImagePlugin
@ -292,7 +292,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.SunImagePlugin` Module :mod:`~PIL.SunImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.SunImagePlugin .. automodule:: PIL.SunImagePlugin
@ -300,7 +300,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.TgaImagePlugin` Module :mod:`~PIL.TgaImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.TgaImagePlugin .. automodule:: PIL.TgaImagePlugin
@ -308,7 +308,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.TiffImagePlugin` Module :mod:`~PIL.TiffImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.TiffImagePlugin .. automodule:: PIL.TiffImagePlugin
@ -316,7 +316,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.WebPImagePlugin` Module :mod:`~PIL.WebPImagePlugin` module
---------------------------------- ----------------------------------
.. automodule:: PIL.WebPImagePlugin .. automodule:: PIL.WebPImagePlugin
@ -324,7 +324,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.WmfImagePlugin` Module :mod:`~PIL.WmfImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.WmfImagePlugin .. automodule:: PIL.WmfImagePlugin
@ -332,7 +332,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.XVThumbImagePlugin` Module :mod:`~PIL.XVThumbImagePlugin` module
------------------------------------- -------------------------------------
.. automodule:: PIL.XVThumbImagePlugin .. automodule:: PIL.XVThumbImagePlugin
@ -340,7 +340,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.XbmImagePlugin` Module :mod:`~PIL.XbmImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.XbmImagePlugin .. automodule:: PIL.XbmImagePlugin
@ -348,7 +348,7 @@ Plugin reference
:undoc-members: :undoc-members:
:show-inheritance: :show-inheritance:
:mod:`~PIL.XpmImagePlugin` Module :mod:`~PIL.XpmImagePlugin` module
--------------------------------- ---------------------------------
.. automodule:: PIL.XpmImagePlugin .. automodule:: PIL.XpmImagePlugin

View File

@ -28,7 +28,7 @@ This threshold can be changed by setting
:py:data:`PIL.ImageFont.MAX_STRING_LENGTH`. It can be disabled by setting :py:data:`PIL.ImageFont.MAX_STRING_LENGTH`. It can be disabled by setting
``ImageFont.MAX_STRING_LENGTH = None``. ``ImageFont.MAX_STRING_LENGTH = None``.
Backwards Incompatible Changes Backwards incompatible changes
============================== ==============================
Categories Categories
@ -164,7 +164,7 @@ Since Pillow's C API is now faster than PyAccess on PyPy,
``Image.USE_CFFI_ACCESS``, for switching from the C API to PyAccess, is ``Image.USE_CFFI_ACCESS``, for switching from the C API to PyAccess, is
similarly deprecated. similarly deprecated.
API Changes API changes
=========== ===========
Added line width parameter to ImageDraw regular_polygon Added line width parameter to ImageDraw regular_polygon
@ -173,7 +173,7 @@ Added line width parameter to ImageDraw regular_polygon
An optional line ``width`` parameter has been added to An optional line ``width`` parameter has been added to
``ImageDraw.Draw.regular_polygon``. ``ImageDraw.Draw.regular_polygon``.
API Additions API additions
============= =============
Added ``alpha_only`` argument to ``getbbox()`` Added ``alpha_only`` argument to ``getbbox()``
@ -184,7 +184,7 @@ Added ``alpha_only`` argument to ``getbbox()``
and the image has an alpha channel, trim transparent pixels. Otherwise, trim and the image has an alpha channel, trim transparent pixels. Otherwise, trim
pixels when all channels are zero. pixels when all channels are zero.
Other Changes Other changes
============= =============
32-bit wheels 32-bit wheels

View File

@ -11,7 +11,7 @@ This release provides an updated install script and updated wheels to
include libwebp 1.3.2, preventing a potential heap buffer overflow in include libwebp 1.3.2, preventing a potential heap buffer overflow in
WebP. WebP.
Other Changes Other changes
============= =============
Updated tests to pass with latest zlib version Updated tests to pass with latest zlib version

View File

@ -1,7 +1,7 @@
10.1.0 10.1.0
------ ------
API Changes API changes
=========== ===========
Setting image mode Setting image mode
@ -35,7 +35,7 @@ to be specified, rather than a single number for both dimensions. ::
ImageFilter.BoxBlur((2, 5)) ImageFilter.BoxBlur((2, 5))
ImageFilter.GaussianBlur((2, 5)) ImageFilter.GaussianBlur((2, 5))
API Additions API additions
============= =============
EpsImagePlugin.gs_binary EpsImagePlugin.gs_binary
@ -71,7 +71,7 @@ size and font_size arguments when using default font
Pillow has had a "better than nothing" default font, which can only be drawn at Pillow has had a "better than nothing" default font, which can only be drawn at
one font size. Now, if FreeType support is available, a version of one font size. Now, if FreeType support is available, a version of
`Aileron Regular <https://dotcolon.net/font/aileron>`_ is loaded, which can be `Aileron Regular <https://dotcolon.net/fonts/aileron>`_ is loaded, which can be
drawn at chosen font sizes. drawn at chosen font sizes.
The following ``size`` and ``font_size`` arguments can now be used to specify a The following ``size`` and ``font_size`` arguments can now be used to specify a
@ -84,7 +84,7 @@ font size for this new builtin font::
draw.multiline_text((0, 0), "test", font_size=24) draw.multiline_text((0, 0), "test", font_size=24)
draw.multiline_textbbox((0, 0), "test", font_size=24) draw.multiline_textbbox((0, 0), "test", font_size=24)
Other Changes Other changes
============= =============
Python 3.12 Python 3.12

View File

@ -53,7 +53,7 @@ The functions ``IptcImageFile.dump`` and ``IptcImageFile.i``, and the constant
for internal use, so there is no replacement. They can each be replaced for internal use, so there is no replacement. They can each be replaced
by a single line of code using builtin functions in Python. by a single line of code using builtin functions in Python.
API Changes API changes
=========== ===========
Zero or negative font size error Zero or negative font size error
@ -63,7 +63,7 @@ When creating a :py:class:`~PIL.ImageFont.FreeTypeFont` instance, either directl
through :py:func:`~PIL.ImageFont.truetype`, if the font size is zero or less, a through :py:func:`~PIL.ImageFont.truetype`, if the font size is zero or less, a
:py:exc:`ValueError` will now be raised. :py:exc:`ValueError` will now be raised.
API Additions API additions
============= =============
Added DdsImagePlugin enums Added DdsImagePlugin enums
@ -95,7 +95,7 @@ JPEG tables-only streamtype
When saving JPEG files, ``streamtype`` can now be set to 1, for tables-only. This will When saving JPEG files, ``streamtype`` can now be set to 1, for tables-only. This will
output only the quantization and Huffman tables for the image. output only the quantization and Huffman tables for the image.
Other Changes Other changes
============= =============
Added DDS BC4U and DX10 BC1 and BC4 reading Added DDS BC4U and DX10 BC1 and BC4 reading

View File

@ -65,7 +65,7 @@ ImageMath.eval()
:py:meth:`~PIL.ImageMath.unsafe_eval` instead. See earlier security notes for more :py:meth:`~PIL.ImageMath.unsafe_eval` instead. See earlier security notes for more
information. information.
API Changes API changes
=========== ===========
Added alpha_quality argument when saving WebP images Added alpha_quality argument when saving WebP images
@ -87,7 +87,7 @@ Negative P1-P3 PPM value error
If a P1-P3 PPM image contains a negative value, a :py:exc:`ValueError` will now be If a P1-P3 PPM image contains a negative value, a :py:exc:`ValueError` will now be
raised. raised.
API Additions API additions
============= =============
Added PerspectiveTransform Added PerspectiveTransform
@ -97,7 +97,7 @@ Added PerspectiveTransform
that all of the :py:data:`~PIL.Image.Transform` values now have a corresponding that all of the :py:data:`~PIL.Image.Transform` values now have a corresponding
subclass of :py:class:`~PIL.ImageTransform.Transform`. subclass of :py:class:`~PIL.ImageTransform.Transform`.
Other Changes Other changes
============= =============
Portable FloatMap (PFM) images Portable FloatMap (PFM) images

View File

@ -41,7 +41,7 @@ ImageDraw.getdraw hints parameter
The ``hints`` parameter in :py:meth:`~PIL.ImageDraw.getdraw()` has been deprecated. The ``hints`` parameter in :py:meth:`~PIL.ImageDraw.getdraw()` has been deprecated.
API Additions API additions
============= =============
ImageDraw.circle ImageDraw.circle
@ -51,7 +51,7 @@ Added :py:meth:`~PIL.ImageDraw.ImageDraw.circle`. It provides the same functiona
:py:meth:`~PIL.ImageDraw.ImageDraw.ellipse`, but instead of taking a bounding box, it :py:meth:`~PIL.ImageDraw.ImageDraw.ellipse`, but instead of taking a bounding box, it
takes a center point and radius. takes a center point and radius.
Other Changes Other changes
============= =============
Python 3.13 beta Python 3.13 beta

View File

@ -1,7 +1,7 @@
11.0.0 11.0.0
------ ------
Backwards Incompatible Changes Backwards incompatible changes
============================== ==============================
Python 3.8 Python 3.8
@ -103,7 +103,7 @@ JpegImageFile.huffman_ac and JpegImageFile.huffman_dc
The ``huffman_ac`` and ``huffman_dc`` dictionaries on JPEG images were unused. They The ``huffman_ac`` and ``huffman_dc`` dictionaries on JPEG images were unused. They
have been deprecated, and will be removed in Pillow 12 (2025-10-15). have been deprecated, and will be removed in Pillow 12 (2025-10-15).
Specific WebP Feature Checks Specific WebP feature checks
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. deprecated:: 11.0.0 .. deprecated:: 11.0.0
@ -113,7 +113,7 @@ Specific WebP Feature Checks
``True`` if the WebP module is installed, until they are removed in Pillow ``True`` if the WebP module is installed, until they are removed in Pillow
12.0.0 (2025-10-15). 12.0.0 (2025-10-15).
API Changes API changes
=========== ===========
Default resampling filter for I;16* image modes Default resampling filter for I;16* image modes
@ -122,7 +122,7 @@ Default resampling filter for I;16* image modes
The default resampling filter for I;16, I;16L, I;16B and I;16N has been changed from The default resampling filter for I;16, I;16L, I;16B and I;16N has been changed from
``Image.NEAREST`` to ``Image.BICUBIC``, to match the majority of modes. ``Image.NEAREST`` to ``Image.BICUBIC``, to match the majority of modes.
API Additions API additions
============= =============
Writing XMP bytes to JPEG and MPO Writing XMP bytes to JPEG and MPO
@ -138,7 +138,7 @@ either JPEG or MPO images::
im.info["xmp"] = b"test" im.info["xmp"] = b"test"
im.save("out.jpg") im.save("out.jpg")
Other Changes Other changes
============= =============
Python 3.13 Python 3.13
@ -154,7 +154,7 @@ Support has also been added for the experimental free-threaded mode of :pep:`703
Python 3.13 only supports macOS versions 10.13 and later. Python 3.13 only supports macOS versions 10.13 and later.
C-level Flags C-level flags
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
Some compiling flags like ``WITH_THREADING``, ``WITH_IMAGECHOPS``, and other Some compiling flags like ``WITH_THREADING``, ``WITH_IMAGECHOPS``, and other

View File

@ -10,7 +10,7 @@ ExifTags.IFD.Makernote
``ExifTags.IFD.Makernote`` has been deprecated. Instead, use ``ExifTags.IFD.Makernote`` has been deprecated. Instead, use
``ExifTags.IFD.MakerNote``. ``ExifTags.IFD.MakerNote``.
API Changes API changes
=========== ===========
Writing XMP bytes to JPEG and MPO Writing XMP bytes to JPEG and MPO
@ -34,7 +34,7 @@ be used::
second_im.encoderinfo = {"xmp": b"test"} second_im.encoderinfo = {"xmp": b"test"}
im.save("out.mpo", save_all=True, append_images=[second_im]) im.save("out.mpo", save_all=True, append_images=[second_im])
API Additions API additions
============= =============
Check for zlib-ng Check for zlib-ng
@ -54,7 +54,7 @@ TIFF images can now be saved as BigTIFF using a ``big_tiff`` argument::
im.save("out.tiff", big_tiff=True) im.save("out.tiff", big_tiff=True)
Other Changes Other changes
============= =============
Reading JPEG 2000 comments Reading JPEG 2000 comments

View File

@ -32,7 +32,7 @@ Image.Image.get_child_images()
method uses an image's file pointer, and so child images could only be retrieved from method uses an image's file pointer, and so child images could only be retrieved from
an :py:class:`PIL.ImageFile.ImageFile` instance. an :py:class:`PIL.ImageFile.ImageFile` instance.
API Changes API changes
=========== ===========
``append_images`` no longer requires ``save_all`` ``append_images`` no longer requires ``save_all``
@ -44,7 +44,7 @@ supports saving multiple frames::
im.save("out.gif", append_images=ims) im.save("out.gif", append_images=ims)
API Additions API additions
============= =============
``"justify"`` multiline text alignment ``"justify"`` multiline text alignment
@ -86,7 +86,7 @@ DXT5, BC2, BC3 and BC5 are supported::
im.save("out.dds", pixel_format="DXT1") im.save("out.dds", pixel_format="DXT1")
Other Changes Other changes
============= =============
Arrow support Arrow support

View File

@ -1,13 +1,13 @@
2.7.0 2.7.0
----- -----
Sane Plugin Sane plugin
^^^^^^^^^^^ ^^^^^^^^^^^
The Sane plugin has now been split into its own repo: The Sane plugin has now been split into its own repo:
https://github.com/python-pillow/Sane . https://github.com/python-pillow/Sane .
Png text chunk size limits PNG text chunk size limits
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
To prevent potential denial of service attacks using compressed text To prevent potential denial of service attacks using compressed text
@ -155,7 +155,7 @@ so the quality was worse compared to other Gaussian blur software.
The new implementation does not have this drawback. The new implementation does not have this drawback.
TIFF Parameter Changes TIFF parameter changes
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
Several kwarg parameters for saving TIFF images were previously Several kwarg parameters for saving TIFF images were previously

View File

@ -1,7 +1,7 @@
3.0.0 3.0.0
----- -----
Backwards Incompatible Changes Backwards incompatible changes
============================== ==============================
Several methods that have been marked as deprecated for many releases Several methods that have been marked as deprecated for many releases
@ -18,10 +18,10 @@ have been removed in this release:
* ``ImageWin.fromstring()`` * ``ImageWin.fromstring()``
* ``ImageWin.tostring()`` * ``ImageWin.tostring()``
Other Changes Other changes
============= =============
Saving Multipage Images Saving multipage images
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
There is now support for saving multipage images in the ``GIF`` and There is now support for saving multipage images in the ``GIF`` and
@ -30,10 +30,10 @@ as a keyword argument to the save::
im.save('test.pdf', save_all=True) im.save('test.pdf', save_all=True)
Tiff ImageFileDirectory Rewrite TIFF ImageFileDirectory rewrite
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Tiff ImageFileDirectory metadata code has been rewritten. Where The TIFF ImageFileDirectory metadata code has been rewritten. Where
previously it returned a somewhat arbitrary set of values and tuples, previously it returned a somewhat arbitrary set of values and tuples,
it now returns bare values where appropriate and tuples when the it now returns bare values where appropriate and tuples when the
metadata item is a sequence or collection. metadata item is a sequence or collection.
@ -41,7 +41,7 @@ metadata item is a sequence or collection.
The original metadata is still available in the TiffImage.tags, the The original metadata is still available in the TiffImage.tags, the
new values are available in the TiffImage.tags_v2 member. The old new values are available in the TiffImage.tags_v2 member. The old
structures will be deprecated at some point in the future. When structures will be deprecated at some point in the future. When
saving Tiff metadata, new code should use the saving TIFF metadata, new code should use the
TiffImagePlugin.ImageFileDirectory_v2 class. TiffImagePlugin.ImageFileDirectory_v2 class.
LibJpeg and Zlib are required by default LibJpeg and Zlib are required by default

View File

@ -22,7 +22,7 @@ not the absolute height of each line.
There is also now a default spacing of 4px between lines. There is also now a default spacing of 4px between lines.
Exif, Jpeg and Tiff Metadata EXIF, JPEG and TIFF metadata
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There were major changes in the TIFF ImageFileDirectory support in There were major changes in the TIFF ImageFileDirectory support in
@ -63,7 +63,7 @@ single item tuples have been unwrapped and return a bare element.
The format returned by Pillow 3.0 has been abandoned. A more fully The format returned by Pillow 3.0 has been abandoned. A more fully
featured interface for EXIF is anticipated in a future release. featured interface for EXIF is anticipated in a future release.
Out of Spec Metadata Out of spec metadata
++++++++++++++++++++ ++++++++++++++++++++
In Pillow 3.0 and 3.1, images that contain metadata that is internally In Pillow 3.0 and 3.1, images that contain metadata that is internally

View File

@ -1,7 +1,7 @@
3.2.0 3.2.0
----- -----
New DDS and FTEX Image Plugins New DDS and FTEX image plugins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The ``DdsImagePlugin`` reading DXT1 and DXT5 encoded ``.dds`` images was The ``DdsImagePlugin`` reading DXT1 and DXT5 encoded ``.dds`` images was
@ -18,7 +18,7 @@ Updates to the GbrImagePlugin
The ``GbrImagePlugin`` (GIMP brush format) has been updated to fix The ``GbrImagePlugin`` (GIMP brush format) has been updated to fix
support for version 1 files and add support for version 2 files. support for version 1 files and add support for version 2 files.
Passthrough Parameters for ImageDraw.text Passthrough parameters for ImageDraw.text
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
``ImageDraw.multiline_text`` and ``ImageDraw.multiline_size`` take extra ``ImageDraw.multiline_text`` and ``ImageDraw.multiline_size`` take extra

View File

@ -11,7 +11,7 @@ libimagequant. We cannot distribute binaries due to licensing
differences. differences.
New Setup.py options New setup.py options
^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
There are two new options to control the ``build_ext`` task in ``setup.py``: There are two new options to control the ``build_ext`` task in ``setup.py``:
@ -43,7 +43,7 @@ This greatly improves both quality and performance in this case.
Also, the bug with wrong image size calculation when rotating by 90 degrees Also, the bug with wrong image size calculation when rotating by 90 degrees
was fixed. was fixed.
Image Metadata Image metadata
^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^
The return type for binary data in version 2 Exif and Tiff metadata The return type for binary data in version 2 Exif and Tiff metadata

View File

@ -4,7 +4,7 @@
Security Security
======== ========
Integer overflow in Map.c Integer overflow in map.c
^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
Pillow prior to 3.3.2 may experience integer overflow errors in map.c Pillow prior to 3.3.2 may experience integer overflow errors in map.c
@ -27,7 +27,7 @@ memory without duplicating the image first.
This issue was found by Cris Neckar at Divergent Security. This issue was found by Cris Neckar at Divergent Security.
Sign Extension in Storage.c Sign extension in Storage.c
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pillow prior to 3.3.2 and PIL 1.1.7 (at least) do not check for Pillow prior to 3.3.2 and PIL 1.1.7 (at least) do not check for

View File

@ -1,7 +1,7 @@
3.4.0 3.4.0
----- -----
Backwards Incompatible Changes Backwards incompatible changes
============================== ==============================
Image.core.open_ppm removed Image.core.open_ppm removed
@ -14,7 +14,7 @@ been removed. If you were using this function, please use
Deprecations Deprecations
============ ============
Deprecation Warning when Saving JPEGs Deprecation warning when saving JPEGs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
JPEG images cannot contain an alpha channel. Pillow prior to 3.4.0 JPEG images cannot contain an alpha channel. Pillow prior to 3.4.0
@ -22,7 +22,7 @@ silently drops the alpha channel. With this release Pillow will now
issue a :py:exc:`DeprecationWarning` when attempting to save a ``RGBA`` mode issue a :py:exc:`DeprecationWarning` when attempting to save a ``RGBA`` mode
image as a JPEG. This will become an error in Pillow 4.2. image as a JPEG. This will become an error in Pillow 4.2.
API Additions API additions
============= =============
New resizing filters New resizing filters
@ -37,7 +37,7 @@ two times shorter window than ``BILINEAR``. It can be used for image reduction
providing the image downscaling quality comparable to ``BICUBIC``. providing the image downscaling quality comparable to ``BICUBIC``.
Both new filters don't show good quality for the image upscaling. Both new filters don't show good quality for the image upscaling.
New DDS Decoders New DDS decoders
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
Pillow can now decode DXT3 images, as well as the previously supported Pillow can now decode DXT3 images, as well as the previously supported

View File

@ -1,7 +1,7 @@
4.0.0 4.0.0
----- -----
Python 2.6 and 3.2 Dropped Python 2.6 and 3.2 dropped
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Pillow 4.0 no longer supports Python 2.6 and 3.2. We will not be Pillow 4.0 no longer supports Python 2.6 and 3.2. We will not be

View File

@ -15,10 +15,10 @@ Several deprecated items have been removed.
``PIL.ImageDraw.ImageDraw.setfont`` have been removed. ``PIL.ImageDraw.ImageDraw.setfont`` have been removed.
Other Changes Other changes
============= =============
Closing Files When Opening Images Closing files when opening images
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The file handling when opening images has been overhauled. Previously, The file handling when opening images has been overhauled. Previously,
@ -41,7 +41,7 @@ is specified:
the underlying file until we are done with the image. The mapping the underlying file until we are done with the image. The mapping
will be closed in the ``close`` or ``__del__`` method. will be closed in the ``close`` or ``__del__`` method.
Changes to GIF Handling When Saving Changes to GIF handling when saving
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The :py:class:`PIL.GifImagePlugin` code has been refactored to fix the flow when The :py:class:`PIL.GifImagePlugin` code has been refactored to fix the flow when
@ -57,14 +57,14 @@ saving images. There are two external changes that arise from this:
This refactor fixed some bugs with palette handling when saving This refactor fixed some bugs with palette handling when saving
multiple frame GIFs. multiple frame GIFs.
New Method: Image.remap_palette New method: Image.remap_palette
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The method :py:meth:`PIL.Image.Image.remap_palette()` has been The method :py:meth:`PIL.Image.Image.remap_palette()` has been
added. This method was hoisted from the GifImagePlugin code used to added. This method was hoisted from the GifImagePlugin code used to
optimize the palette. optimize the palette.
Added Decoder Registry and Support for Python Based Decoders Added decoder registry and support for Python-based decoders
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There is now a decoder registry similar to the image plugin There is now a decoder registry similar to the image plugin

View File

@ -1,7 +1,7 @@
4.1.1 4.1.1
----- -----
Fix Regression with reading DPI from EXIF data Fix regression with reading DPI from EXIF data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Some JPEG images don't contain DPI information in the image metadata, Some JPEG images don't contain DPI information in the image metadata,

View File

@ -1,7 +1,7 @@
4.2.0 4.2.0
----- -----
Backwards Incompatible Changes Backwards incompatible changes
============================== ==============================
Several deprecated items have been removed Several deprecated items have been removed
@ -17,17 +17,17 @@ Several deprecated items have been removed
was shown. From Pillow 4.2.0, the deprecation warning is removed and was shown. From Pillow 4.2.0, the deprecation warning is removed and
an :py:exc:`IOError` is raised. an :py:exc:`IOError` is raised.
Removed Core Image Function Removed core Image function
^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
The unused function ``Image.core.new_array`` was removed. This is an The unused function ``Image.core.new_array`` was removed. This is an
internal function that should not have been used by user code, but it internal function that should not have been used by user code, but it
was accessible from the python layer. was accessible from the python layer.
Other Changes Other changes
============= =============
Added Complex Text Rendering Added complex text rendering
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pillow now supports complex text rendering for scripts requiring glyph Pillow now supports complex text rendering for scripts requiring glyph
@ -36,7 +36,7 @@ dependencies: harfbuzz, fribidi, and raqm. See the :doc:`install documentation
<../installation>` for further details. This feature is tested and works on <../installation>` for further details. This feature is tested and works on
Unix and Mac, but has not yet been built on Windows platforms. Unix and Mac, but has not yet been built on Windows platforms.
New Optional Parameters New optional parameters
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
* :py:meth:`PIL.ImageDraw.floodfill` has a new optional parameter: * :py:meth:`PIL.ImageDraw.floodfill` has a new optional parameter:
@ -47,7 +47,7 @@ New Optional Parameters
optional parameter for specifying additional images to create optional parameter for specifying additional images to create
multipage outputs. multipage outputs.
New DecompressionBomb Warning New DecompressionBomb warning
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
:py:meth:`PIL.Image.Image.crop` now may raise a DecompressionBomb :py:meth:`PIL.Image.Image.crop` now may raise a DecompressionBomb

View File

@ -3,7 +3,7 @@
There are no functional changes in this release. There are no functional changes in this release.
Fixed Windows PyPy Build Fixed Windows PyPy build
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
A change in the 4.2.0 cycle broke the Windows PyPy build. This has A change in the 4.2.0 cycle broke the Windows PyPy build. This has

View File

@ -1,7 +1,7 @@
4.3.0 4.3.0
----- -----
API Changes API changes
=========== ===========
Deprecations Deprecations
@ -12,7 +12,7 @@ Several undocumented functions in ImageOps have been deprecated:
``box_blur``. Use the equivalent operations in ``ImageFilter`` ``box_blur``. Use the equivalent operations in ``ImageFilter``
instead. These functions will be removed in a future release. instead. These functions will be removed in a future release.
TIFF Metadata Changes TIFF metadata changes
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
* TIFF tags with unknown type/quantity now default to being bare * TIFF tags with unknown type/quantity now default to being bare
@ -27,7 +27,7 @@ TIFF Metadata Changes
items, as there can be multiple items, one for UTF-8, and one for items, as there can be multiple items, one for UTF-8, and one for
UTF-16. UTF-16.
Core Image API Changes Core Image API changes
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
These are internal functions that should not have been used by user These are internal functions that should not have been used by user
@ -44,10 +44,10 @@ The ``PIL.Image.core.getcount`` methods have been removed, use
``PIL.Image.core.get_stats()['new_count']`` property instead. ``PIL.Image.core.get_stats()['new_count']`` property instead.
API Additions API additions
============= =============
Get One Channel From Image Get one channel from image
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
A new method :py:meth:`PIL.Image.Image.getchannel` has been added to A new method :py:meth:`PIL.Image.Image.getchannel` has been added to
@ -56,14 +56,14 @@ return a single channel by index or name. For example,
``getchannel`` should work up to 6 times faster than ``getchannel`` should work up to 6 times faster than
``image.split()[0]`` in previous Pillow versions. ``image.split()[0]`` in previous Pillow versions.
Box Blur Box blur
^^^^^^^^ ^^^^^^^^
A new filter, :py:class:`PIL.ImageFilter.BoxBlur`, has been A new filter, :py:class:`PIL.ImageFilter.BoxBlur`, has been
added. This is a filter with similar results to a Gaussian blur, but added. This is a filter with similar results to a Gaussian blur, but
is much faster. is much faster.
Partial Resampling Partial resampling
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
Added new argument ``box`` for :py:meth:`PIL.Image.Image.resize`. This Added new argument ``box`` for :py:meth:`PIL.Image.Image.resize`. This
@ -71,14 +71,14 @@ argument defines a source rectangle from within the source image to be
resized. This is very similar to the ``image.crop(box).resize(size)`` resized. This is very similar to the ``image.crop(box).resize(size)``
sequence except that ``box`` can be specified with subpixel accuracy. sequence except that ``box`` can be specified with subpixel accuracy.
New Transpose Operation New transpose operation
^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
The ``Image.TRANSVERSE`` operation has been added to The ``Image.TRANSVERSE`` operation has been added to
:py:meth:`PIL.Image.Image.transpose`. This is equivalent to a transpose :py:meth:`PIL.Image.Image.transpose`. This is equivalent to a transpose
operation about the opposite diagonal. operation about the opposite diagonal.
Multiband Filters Multiband filters
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
There is a new :py:class:`PIL.ImageFilter.MultibandFilter` base class There is a new :py:class:`PIL.ImageFilter.MultibandFilter` base class
@ -87,10 +87,10 @@ operation. The original :py:class:`PIL.ImageFilter.Filter` class
remains for image filters that can process only single band images, or remains for image filters that can process only single band images, or
require splitting of channels prior to filtering. require splitting of channels prior to filtering.
Other Changes Other changes
============= =============
Loading 16-bit TIFF Images Loading 16-bit TIFF images
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Pillow now can read 16-bit multichannel TIFF files including files Pillow now can read 16-bit multichannel TIFF files including files
@ -101,7 +101,7 @@ Pillow now can read 16-bit signed integer single channel TIFF
files. The image data is promoted to 32-bit for storage and files. The image data is promoted to 32-bit for storage and
processing. processing.
SGI Images SGI images
^^^^^^^^^^ ^^^^^^^^^^
Pillow can now read and write uncompressed 16-bit multichannel SGI Pillow can now read and write uncompressed 16-bit multichannel SGI
@ -129,7 +129,7 @@ This release contains several performance improvements:
falling back to an allocation for each scan line for images larger falling back to an allocation for each scan line for images larger
than the block size. than the block size.
CMYK Conversion CMYK conversion
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
The basic CMYK->RGB conversion has been tweaked to match the formula The basic CMYK->RGB conversion has been tweaked to match the formula

View File

@ -1,10 +1,10 @@
5.0.0 5.0.0
----- -----
Backwards Incompatible Changes Backwards incompatible changes
============================== ==============================
Python 3.3 Dropped Python 3.3 dropped
^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
Python 3.3 is EOL and no longer supported due to moving testing from nose, Python 3.3 is EOL and no longer supported due to moving testing from nose,
@ -12,7 +12,7 @@ which is deprecated, to pytest, which doesn't support Python 3.3. We will not
be creating binaries, testing, or retaining compatibility with this version. be creating binaries, testing, or retaining compatibility with this version.
The final version of Pillow for Python 3.3 is 4.3.0. The final version of Pillow for Python 3.3 is 4.3.0.
Decompression Bombs now raise Exceptions Decompression bombs now raise exceptions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Pillow has previously emitted warnings for images that are Pillow has previously emitted warnings for images that are
@ -31,7 +31,7 @@ separate package, pillow-scripts, living at
https://github.com/python-pillow/pillow-scripts. https://github.com/python-pillow/pillow-scripts.
API Changes API changes
=========== ===========
OleFileIO.py OleFileIO.py
@ -54,7 +54,7 @@ Several image plugins supported a named ``check`` parameter on their
nominally private ``_save`` method to preflight if the image could be nominally private ``_save`` method to preflight if the image could be
saved in that format. That parameter has been removed. saved in that format. That parameter has been removed.
API Additions API additions
============= =============
Image.transform Image.transform
@ -65,16 +65,16 @@ A new named parameter, ``fillcolor``, has been added to
the area outside the transformed area in the output image. This the area outside the transformed area in the output image. This
parameter takes the same color specifications as used in ``Image.new``. parameter takes the same color specifications as used in ``Image.new``.
GIF Disposal GIF disposal
^^^^^^^^^^^^ ^^^^^^^^^^^^
Multiframe GIF images now take an optional disposal parameter to Multiframe GIF images now take an optional disposal parameter to
specify the disposal option for changed pixels. specify the disposal option for changed pixels.
Other Changes Other changes
============= =============
Compressed TIFF Images Compressed TIFF images
^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
Previously, there were some compression modes (JPEG, Packbits, and Previously, there were some compression modes (JPEG, Packbits, and
@ -82,7 +82,7 @@ LZW) that were supported with Pillow's internal TIFF decoder. All
compressed TIFFs are now read using the ``libtiff`` decoder, as it compressed TIFFs are now read using the ``libtiff`` decoder, as it
implements the compression schemes more correctly. implements the compression schemes more correctly.
Libraqm is now Dynamically Linked Libraqm is now dynamically linked
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The libraqm dependency for complex text scripts is now linked The libraqm dependency for complex text scripts is now linked
@ -90,14 +90,14 @@ dynamically at runtime rather than at packaging time. This allows us
to release binaries with support for libraqm if it is installed on the to release binaries with support for libraqm if it is installed on the
user's machine. user's machine.
Source Layout Changes Source layout changes
^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^
The Pillow source is now stored within the ``src`` directory of the The Pillow source is now stored within the ``src`` directory of the
distribution. This prevents accidental imports of the PIL directory distribution. This prevents accidental imports of the PIL directory
when running Python from the project directory. when running Python from the project directory.
Setup.py Changes Setup.py changes
^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
Multiarch support on Linux should be more robust, especially on Debian Multiarch support on Linux should be more robust, especially on Debian

View File

@ -1,7 +1,7 @@
5.1.0 5.1.0
----- -----
API Changes API changes
=========== ===========
Optional channels for TIFF files Optional channels for TIFF files
@ -12,22 +12,22 @@ and ``CMYK`` with up to 6 8-bit channels, discarding any extra
channels if the content is tagged as UNSPECIFIED. Pillow still does channels if the content is tagged as UNSPECIFIED. Pillow still does
not store more than 4 8-bit channels of image data. not store more than 4 8-bit channels of image data.
API Additions API additions
============= =============
Append to PDF Files Append to PDF files
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
Images can now be appended to PDF files in place by passing in Images can now be appended to PDF files in place by passing in
``append=True`` when saving the image. ``append=True`` when saving the image.
New BLP File Format New BLP file format
^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^
Pillow now supports reading the BLP "Blizzard Mipmap" file format used Pillow now supports reading the BLP "Blizzard Mipmap" file format used
for tiles in Blizzard's engine. for tiles in Blizzard's engine.
Other Changes Other changes
============= =============
WebP memory leak WebP memory leak

View File

@ -1,7 +1,7 @@
5.2.0 5.2.0
----- -----
API Changes API changes
=========== ===========
Deprecations Deprecations
@ -17,7 +17,7 @@ Pillow 6.0.0, and ``PILLOW_VERSION`` will be removed after that.
Use ``PIL.__version__`` instead. Use ``PIL.__version__`` instead.
API Additions API additions
============= =============
3D color lookup tables 3D color lookup tables
@ -75,7 +75,7 @@ TGA file format
Pillow can now read and write LA data (in addition to L, P, RGB and RGBA), and Pillow can now read and write LA data (in addition to L, P, RGB and RGBA), and
write RLE data (in addition to uncompressed). write RLE data (in addition to uncompressed).
Other Changes Other changes
============= =============
Support added for Python 3.7 Support added for Python 3.7

View File

@ -1,7 +1,7 @@
5.3.0 5.3.0
----- -----
API Changes API changes
=========== ===========
Image size Image size
@ -20,7 +20,7 @@ The exceptions to this are:
as direct image size setting was previously necessary to work around an issue with tile extents. as direct image size setting was previously necessary to work around an issue with tile extents.
API Additions API additions
============= =============
Added line width parameter to rectangle and ellipse-based shapes Added line width parameter to rectangle and ellipse-based shapes
@ -59,7 +59,7 @@ and size, new method ``ImageOps.pad`` pads images to fill a requested aspect
ratio and size, filling new space with a provided ``color`` and positioning the ratio and size, filling new space with a provided ``color`` and positioning the
image within the new area through a ``centering`` argument. image within the new area through a ``centering`` argument.
Other Changes Other changes
============= =============
Added support for reading tiled TIFF images through LibTIFF. Compressed TIFF Added support for reading tiled TIFF images through LibTIFF. Compressed TIFF

View File

@ -1,7 +1,7 @@
5.4.0 5.4.0
----- -----
API Changes API changes
=========== ===========
APNG extension to PNG plugin APNG extension to PNG plugin
@ -55,7 +55,7 @@ TIFF images can now be saved with custom integer, float and string TIFF tags::
print(im2.tag_v2[37002]) # "custom tag value" print(im2.tag_v2[37002]) # "custom tag value"
print(im2.tag_v2[37004]) # b"custom tag value" print(im2.tag_v2[37004]) # b"custom tag value"
Other Changes Other changes
============= =============
ImageOps.fit ImageOps.fit

Some files were not shown because too many files have changed in this diff Show More