Merge branch 'main' into init
2
.github/workflows/cifuzz.yml
vendored
|
@ -2,6 +2,8 @@ name: CIFuzz
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
paths:
|
paths:
|
||||||
- ".github/workflows/cifuzz.yml"
|
- ".github/workflows/cifuzz.yml"
|
||||||
- "**.c"
|
- "**.c"
|
||||||
|
|
2
.github/workflows/docs.yml
vendored
|
@ -2,6 +2,8 @@ name: Docs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
paths:
|
paths:
|
||||||
- ".github/workflows/docs.yml"
|
- ".github/workflows/docs.yml"
|
||||||
- "docs/**"
|
- "docs/**"
|
||||||
|
|
2
.github/workflows/test-cygwin.yml
vendored
|
@ -2,6 +2,8 @@ name: Test Cygwin
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- ".github/workflows/docs.yml"
|
- ".github/workflows/docs.yml"
|
||||||
- ".github/workflows/wheels*"
|
- ".github/workflows/wheels*"
|
||||||
|
|
2
.github/workflows/test-docker.yml
vendored
|
@ -2,6 +2,8 @@ name: Test Docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- ".github/workflows/docs.yml"
|
- ".github/workflows/docs.yml"
|
||||||
- ".github/workflows/wheels*"
|
- ".github/workflows/wheels*"
|
||||||
|
|
2
.github/workflows/test-mingw.yml
vendored
|
@ -2,6 +2,8 @@ name: Test MinGW
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- ".github/workflows/docs.yml"
|
- ".github/workflows/docs.yml"
|
||||||
- ".github/workflows/wheels*"
|
- ".github/workflows/wheels*"
|
||||||
|
|
4
.github/workflows/test-valgrind.yml
vendored
|
@ -1,9 +1,11 @@
|
||||||
name: Test Valgrind
|
name: Test Valgrind
|
||||||
|
|
||||||
# like the docker tests, but running valgrind only on *.c/*.h changes.
|
# like the Docker tests, but running valgrind only on *.c/*.h changes.
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
paths:
|
paths:
|
||||||
- ".github/workflows/test-valgrind.yml"
|
- ".github/workflows/test-valgrind.yml"
|
||||||
- "**.c"
|
- "**.c"
|
||||||
|
|
2
.github/workflows/test.yml
vendored
|
@ -2,6 +2,8 @@ name: Test
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
- ".github/workflows/docs.yml"
|
- ".github/workflows/docs.yml"
|
||||||
- ".github/workflows/wheels*"
|
- ".github/workflows/wheels*"
|
||||||
|
|
17
CHANGES.rst
|
@ -2,9 +2,24 @@
|
||||||
Changelog (Pillow)
|
Changelog (Pillow)
|
||||||
==================
|
==================
|
||||||
|
|
||||||
10.1.0 (unreleased)
|
10.1.0 (2023-10-15)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
- Added TrueType default font to allow for different sizes #7354
|
||||||
|
[radarhere]
|
||||||
|
|
||||||
|
- Fixed invalid argument warning #7442
|
||||||
|
[radarhere]
|
||||||
|
|
||||||
|
- Added ImageOps cover method #7412
|
||||||
|
[radarhere, hugovk]
|
||||||
|
|
||||||
|
- Catch struct.error from truncated EXIF when reading JPEG DPI #7458
|
||||||
|
[radarhere]
|
||||||
|
|
||||||
|
- Consider default image when selecting mode for PNG save_all #7437
|
||||||
|
[radarhere]
|
||||||
|
|
||||||
- Support BGR;15, BGR;16 and BGR;24 access, unpacking and putdata #7303
|
- Support BGR;15, BGR;16 and BGR;24 access, unpacking and putdata #7303
|
||||||
[radarhere]
|
[radarhere]
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ Released as needed privately to individual vendors for critical security-related
|
||||||
and copy into `dist/`. For example using [GitHub CLI](https://github.com/cli/cli):
|
and copy into `dist/`. For example using [GitHub CLI](https://github.com/cli/cli):
|
||||||
```bash
|
```bash
|
||||||
gh run download --dir dist
|
gh run download --dir dist
|
||||||
# select dist-x.y.z
|
# select wheels
|
||||||
```
|
```
|
||||||
* [ ] Download the Linux aarch64 wheels created by Travis CI from [GitHub releases](https://github.com/python-pillow/Pillow/releases)
|
* [ ] Download the Linux aarch64 wheels created by Travis CI from [GitHub releases](https://github.com/python-pillow/Pillow/releases)
|
||||||
and copy into `dist`.
|
and copy into `dist`.
|
||||||
|
|
BIN
Tests/images/default_font_freetype.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
BIN
Tests/images/imagedraw_default_font_size.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
Tests/images/truncated_exif_dpi.jpg
Normal file
After Width: | Height: | Size: 7.5 KiB |
|
@ -673,10 +673,16 @@ def test_seek_after_close():
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("mode", ("RGBA", "RGB", "P"))
|
@pytest.mark.parametrize("mode", ("RGBA", "RGB", "P"))
|
||||||
def test_different_modes_in_later_frames(mode, tmp_path):
|
@pytest.mark.parametrize("default_image", (True, False))
|
||||||
|
def test_different_modes_in_later_frames(mode, default_image, tmp_path):
|
||||||
test_file = str(tmp_path / "temp.png")
|
test_file = str(tmp_path / "temp.png")
|
||||||
|
|
||||||
im = Image.new("L", (1, 1))
|
im = Image.new("L", (1, 1))
|
||||||
im.save(test_file, save_all=True, append_images=[Image.new(mode, (1, 1))])
|
im.save(
|
||||||
|
test_file,
|
||||||
|
save_all=True,
|
||||||
|
default_image=default_image,
|
||||||
|
append_images=[Image.new(mode, (1, 1))],
|
||||||
|
)
|
||||||
with Image.open(test_file) as reloaded:
|
with Image.open(test_file) as reloaded:
|
||||||
assert reloaded.mode == mode
|
assert reloaded.mode == mode
|
||||||
|
|
|
@ -767,6 +767,13 @@ class TestFileJpeg:
|
||||||
# This should return the default
|
# This should return the default
|
||||||
assert im.info.get("dpi") == (72, 72)
|
assert im.info.get("dpi") == (72, 72)
|
||||||
|
|
||||||
|
def test_dpi_exif_truncated(self):
|
||||||
|
# Arrange
|
||||||
|
with Image.open("Tests/images/truncated_exif_dpi.jpg") as im:
|
||||||
|
# Act / Assert
|
||||||
|
# This should return the default
|
||||||
|
assert im.info.get("dpi") == (72, 72)
|
||||||
|
|
||||||
def test_no_dpi_in_exif(self):
|
def test_no_dpi_in_exif(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
# This is photoshop-200dpi.jpg with resolution removed from EXIF:
|
# This is photoshop-200dpi.jpg with resolution removed from EXIF:
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
|
import contextlib
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from PIL import Image, ImageColor, ImageDraw, ImageFont
|
from PIL import Image, ImageColor, ImageDraw, ImageFont, features
|
||||||
|
|
||||||
from .helper import (
|
from .helper import (
|
||||||
assert_image_equal,
|
assert_image_equal,
|
||||||
|
@ -1353,7 +1354,33 @@ def test_setting_default_font():
|
||||||
assert draw.getfont() == font
|
assert draw.getfont() == font
|
||||||
finally:
|
finally:
|
||||||
ImageDraw.ImageDraw.font = None
|
ImageDraw.ImageDraw.font = None
|
||||||
assert isinstance(draw.getfont(), ImageFont.ImageFont)
|
assert isinstance(draw.getfont(), ImageFont.load_default().__class__)
|
||||||
|
|
||||||
|
|
||||||
|
def test_default_font_size():
|
||||||
|
freetype_support = features.check_module("freetype2")
|
||||||
|
text = "Default font at a specific size."
|
||||||
|
|
||||||
|
im = Image.new("RGB", (220, 25))
|
||||||
|
draw = ImageDraw.Draw(im)
|
||||||
|
with contextlib.nullcontext() if freetype_support else pytest.raises(ImportError):
|
||||||
|
draw.text((0, 0), text, font_size=16)
|
||||||
|
assert_image_equal_tofile(im, "Tests/images/imagedraw_default_font_size.png")
|
||||||
|
|
||||||
|
with contextlib.nullcontext() if freetype_support else pytest.raises(ImportError):
|
||||||
|
assert draw.textlength(text, font_size=16) == 216
|
||||||
|
|
||||||
|
with contextlib.nullcontext() if freetype_support else pytest.raises(ImportError):
|
||||||
|
assert draw.textbbox((0, 0), text, font_size=16) == (0, 3, 216, 19)
|
||||||
|
|
||||||
|
im = Image.new("RGB", (220, 25))
|
||||||
|
draw = ImageDraw.Draw(im)
|
||||||
|
with contextlib.nullcontext() if freetype_support else pytest.raises(ImportError):
|
||||||
|
draw.multiline_text((0, 0), text, font_size=16)
|
||||||
|
assert_image_equal_tofile(im, "Tests/images/imagedraw_default_font_size.png")
|
||||||
|
|
||||||
|
with contextlib.nullcontext() if freetype_support else pytest.raises(ImportError):
|
||||||
|
assert draw.multiline_textbbox((0, 0), text, font_size=16) == (0, 3, 216, 19)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("bbox", BBOX)
|
@pytest.mark.parametrize("bbox", BBOX)
|
||||||
|
|
|
@ -453,7 +453,7 @@ def test_load_non_font_bytes():
|
||||||
|
|
||||||
def test_default_font():
|
def test_default_font():
|
||||||
# Arrange
|
# Arrange
|
||||||
txt = 'This is a "better than nothing" default font.'
|
txt = "This is a default font using FreeType support."
|
||||||
im = Image.new(mode="RGB", size=(300, 100))
|
im = Image.new(mode="RGB", size=(300, 100))
|
||||||
draw = ImageDraw.Draw(im)
|
draw = ImageDraw.Draw(im)
|
||||||
|
|
||||||
|
@ -461,8 +461,11 @@ def test_default_font():
|
||||||
default_font = ImageFont.load_default()
|
default_font = ImageFont.load_default()
|
||||||
draw.text((10, 10), txt, font=default_font)
|
draw.text((10, 10), txt, font=default_font)
|
||||||
|
|
||||||
|
larger_default_font = ImageFont.load_default(size=14)
|
||||||
|
draw.text((10, 60), txt, font=larger_default_font)
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert_image_equal_tofile(im, "Tests/images/default_font.png")
|
assert_image_equal_tofile(im, "Tests/images/default_font_freetype.png")
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("mode", (None, "1", "RGBA"))
|
@pytest.mark.parametrize("mode", (None, "1", "RGBA"))
|
||||||
|
@ -485,14 +488,6 @@ def test_render_empty(font):
|
||||||
assert_image_equal(im, target)
|
assert_image_equal(im, target)
|
||||||
|
|
||||||
|
|
||||||
def test_unicode_pilfont():
|
|
||||||
# should not segfault, should return UnicodeDecodeError
|
|
||||||
# issue #2826
|
|
||||||
font = ImageFont.load_default()
|
|
||||||
with pytest.raises(UnicodeEncodeError):
|
|
||||||
font.getbbox("’")
|
|
||||||
|
|
||||||
|
|
||||||
def test_unicode_extended(layout_engine):
|
def test_unicode_extended(layout_engine):
|
||||||
# issue #3777
|
# issue #3777
|
||||||
text = "A\u278A\U0001F12B"
|
text = "A\u278A\U0001F12B"
|
||||||
|
@ -722,14 +717,6 @@ def test_variation_set_by_axes(font):
|
||||||
_check_text(font, "Tests/images/variation_tiny_axes.png", 32.5)
|
_check_text(font, "Tests/images/variation_tiny_axes.png", 32.5)
|
||||||
|
|
||||||
|
|
||||||
def test_textbbox_non_freetypefont():
|
|
||||||
im = Image.new("RGB", (200, 200))
|
|
||||||
d = ImageDraw.Draw(im)
|
|
||||||
default_font = ImageFont.load_default()
|
|
||||||
assert d.textlength("test", font=default_font) == 24
|
|
||||||
assert d.textbbox((0, 0), "test", font=default_font) == (0, 0, 24, 11)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"anchor, left, top",
|
"anchor, left, top",
|
||||||
(
|
(
|
||||||
|
|
45
Tests/test_imagefontpil.py
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
from PIL import Image, ImageDraw, ImageFont, features
|
||||||
|
|
||||||
|
from .helper import assert_image_equal_tofile
|
||||||
|
|
||||||
|
pytestmark = pytest.mark.skipif(
|
||||||
|
features.check_module("freetype2"),
|
||||||
|
reason="PILfont superseded if FreeType is supported",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_default_font():
|
||||||
|
# Arrange
|
||||||
|
txt = 'This is a "better than nothing" default font.'
|
||||||
|
im = Image.new(mode="RGB", size=(300, 100))
|
||||||
|
draw = ImageDraw.Draw(im)
|
||||||
|
|
||||||
|
# Act
|
||||||
|
default_font = ImageFont.load_default()
|
||||||
|
draw.text((10, 10), txt, font=default_font)
|
||||||
|
|
||||||
|
# Assert
|
||||||
|
assert_image_equal_tofile(im, "Tests/images/default_font.png")
|
||||||
|
|
||||||
|
|
||||||
|
def test_size_without_freetype():
|
||||||
|
with pytest.raises(ImportError):
|
||||||
|
ImageFont.load_default(size=14)
|
||||||
|
|
||||||
|
|
||||||
|
def test_unicode():
|
||||||
|
# should not segfault, should return UnicodeDecodeError
|
||||||
|
# issue #2826
|
||||||
|
font = ImageFont.load_default()
|
||||||
|
with pytest.raises(UnicodeEncodeError):
|
||||||
|
font.getbbox("’")
|
||||||
|
|
||||||
|
|
||||||
|
def test_textbbox():
|
||||||
|
im = Image.new("RGB", (200, 200))
|
||||||
|
d = ImageDraw.Draw(im)
|
||||||
|
default_font = ImageFont.load_default()
|
||||||
|
assert d.textlength("test", font=default_font) == 24
|
||||||
|
assert d.textbbox((0, 0), "test", font=default_font) == (0, 0, 24, 11)
|
|
@ -39,6 +39,9 @@ def test_sanity():
|
||||||
ImageOps.contain(hopper("L"), (128, 128))
|
ImageOps.contain(hopper("L"), (128, 128))
|
||||||
ImageOps.contain(hopper("RGB"), (128, 128))
|
ImageOps.contain(hopper("RGB"), (128, 128))
|
||||||
|
|
||||||
|
ImageOps.cover(hopper("L"), (128, 128))
|
||||||
|
ImageOps.cover(hopper("RGB"), (128, 128))
|
||||||
|
|
||||||
ImageOps.crop(hopper("L"), 1)
|
ImageOps.crop(hopper("L"), 1)
|
||||||
ImageOps.crop(hopper("RGB"), 1)
|
ImageOps.crop(hopper("RGB"), 1)
|
||||||
|
|
||||||
|
@ -119,6 +122,20 @@ def test_contain_round():
|
||||||
assert new_im.height == 5
|
assert new_im.height == 5
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"image_name, expected_size",
|
||||||
|
(
|
||||||
|
("colr_bungee.png", (1024, 256)), # landscape
|
||||||
|
("imagedraw_stroke_multiline.png", (256, 640)), # portrait
|
||||||
|
("hopper.png", (256, 256)), # square
|
||||||
|
),
|
||||||
|
)
|
||||||
|
def test_cover(image_name, expected_size):
|
||||||
|
with Image.open("Tests/images/" + image_name) as im:
|
||||||
|
new_im = ImageOps.cover(im, (256, 256))
|
||||||
|
assert new_im.size == expected_size
|
||||||
|
|
||||||
|
|
||||||
def test_pad():
|
def test_pad():
|
||||||
# Same ratio
|
# Same ratio
|
||||||
im = hopper()
|
im = hopper()
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# install libimagequant
|
# install libimagequant
|
||||||
|
|
||||||
archive=libimagequant-4.2.1
|
archive=libimagequant-4.2.2
|
||||||
|
|
||||||
./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/main/$archive.tar.gz
|
./download-and-extract.sh $archive https://raw.githubusercontent.com/python-pillow/pillow-depends/main/$archive.tar.gz
|
||||||
|
|
||||||
|
|
BIN
docs/example/image_thumbnail.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/example/imageops_contain.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
docs/example/imageops_cover.png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
docs/example/imageops_fit.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/example/imageops_pad.png
Normal file
After Width: | Height: | Size: 19 KiB |
|
@ -268,6 +268,37 @@ true, to provide for the same changes to the image's size.
|
||||||
A more general form of image transformations can be carried out via the
|
A more general form of image transformations can be carried out via the
|
||||||
:py:meth:`~PIL.Image.Image.transform` method.
|
:py:meth:`~PIL.Image.Image.transform` method.
|
||||||
|
|
||||||
|
Relative resizing
|
||||||
|
^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Instead of calculating the size of the new image when resizing, you can also
|
||||||
|
choose to resize relative to a given size.
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
from PIL import Image, ImageOps
|
||||||
|
size = (100, 150)
|
||||||
|
with Image.open("Tests/images/hopper.png") as im:
|
||||||
|
ImageOps.contain(im, size).save("imageops_contain.png")
|
||||||
|
ImageOps.cover(im, size).save("imageops_cover.png")
|
||||||
|
ImageOps.fit(im, size).save("imageops_fit.png")
|
||||||
|
ImageOps.pad(im, size, color="#f00").save("imageops_pad.png")
|
||||||
|
|
||||||
|
# thumbnail() can also be used,
|
||||||
|
# but will modify the image object in place
|
||||||
|
im.thumbnail(size)
|
||||||
|
im.save("imageops_thumbnail.png")
|
||||||
|
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
| | :py:meth:`~PIL.Image.Image.thumbnail` | :py:meth:`~PIL.ImageOps.contain` | :py:meth:`~PIL.ImageOps.cover` | :py:meth:`~PIL.ImageOps.fit` | :py:meth:`~PIL.ImageOps.pad` |
|
||||||
|
+================+===========================================+============================================+==========================================+========================================+========================================+
|
||||||
|
|Given size | ``(100, 150)`` | ``(100, 150)`` | ``(100, 150)`` | ``(100, 150)`` | ``(100, 150)`` |
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
|Resulting image | .. image:: ../example/image_thumbnail.png | .. image:: ../example/imageops_contain.png | .. image:: ../example/imageops_cover.png | .. image:: ../example/imageops_fit.png | .. image:: ../example/imageops_pad.png |
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
|Resulting size | ``100×100`` | ``100×100`` | ``150×150`` | ``100×150`` | ``100×150`` |
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
|
||||||
.. _color-transforms:
|
.. _color-transforms:
|
||||||
|
|
||||||
Color transforms
|
Color transforms
|
||||||
|
|
|
@ -26,14 +26,14 @@ Pillow decodes files in two stages:
|
||||||
it.
|
it.
|
||||||
|
|
||||||
An image plugin should contain a format handler derived from the
|
An image plugin should contain a format handler derived from the
|
||||||
:py:class:`PIL.ImageFile.ImageFile` base class. This class should
|
:py:class:`PIL.ImageFile.ImageFile` base class. This class should provide an
|
||||||
provide an ``_open`` method, which reads the file header and
|
``_open`` method, which reads the file header and set at least the internal
|
||||||
sets up at least the :py:attr:`~PIL.Image.Image.mode` and
|
``_size`` and ``_mode`` attributes so that :py:attr:`~PIL.Image.Image.mode` and
|
||||||
:py:attr:`~PIL.Image.Image.size` attributes. To be able to load the
|
:py:attr:`~PIL.Image.Image.size` are populated. To be able to load the file,
|
||||||
file, the method must also create a list of ``tile`` descriptors,
|
the method must also create a list of ``tile`` descriptors, which contain a
|
||||||
which contain a decoder name, extents of the tile, and
|
decoder name, extents of the tile, and any decoder-specific data. The format
|
||||||
any decoder-specific data. The format handler class must be explicitly
|
handler class must be explicitly registered, via a call to the
|
||||||
registered, via a call to the :py:mod:`~PIL.Image` module.
|
:py:mod:`~PIL.Image` module.
|
||||||
|
|
||||||
.. note:: For performance reasons, it is important that the
|
.. note:: For performance reasons, it is important that the
|
||||||
``_open`` method quickly rejects files that do not have the
|
``_open`` method quickly rejects files that do not have the
|
||||||
|
@ -96,13 +96,13 @@ true color.
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
The format handler must always set the
|
The format handler must always set the internal ``_size`` and ``_mode``
|
||||||
:py:attr:`~PIL.Image.Image.size` and :py:attr:`~PIL.Image.Image.mode`
|
attributes so that :py:attr:`~PIL.Image.Image.size` and
|
||||||
attributes. If these are not set, the file cannot be opened. To
|
:py:attr:`~PIL.Image.Image.mode` are populated. If these are not set, the file
|
||||||
simplify the plugin, the calling code considers exceptions like
|
cannot be opened. To simplify the plugin, the calling code considers exceptions
|
||||||
:py:exc:`SyntaxError`, :py:exc:`KeyError`, :py:exc:`IndexError`,
|
like :py:exc:`SyntaxError`, :py:exc:`KeyError`, :py:exc:`IndexError`,
|
||||||
:py:exc:`EOFError` and :py:exc:`struct.error` as a failure to identify
|
:py:exc:`EOFError` and :py:exc:`struct.error` as a failure to identify the
|
||||||
the file.
|
file.
|
||||||
|
|
||||||
Note that the image plugin must be explicitly registered using
|
Note that the image plugin must be explicitly registered using
|
||||||
:py:func:`PIL.Image.register_open`. Although not required, it is also a good
|
:py:func:`PIL.Image.register_open`. Although not required, it is also a good
|
||||||
|
|
|
@ -182,7 +182,7 @@ Many of Pillow's features require external libraries:
|
||||||
|
|
||||||
* **libimagequant** provides improved color quantization
|
* **libimagequant** provides improved color quantization
|
||||||
|
|
||||||
* Pillow has been tested with libimagequant **2.6-4.2.1**
|
* Pillow has been tested with libimagequant **2.6-4.2.2**
|
||||||
* Libimagequant is licensed GPLv3, which is more restrictive than
|
* Libimagequant is licensed GPLv3, which is more restrictive than
|
||||||
the Pillow license, therefore we will not be distributing binaries
|
the Pillow license, therefore we will not be distributing binaries
|
||||||
with libimagequant support enabled.
|
with libimagequant support enabled.
|
||||||
|
@ -496,93 +496,93 @@ These platforms have been reported to work at the versions mentioned.
|
||||||
Contributors please test Pillow on your platform then update this
|
Contributors please test Pillow on your platform then update this
|
||||||
document and send a pull request.
|
document and send a pull request.
|
||||||
|
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Operating system | | Tested Python | | Latest tested | | Tested |
|
| Operating system | | Tested Python | | Latest tested | | Tested |
|
||||||
| | | versions | | Pillow version | | processors |
|
| | | versions | | Pillow version | | processors |
|
||||||
+==================================+===========================+==================+==============+
|
+==================================+============================+==================+==============+
|
||||||
| macOS 14 Sonoma | 3.8, 3.9, 3.10, 3.11 | 10.0.1 |arm |
|
| macOS 14 Sonoma | 3.8, 3.9, 3.10, 3.11, 3.12 | 10.1.0 |arm |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| macOS 13 Ventura | 3.8, 3.9, 3.10, 3.11 | 10.0.1 |arm |
|
| macOS 13 Ventura | 3.8, 3.9, 3.10, 3.11 | 10.0.1 |arm |
|
||||||
| +---------------------------+------------------+ |
|
| +----------------------------+------------------+ |
|
||||||
| | 3.7 | 9.5.0 | |
|
| | 3.7 | 9.5.0 | |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| macOS 12 Monterey | 3.7, 3.8, 3.9, 3.10, 3.11 | 9.3.0 |arm |
|
| macOS 12 Monterey | 3.7, 3.8, 3.9, 3.10, 3.11 | 9.3.0 |arm |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| macOS 11 Big Sur | 3.7, 3.8, 3.9, 3.10 | 8.4.0 |arm |
|
| macOS 11 Big Sur | 3.7, 3.8, 3.9, 3.10 | 8.4.0 |arm |
|
||||||
| +---------------------------+------------------+--------------+
|
| +----------------------------+------------------+--------------+
|
||||||
| | 3.7, 3.8, 3.9, 3.10, 3.11 | 9.4.0 |x86-64 |
|
| | 3.7, 3.8, 3.9, 3.10, 3.11 | 9.4.0 |x86-64 |
|
||||||
| +---------------------------+------------------+ |
|
| +----------------------------+------------------+ |
|
||||||
| | 3.6 | 8.4.0 | |
|
| | 3.6 | 8.4.0 | |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| macOS 10.15 Catalina | 3.6, 3.7, 3.8, 3.9 | 8.3.2 |x86-64 |
|
| macOS 10.15 Catalina | 3.6, 3.7, 3.8, 3.9 | 8.3.2 |x86-64 |
|
||||||
| +---------------------------+------------------+ |
|
| +----------------------------+------------------+ |
|
||||||
| | 3.5 | 7.2.0 | |
|
| | 3.5 | 7.2.0 | |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| macOS 10.14 Mojave | 3.5, 3.6, 3.7, 3.8 | 7.2.0 |x86-64 |
|
| macOS 10.14 Mojave | 3.5, 3.6, 3.7, 3.8 | 7.2.0 |x86-64 |
|
||||||
| +---------------------------+------------------+ |
|
| +----------------------------+------------------+ |
|
||||||
| | 2.7 | 6.0.0 | |
|
| | 2.7 | 6.0.0 | |
|
||||||
| +---------------------------+------------------+ |
|
| +----------------------------+------------------+ |
|
||||||
| | 3.4 | 5.4.1 | |
|
| | 3.4 | 5.4.1 | |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| macOS 10.13 High Sierra | 2.7, 3.4, 3.5, 3.6 | 4.2.1 |x86-64 |
|
| macOS 10.13 High Sierra | 2.7, 3.4, 3.5, 3.6 | 4.2.1 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| macOS 10.12 Sierra | 2.7, 3.4, 3.5, 3.6 | 4.1.1 |x86-64 |
|
| macOS 10.12 Sierra | 2.7, 3.4, 3.5, 3.6 | 4.1.1 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Mac OS X 10.11 El Capitan | 2.7, 3.4, 3.5, 3.6, 3.7 | 5.4.1 |x86-64 |
|
| Mac OS X 10.11 El Capitan | 2.7, 3.4, 3.5, 3.6, 3.7 | 5.4.1 |x86-64 |
|
||||||
| +---------------------------+------------------+ |
|
| +----------------------------+------------------+ |
|
||||||
| | 3.3 | 4.1.0 | |
|
| | 3.3 | 4.1.0 | |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Mac OS X 10.9 Mavericks | 2.7, 3.2, 3.3, 3.4 | 3.0.0 |x86-64 |
|
| Mac OS X 10.9 Mavericks | 2.7, 3.2, 3.3, 3.4 | 3.0.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Mac OS X 10.8 Mountain Lion | 2.6, 2.7, 3.2, 3.3 | |x86-64 |
|
| Mac OS X 10.8 Mountain Lion | 2.6, 2.7, 3.2, 3.3 | |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Redhat Linux 6 | 2.6 | |x86 |
|
| Redhat Linux 6 | 2.6 | |x86 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| CentOS 6.3 | 2.7, 3.3 | |x86 |
|
| CentOS 6.3 | 2.7, 3.3 | |x86 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| CentOS 8 | 3.9 | 9.0.0 |x86-64 |
|
| CentOS 8 | 3.9 | 9.0.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Fedora 23 | 2.7, 3.4 | 3.1.0 |x86-64 |
|
| Fedora 23 | 2.7, 3.4 | 3.1.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Ubuntu Linux 12.04 LTS (Precise) | | 2.6, 3.2, 3.3, 3.4, 3.5 | 3.4.1 |x86,x86-64 |
|
| Ubuntu Linux 12.04 LTS (Precise) | | 2.6, 3.2, 3.3, 3.4, 3.5 | 3.4.1 |x86,x86-64 |
|
||||||
| | | PyPy5.3.1, PyPy3 v2.4.0 | | |
|
| | | PyPy5.3.1, PyPy3 v2.4.0 | | |
|
||||||
| +---------------------------+------------------+--------------+
|
| +----------------------------+------------------+--------------+
|
||||||
| | 2.7 | 4.3.0 |x86-64 |
|
| | 2.7 | 4.3.0 |x86-64 |
|
||||||
| +---------------------------+------------------+--------------+
|
| +----------------------------+------------------+--------------+
|
||||||
| | 2.7, 3.2 | 3.4.1 |ppc |
|
| | 2.7, 3.2 | 3.4.1 |ppc |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Ubuntu Linux 10.04 LTS (Lucid) | 2.6 | 2.3.0 |x86,x86-64 |
|
| Ubuntu Linux 10.04 LTS (Lucid) | 2.6 | 2.3.0 |x86,x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Debian 8.2 Jessie | 2.7, 3.4 | 3.1.0 |x86-64 |
|
| Debian 8.2 Jessie | 2.7, 3.4 | 3.1.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Raspbian Jessie | 2.7, 3.4 | 3.1.0 |arm |
|
| Raspbian Jessie | 2.7, 3.4 | 3.1.0 |arm |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Raspbian Stretch | 2.7, 3.5 | 4.0.0 |arm |
|
| Raspbian Stretch | 2.7, 3.5 | 4.0.0 |arm |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Raspberry Pi OS | 3.6, 3.7, 3.8, 3.9 | 8.2.0 |arm |
|
| Raspberry Pi OS | 3.6, 3.7, 3.8, 3.9 | 8.2.0 |arm |
|
||||||
| +---------------------------+------------------+ |
|
| +----------------------------+------------------+ |
|
||||||
| | 2.7 | 6.2.2 | |
|
| | 2.7 | 6.2.2 | |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Gentoo Linux | 2.7, 3.2 | 2.1.0 |x86-64 |
|
| Gentoo Linux | 2.7, 3.2 | 2.1.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| FreeBSD 11.1 | 2.7, 3.4, 3.5, 3.6 | 4.3.0 |x86-64 |
|
| FreeBSD 11.1 | 2.7, 3.4, 3.5, 3.6 | 4.3.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| FreeBSD 10.3 | 2.7, 3.4, 3.5 | 4.2.0 |x86-64 |
|
| FreeBSD 10.3 | 2.7, 3.4, 3.5 | 4.2.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| FreeBSD 10.2 | 2.7, 3.4 | 3.1.0 |x86-64 |
|
| FreeBSD 10.2 | 2.7, 3.4 | 3.1.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Windows 10 | 3.7 | 7.1.0 |x86-64 |
|
| Windows 10 | 3.7 | 7.1.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Windows 10/Cygwin 3.3 | 3.6, 3.7, 3.8, 3.9 | 8.4.0 |x86-64 |
|
| Windows 10/Cygwin 3.3 | 3.6, 3.7, 3.8, 3.9 | 8.4.0 |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Windows 8.1 Pro | 2.6, 2.7, 3.2, 3.3, 3.4 | 2.4.0 |x86,x86-64 |
|
| Windows 8.1 Pro | 2.6, 2.7, 3.2, 3.3, 3.4 | 2.4.0 |x86,x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Windows 8 Pro | 2.6, 2.7, 3.2, 3.3, 3.4a3 | 2.2.0 |x86,x86-64 |
|
| Windows 8 Pro | 2.6, 2.7, 3.2, 3.3, 3.4a3 | 2.2.0 |x86,x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Windows 7 Professional | 3.7 | 7.0.0 |x86,x86-64 |
|
| Windows 7 Professional | 3.7 | 7.0.0 |x86,x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
| Windows Server 2008 R2 Enterprise| 3.3 | |x86-64 |
|
| Windows Server 2008 R2 Enterprise| 3.3 | |x86-64 |
|
||||||
+----------------------------------+---------------------------+------------------+--------------+
|
+----------------------------------+----------------------------+------------------+--------------+
|
||||||
|
|
||||||
Old Versions
|
Old Versions
|
||||||
------------
|
------------
|
||||||
|
|
|
@ -351,7 +351,7 @@ Methods
|
||||||
|
|
||||||
Draw a shape.
|
Draw a shape.
|
||||||
|
|
||||||
.. py:method:: ImageDraw.text(xy, text, fill=None, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, stroke_fill=None, embedded_color=False)
|
.. py:method:: ImageDraw.text(xy, text, fill=None, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, stroke_fill=None, embedded_color=False, font_size=None)
|
||||||
|
|
||||||
Draws the string at the given position.
|
Draws the string at the given position.
|
||||||
|
|
||||||
|
@ -416,8 +416,14 @@ Methods
|
||||||
|
|
||||||
.. versionadded:: 8.0.0
|
.. versionadded:: 8.0.0
|
||||||
|
|
||||||
|
:param font_size: If ``font`` is not provided, then the size to use for the default
|
||||||
|
font.
|
||||||
|
Keyword-only argument.
|
||||||
|
|
||||||
.. py:method:: ImageDraw.multiline_text(xy, text, fill=None, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, stroke_fill=None, embedded_color=False)
|
.. versionadded:: 10.1.0
|
||||||
|
|
||||||
|
|
||||||
|
.. py:method:: ImageDraw.multiline_text(xy, text, fill=None, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, stroke_fill=None, embedded_color=False, font_size=None)
|
||||||
|
|
||||||
Draws the string at the given position.
|
Draws the string at the given position.
|
||||||
|
|
||||||
|
@ -477,7 +483,13 @@ Methods
|
||||||
|
|
||||||
.. versionadded:: 8.0.0
|
.. versionadded:: 8.0.0
|
||||||
|
|
||||||
.. py:method:: ImageDraw.textlength(text, font=None, direction=None, features=None, language=None, embedded_color=False)
|
:param font_size: If ``font`` is not provided, then the size to use for the default
|
||||||
|
font.
|
||||||
|
Keyword-only argument.
|
||||||
|
|
||||||
|
.. versionadded:: 10.1.0
|
||||||
|
|
||||||
|
.. py:method:: ImageDraw.textlength(text, font=None, direction=None, features=None, language=None, embedded_color=False, font_size=None)
|
||||||
|
|
||||||
Returns length (in pixels with 1/64 precision) of given text when rendered
|
Returns length (in pixels with 1/64 precision) of given text when rendered
|
||||||
in font with provided direction, features, and language.
|
in font with provided direction, features, and language.
|
||||||
|
@ -538,9 +550,15 @@ Methods
|
||||||
It should be a `BCP 47 language code`_.
|
It should be a `BCP 47 language code`_.
|
||||||
Requires libraqm.
|
Requires libraqm.
|
||||||
:param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX).
|
:param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX).
|
||||||
|
:param font_size: If ``font`` is not provided, then the size to use for the default
|
||||||
|
font.
|
||||||
|
Keyword-only argument.
|
||||||
|
|
||||||
|
.. versionadded:: 10.1.0
|
||||||
|
|
||||||
:return: Either width for horizontal text, or height for vertical text.
|
:return: Either width for horizontal text, or height for vertical text.
|
||||||
|
|
||||||
.. py:method:: ImageDraw.textbbox(xy, text, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, embedded_color=False)
|
.. py:method:: ImageDraw.textbbox(xy, text, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, embedded_color=False, font_size=None)
|
||||||
|
|
||||||
Returns bounding box (in pixels) of given text relative to given anchor
|
Returns bounding box (in pixels) of given text relative to given anchor
|
||||||
when rendered in font with provided direction, features, and language.
|
when rendered in font with provided direction, features, and language.
|
||||||
|
@ -588,9 +606,15 @@ Methods
|
||||||
Requires libraqm.
|
Requires libraqm.
|
||||||
:param stroke_width: The width of the text stroke.
|
:param stroke_width: The width of the text stroke.
|
||||||
:param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX).
|
:param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX).
|
||||||
|
:param font_size: If ``font`` is not provided, then the size to use for the default
|
||||||
|
font.
|
||||||
|
Keyword-only argument.
|
||||||
|
|
||||||
|
.. versionadded:: 10.1.0
|
||||||
|
|
||||||
:return: ``(left, top, right, bottom)`` bounding box
|
:return: ``(left, top, right, bottom)`` bounding box
|
||||||
|
|
||||||
.. py:method:: ImageDraw.multiline_textbbox(xy, text, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, embedded_color=False)
|
.. py:method:: ImageDraw.multiline_textbbox(xy, text, font=None, anchor=None, spacing=4, align="left", direction=None, features=None, language=None, stroke_width=0, embedded_color=False, font_size=None)
|
||||||
|
|
||||||
Returns bounding box (in pixels) of given text relative to given anchor
|
Returns bounding box (in pixels) of given text relative to given anchor
|
||||||
when rendered in font with provided direction, features, and language.
|
when rendered in font with provided direction, features, and language.
|
||||||
|
@ -632,6 +656,12 @@ Methods
|
||||||
Requires libraqm.
|
Requires libraqm.
|
||||||
:param stroke_width: The width of the text stroke.
|
:param stroke_width: The width of the text stroke.
|
||||||
:param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX).
|
:param embedded_color: Whether to use font embedded color glyphs (COLR, CBDT, SBIX).
|
||||||
|
:param font_size: If ``font`` is not provided, then the size to use for the default
|
||||||
|
font.
|
||||||
|
Keyword-only argument.
|
||||||
|
|
||||||
|
.. versionadded:: 10.1.0
|
||||||
|
|
||||||
:return: ``(left, top, right, bottom)`` bounding box
|
:return: ``(left, top, right, bottom)`` bounding box
|
||||||
|
|
||||||
.. py:method:: getdraw(im=None, hints=None)
|
.. py:method:: getdraw(im=None, hints=None)
|
||||||
|
|
|
@ -12,14 +12,11 @@ only work on L and RGB images.
|
||||||
|
|
||||||
.. autofunction:: autocontrast
|
.. autofunction:: autocontrast
|
||||||
.. autofunction:: colorize
|
.. autofunction:: colorize
|
||||||
.. autofunction:: contain
|
|
||||||
.. autofunction:: pad
|
|
||||||
.. autofunction:: crop
|
.. autofunction:: crop
|
||||||
.. autofunction:: scale
|
.. autofunction:: scale
|
||||||
.. autofunction:: deform
|
.. autofunction:: deform
|
||||||
.. autofunction:: equalize
|
.. autofunction:: equalize
|
||||||
.. autofunction:: expand
|
.. autofunction:: expand
|
||||||
.. autofunction:: fit
|
|
||||||
.. autofunction:: flip
|
.. autofunction:: flip
|
||||||
.. autofunction:: grayscale
|
.. autofunction:: grayscale
|
||||||
.. autofunction:: invert
|
.. autofunction:: invert
|
||||||
|
@ -27,3 +24,38 @@ only work on L and RGB images.
|
||||||
.. autofunction:: posterize
|
.. autofunction:: posterize
|
||||||
.. autofunction:: solarize
|
.. autofunction:: solarize
|
||||||
.. autofunction:: exif_transpose
|
.. autofunction:: exif_transpose
|
||||||
|
|
||||||
|
.. _relative-resize:
|
||||||
|
|
||||||
|
Resize relative to a given size
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
::
|
||||||
|
|
||||||
|
from PIL import Image, ImageOps
|
||||||
|
size = (100, 150)
|
||||||
|
with Image.open("Tests/images/hopper.png") as im:
|
||||||
|
ImageOps.contain(im, size).save("imageops_contain.png")
|
||||||
|
ImageOps.cover(im, size).save("imageops_cover.png")
|
||||||
|
ImageOps.fit(im, size).save("imageops_fit.png")
|
||||||
|
ImageOps.pad(im, size, color="#f00").save("imageops_pad.png")
|
||||||
|
|
||||||
|
# thumbnail() can also be used,
|
||||||
|
# but will modify the image object in place
|
||||||
|
im.thumbnail(size)
|
||||||
|
im.save("imageops_thumbnail.png")
|
||||||
|
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
| | :py:meth:`~PIL.Image.Image.thumbnail` | :py:meth:`~PIL.ImageOps.contain` | :py:meth:`~PIL.ImageOps.cover` | :py:meth:`~PIL.ImageOps.fit` | :py:meth:`~PIL.ImageOps.pad` |
|
||||||
|
+================+===========================================+============================================+==========================================+========================================+========================================+
|
||||||
|
|Given size | ``(100, 150)`` | ``(100, 150)`` | ``(100, 150)`` | ``(100, 150)`` | ``(100, 150)`` |
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
|Resulting image | .. image:: ../example/image_thumbnail.png | .. image:: ../example/imageops_contain.png | .. image:: ../example/imageops_cover.png | .. image:: ../example/imageops_fit.png | .. image:: ../example/imageops_pad.png |
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
|Resulting size | ``100×100`` | ``100×100`` | ``150×150`` | ``100×150`` | ``100×150`` |
|
||||||
|
+----------------+-------------------------------------------+--------------------------------------------+------------------------------------------+----------------------------------------+----------------------------------------+
|
||||||
|
|
||||||
|
.. autofunction:: contain
|
||||||
|
.. autofunction:: cover
|
||||||
|
.. autofunction:: fit
|
||||||
|
.. autofunction:: pad
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
10.1.0
|
10.1.0
|
||||||
------
|
------
|
||||||
|
|
||||||
Backwards Incompatible Changes
|
API Changes
|
||||||
==============================
|
===========
|
||||||
|
|
||||||
Setting image mode
|
Setting image mode
|
||||||
^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -13,9 +13,6 @@ not about removing existing functionality, but instead about raising an
|
||||||
explicit error to prevent later consequences. The ``convert`` method is the
|
explicit error to prevent later consequences. The ``convert`` method is the
|
||||||
correct way to change an image's mode.
|
correct way to change an image's mode.
|
||||||
|
|
||||||
API Changes
|
|
||||||
===========
|
|
||||||
|
|
||||||
Accept a list in getpixel()
|
Accept a list in getpixel()
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
@ -60,9 +57,45 @@ channel, a palette with an alpha channel, or a "transparency" key in the
|
||||||
Even if this attribute is true, the image might still appear solid, if all of
|
Even if this attribute is true, the image might still appear solid, if all of
|
||||||
the values shown within are opaque.
|
the values shown within are opaque.
|
||||||
|
|
||||||
|
ImageOps.cover
|
||||||
|
^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
Returns a resized version of the image, so that the requested size is covered,
|
||||||
|
while maintaining the original aspect ratio.
|
||||||
|
|
||||||
|
See :ref:`relative-resize` for a comparison between this and similar ``ImageOps``
|
||||||
|
methods.
|
||||||
|
|
||||||
|
size and font_size arguments when using default font
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
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
|
||||||
|
`Aileron Regular <https://dotcolon.net/font/aileron>`_ is loaded, which can be
|
||||||
|
drawn at chosen font sizes.
|
||||||
|
|
||||||
|
The following ``size`` and ``font_size`` arguments can now be used to specify a
|
||||||
|
font size for this new builtin font::
|
||||||
|
|
||||||
|
ImageFont.load_default(size=24)
|
||||||
|
draw.text((0, 0), "test", font_size=24)
|
||||||
|
draw.textlength((0, 0), "test", font_size=24)
|
||||||
|
draw.textbbox((0, 0), "test", font_size=24)
|
||||||
|
draw.multiline_text((0, 0), "test", font_size=24)
|
||||||
|
draw.multiline_textbbox((0, 0), "test", font_size=24)
|
||||||
|
|
||||||
Other Changes
|
Other Changes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
Python 3.12
|
||||||
|
^^^^^^^^^^^
|
||||||
|
|
||||||
|
Pillow 10.0.0 had wheels built against Python 3.12 beta, available as a preview to help
|
||||||
|
others prepare for 3.12, and to ensure Pillow could be used immediately at the release
|
||||||
|
of 3.12.0 final (2023-10-02, :pep:`693`).
|
||||||
|
|
||||||
|
Pillow 10.1.0 now officially supports Python 3.12.
|
||||||
|
|
||||||
Added support for DDS BC5U and 8-bit color indexed images
|
Added support for DDS BC5U and 8-bit color indexed images
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
|
|
@ -3764,6 +3764,7 @@ class Exif(MutableMapping):
|
||||||
self.endian = self._info._endian
|
self.endian = self._info._endian
|
||||||
if offset is None:
|
if offset is None:
|
||||||
offset = self._info.next
|
offset = self._info.next
|
||||||
|
self.fp.tell()
|
||||||
self.fp.seek(offset)
|
self.fp.seek(offset)
|
||||||
self._info.load(self.fp)
|
self._info.load(self.fp)
|
||||||
|
|
||||||
|
|
|
@ -113,6 +113,15 @@ class ImageDraw:
|
||||||
self.font = ImageFont.load_default()
|
self.font = ImageFont.load_default()
|
||||||
return self.font
|
return self.font
|
||||||
|
|
||||||
|
def _getfont(self, font_size):
|
||||||
|
if font_size is not None:
|
||||||
|
from . import ImageFont
|
||||||
|
|
||||||
|
font = ImageFont.load_default(font_size)
|
||||||
|
else:
|
||||||
|
font = self.getfont()
|
||||||
|
return font
|
||||||
|
|
||||||
def _getink(self, ink, fill=None):
|
def _getink(self, ink, fill=None):
|
||||||
if ink is None and fill is None:
|
if ink is None and fill is None:
|
||||||
if self.fill:
|
if self.fill:
|
||||||
|
@ -456,6 +465,13 @@ class ImageDraw:
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
"""Draw text."""
|
"""Draw text."""
|
||||||
|
if embedded_color and self.mode not in ("RGB", "RGBA"):
|
||||||
|
msg = "Embedded color supported only in RGB and RGBA modes"
|
||||||
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
if font is None:
|
||||||
|
font = self._getfont(kwargs.get("font_size"))
|
||||||
|
|
||||||
if self._multiline_check(text):
|
if self._multiline_check(text):
|
||||||
return self.multiline_text(
|
return self.multiline_text(
|
||||||
xy,
|
xy,
|
||||||
|
@ -473,13 +489,6 @@ class ImageDraw:
|
||||||
embedded_color,
|
embedded_color,
|
||||||
)
|
)
|
||||||
|
|
||||||
if embedded_color and self.mode not in ("RGB", "RGBA"):
|
|
||||||
msg = "Embedded color supported only in RGB and RGBA modes"
|
|
||||||
raise ValueError(msg)
|
|
||||||
|
|
||||||
if font is None:
|
|
||||||
font = self.getfont()
|
|
||||||
|
|
||||||
def getink(fill):
|
def getink(fill):
|
||||||
ink, fill = self._getink(fill)
|
ink, fill = self._getink(fill)
|
||||||
if ink is None:
|
if ink is None:
|
||||||
|
@ -570,6 +579,8 @@ class ImageDraw:
|
||||||
stroke_width=0,
|
stroke_width=0,
|
||||||
stroke_fill=None,
|
stroke_fill=None,
|
||||||
embedded_color=False,
|
embedded_color=False,
|
||||||
|
*,
|
||||||
|
font_size=None,
|
||||||
):
|
):
|
||||||
if direction == "ttb":
|
if direction == "ttb":
|
||||||
msg = "ttb direction is unsupported for multiline text"
|
msg = "ttb direction is unsupported for multiline text"
|
||||||
|
@ -584,6 +595,9 @@ class ImageDraw:
|
||||||
msg = "anchor not supported for multiline text"
|
msg = "anchor not supported for multiline text"
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
if font is None:
|
||||||
|
font = self._getfont(font_size)
|
||||||
|
|
||||||
widths = []
|
widths = []
|
||||||
max_width = 0
|
max_width = 0
|
||||||
lines = self._multiline_split(text)
|
lines = self._multiline_split(text)
|
||||||
|
@ -645,6 +659,8 @@ class ImageDraw:
|
||||||
features=None,
|
features=None,
|
||||||
language=None,
|
language=None,
|
||||||
embedded_color=False,
|
embedded_color=False,
|
||||||
|
*,
|
||||||
|
font_size=None,
|
||||||
):
|
):
|
||||||
"""Get the length of a given string, in pixels with 1/64 precision."""
|
"""Get the length of a given string, in pixels with 1/64 precision."""
|
||||||
if self._multiline_check(text):
|
if self._multiline_check(text):
|
||||||
|
@ -655,7 +671,7 @@ class ImageDraw:
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
|
|
||||||
if font is None:
|
if font is None:
|
||||||
font = self.getfont()
|
font = self._getfont(font_size)
|
||||||
mode = "RGBA" if embedded_color else self.fontmode
|
mode = "RGBA" if embedded_color else self.fontmode
|
||||||
return font.getlength(text, mode, direction, features, language)
|
return font.getlength(text, mode, direction, features, language)
|
||||||
|
|
||||||
|
@ -672,12 +688,17 @@ class ImageDraw:
|
||||||
language=None,
|
language=None,
|
||||||
stroke_width=0,
|
stroke_width=0,
|
||||||
embedded_color=False,
|
embedded_color=False,
|
||||||
|
*,
|
||||||
|
font_size=None,
|
||||||
):
|
):
|
||||||
"""Get the bounding box of a given string, in pixels."""
|
"""Get the bounding box of a given string, in pixels."""
|
||||||
if embedded_color and self.mode not in ("RGB", "RGBA"):
|
if embedded_color and self.mode not in ("RGB", "RGBA"):
|
||||||
msg = "Embedded color supported only in RGB and RGBA modes"
|
msg = "Embedded color supported only in RGB and RGBA modes"
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
if font is None:
|
||||||
|
font = self._getfont(font_size)
|
||||||
|
|
||||||
if self._multiline_check(text):
|
if self._multiline_check(text):
|
||||||
return self.multiline_textbbox(
|
return self.multiline_textbbox(
|
||||||
xy,
|
xy,
|
||||||
|
@ -693,8 +714,6 @@ class ImageDraw:
|
||||||
embedded_color,
|
embedded_color,
|
||||||
)
|
)
|
||||||
|
|
||||||
if font is None:
|
|
||||||
font = self.getfont()
|
|
||||||
mode = "RGBA" if embedded_color else self.fontmode
|
mode = "RGBA" if embedded_color else self.fontmode
|
||||||
bbox = font.getbbox(
|
bbox = font.getbbox(
|
||||||
text, mode, direction, features, language, stroke_width, anchor
|
text, mode, direction, features, language, stroke_width, anchor
|
||||||
|
@ -714,6 +733,8 @@ class ImageDraw:
|
||||||
language=None,
|
language=None,
|
||||||
stroke_width=0,
|
stroke_width=0,
|
||||||
embedded_color=False,
|
embedded_color=False,
|
||||||
|
*,
|
||||||
|
font_size=None,
|
||||||
):
|
):
|
||||||
if direction == "ttb":
|
if direction == "ttb":
|
||||||
msg = "ttb direction is unsupported for multiline text"
|
msg = "ttb direction is unsupported for multiline text"
|
||||||
|
@ -728,6 +749,9 @@ class ImageDraw:
|
||||||
msg = "anchor not supported for multiline text"
|
msg = "anchor not supported for multiline text"
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
|
|
||||||
|
if font is None:
|
||||||
|
font = self._getfont(font_size)
|
||||||
|
|
||||||
widths = []
|
widths = []
|
||||||
max_width = 0
|
max_width = 0
|
||||||
lines = self._multiline_split(text)
|
lines = self._multiline_split(text)
|
||||||
|
|
|
@ -861,13 +861,252 @@ def load_path(filename):
|
||||||
raise OSError(msg)
|
raise OSError(msg)
|
||||||
|
|
||||||
|
|
||||||
def load_default():
|
def load_default(size=None):
|
||||||
"""Load a "better than nothing" default font.
|
"""If FreeType support is available, load a version of Aileron Regular,
|
||||||
|
https://dotcolon.net/font/aileron, with a more limited character set.
|
||||||
|
|
||||||
|
Otherwise, load a "better than nothing" font.
|
||||||
|
|
||||||
.. versionadded:: 1.1.4
|
.. versionadded:: 1.1.4
|
||||||
|
|
||||||
|
:param size: The font size of Aileron Regular.
|
||||||
|
|
||||||
|
.. versionadded:: 10.1.0
|
||||||
|
|
||||||
:return: A font object.
|
:return: A font object.
|
||||||
"""
|
"""
|
||||||
|
if core.__class__.__name__ == "module" or size is not None:
|
||||||
|
f = truetype(
|
||||||
|
BytesIO(
|
||||||
|
base64.b64decode(
|
||||||
|
b"""
|
||||||
|
AAEAAAAPAIAAAwBwRkZUTYwDlUAAADFoAAAAHEdERUYAqADnAAAo8AAAACRHUE9ThhmITwAAKfgAA
|
||||||
|
AduR1NVQnHxefoAACkUAAAA4k9TLzJovoHLAAABeAAAAGBjbWFw5lFQMQAAA6gAAAGqZ2FzcP//AA
|
||||||
|
MAACjoAAAACGdseWYmRXoPAAAGQAAAHfhoZWFkE18ayQAAAPwAAAA2aGhlYQboArEAAAE0AAAAJGh
|
||||||
|
tdHjjERZ8AAAB2AAAAdBsb2NhuOexrgAABVQAAADqbWF4cAC7AEYAAAFYAAAAIG5hbWUr+h5lAAAk
|
||||||
|
OAAAA6Jwb3N0D3oPTQAAJ9wAAAEKAAEAAAABGhxJDqIhXw889QALA+gAAAAA0Bqf2QAAAADhCh2h/
|
||||||
|
2r/LgOxAyAAAAAIAAIAAAAAAAAAAQAAA8r/GgAAA7j/av9qA7EAAQAAAAAAAAAAAAAAAAAAAHQAAQ
|
||||||
|
AAAHQAQwAFAAAAAAACAAAAAQABAAAAQAAAAAAAAAADAfoBkAAFAAgCigJYAAAASwKKAlgAAAFeADI
|
||||||
|
BPgAAAAAFAAAAAAAAAAAAAAcAAAAAAAAAAAAAAABVS1dOAEAAIPsCAwL/GgDIA8oA5iAAAJMAAAAA
|
||||||
|
AhICsgAAACAAAwH0AAAAAAAAAU0AAADYAAAA8gA5AVMAVgJEAEYCRAA1AuQAKQKOAEAAsAArATsAZ
|
||||||
|
AE7AB4CMABVAkQAUADc/+EBEgAgANwAJQEv//sCRAApAkQAggJEADwCRAAtAkQAIQJEADkCRAArAk
|
||||||
|
QAMgJEACwCRAAxANwAJQDc/+ECRABnAkQAUAJEAEQB8wAjA1QANgJ/AB0CcwBkArsALwLFAGQCSwB
|
||||||
|
kAjcAZALGAC8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|
sCAagoKpqN/gaOmCgplhcicn8sAAAIAZAAAAp8CsgAMABkAAAEeARUUBgcGKwERMzITPgE1NCYnJi
|
||||||
|
sBETMyAY59lJp8IzXN0jUVWmdjWRs5d3I4Aq4QqJWUug8EArL9mQ+PeHGHDgX92gAAAAABAGQAAAI
|
||||||
|
vArIACwAAJRUhESEVIRUhFSEVAi/+NQHB/pUBTf6zRkYCskbwRvAAAAABAGQAAAIlArIACQAAExUh
|
||||||
|
FSERIxEhFboBQ/69VgHBAmzwRv7KArJGAAAAAAEAL//yAo8CwAAfAAABMxEjNQcGIyImNTQ2MzIWH
|
||||||
|
wEjJyYjIgYVFBYzMjY1IwGP90wfPnWTprSSf48LAVYCIqJofHllVG+hAU3+s3hARsicn8uAagoKpq
|
||||||
|
N/gaN1XAAAAAEAZAAAAowCsgALAAABESMRIREjETMRIRECjFb+hFZWAXwCsv1OAS7+0gKy/sQBPAA
|
||||||
|
AAAABAGQAAAC6ArIAAwAAMyMRM7pWVgKyAAABADf/8gHoArIAEwAAAREUBw4BIyImLwEzFxYzMjc2
|
||||||
|
NREB6AIFcGpgbQIBVgIHfXQKAQKy/lYxIltob2EpKYyEFD0BpwAAAAABAGQAAAJ0ArIACwAACQEjA
|
||||||
|
wcVIxEzEQEzATsBJ3ntQlZWAVVlAWH+nwEnR+ACsv6RAW8AAQBkAAACLwKyAAUAACUVIREzEQIv/j
|
||||||
|
VWRkYCsv2UAAABAGQAAAMUArIAFAAAAREjETQ3BgcDIwMmJxYVESMRMxsBAxRWAiMxemx8NxsCVo7
|
||||||
|
MywKy/U4BY7ZLco7+nAFmoFxLtP6dArL9lwJpAAAAAAEAZAAAAoACsgANAAAhIwEWFREjETMBJjUR
|
||||||
|
MwKAhP67A1aEAUUDVAJeeov+pwKy/aJ5jAFZAAAAAgAv//ICuwLAAAkAEwAAEiAWFRQGICY1NBIyN
|
||||||
|
jU0JiIGFRTbATSsrP7MrNrYenrYegLAxaKhxsahov47nIeIm5uIhwACAGQAAAJHAr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gAAQAAAAAAA
|
||||||
|
QAHAEwAAQAAAAAAAgAHAGQAAQAAAAAAAwAaAKIAAQAAAAAABAAHAM0AAQAAAAAABQA8AU8AAQAAAA
|
||||||
|
AABgAPAawAAQAAAAAACAALAdQAAQAAAAAACQALAfgAAQAAAAAACwAXAjQAAQAAAAAADAAXAnwAAwA
|
||||||
|
BBAkAAAAmAAAAAwABBAkAAQAOADwAAwABBAkAAgAOAFQAAwABBAkAAwA0AGwAAwABBAkABAAOAL0A
|
||||||
|
AwABBAkABQB4ANUAAwABBAkABgAeAYwAAwABBAkACAAWAbwAAwABBAkACQAWAeAAAwABBAkACwAuA
|
||||||
|
gQAAwABBAkADAAuAkwATgBvACAAUgBpAGcAaAB0AHMAIABSAGUAcwBlAHIAdgBlAGQALgAATm8gUm
|
||||||
|
lnaHRzIFJlc2VydmVkLgAAQQBpAGwAZQByAG8AbgAAQWlsZXJvbgAAUgBlAGcAdQBsAGEAcgAAUmV
|
||||||
|
ndWxhcgAAMQAuADEAMAAyADsAVQBLAFcATgA7AEEAaQBsAGUAcgBvAG4ALQBSAGUAZwB1AGwAYQBy
|
||||||
|
AAAxLjEwMjtVS1dOO0FpbGVyb24tUmVndWxhcgAAQQBpAGwAZQByAG8AbgAAQWlsZXJvbgAAVgBlA
|
||||||
|
HIAcwBpAG8AbgAgADEALgAxADAAMgA7AFAAUwAgADAAMAAxAC4AMQAwADIAOwBoAG8AdABjAG8Abg
|
||||||
|
B2ACAAMQAuADAALgA3ADAAOwBtAGEAawBlAG8AdABmAC4AbABpAGIAMgAuADUALgA1ADgAMwAyADk
|
||||||
|
AAFZlcnNpb24gMS4xMDI7UFMgMDAxLjEwMjtob3Rjb252IDEuMC43MDttYWtlb3RmLmxpYjIuNS41
|
||||||
|
ODMyOQAAQQBpAGwAZQByAG8AbgAtAFIAZQBnAHUAbABhAHIAAEFpbGVyb24tUmVndWxhcgAAUwBvA
|
||||||
|
HIAYQAgAFMAYQBnAGEAbgBvAABTb3JhIFNhZ2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AAAAAAAAP/8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/6AAAAAAAAAA
|
||||||
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAkAFAAEAAAAAQACwAAABcA
|
||||||
|
BgAAAAAAAAAIAA4AAAAAAAsAEgAAAAAAAAATABkAAwANAAAAAQAJAAAAAAAAAAAAAAAAAAAAGAAAA
|
||||||
|
AAABwAAAAAAAAAAAAAAFQAFAAAAAAAYABgAAAAUAAAACgAAAAwAAgAPABEAFgAAAAAAAAAAAAAAAA
|
||||||
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAEAEQBdAAYAAAAAAAAAAAAAAAAAAAAAAAA
|
||||||
|
AAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAcAAAAAAAAABwAAAAAACAAAAAAAAAAAAAcAAAAHAAAAEwAJ
|
||||||
|
ABUADgAPAAAACwAQAAAAAAAAAAAAAAAAAAUAGAACAAIAAgAAAAIAGAAXAAAAGAAAABYAFgACABYAA
|
||||||
|
gAWAAAAEQADAAoAFAAMAA0ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAEgAGAAEAHgAkAC
|
||||||
|
YAJwApACoALQAuAC8AMgAzADcAOAA5ADoAPAA9AEUASABOAE8AUgBTAFUAVwBZAFoAWwBcAF0AcwA
|
||||||
|
AAAAAAQAAAADa3tfFAAAAANAan9kAAAAA4QodoQ==
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
),
|
||||||
|
10 if size is None else size,
|
||||||
|
layout_engine=Layout.BASIC,
|
||||||
|
)
|
||||||
|
else:
|
||||||
f = ImageFont()
|
f = ImageFont()
|
||||||
f._load_pilfont_data(
|
f._load_pilfont_data(
|
||||||
# courB08
|
# courB08
|
||||||
|
|
|
@ -242,7 +242,7 @@ def contain(image, size, method=Image.Resampling.BICUBIC):
|
||||||
Returns a resized version of the image, set to the maximum width and height
|
Returns a resized version of the image, set to the maximum width and height
|
||||||
within the requested size, while maintaining the original aspect ratio.
|
within the requested size, while maintaining the original aspect ratio.
|
||||||
|
|
||||||
:param image: The image to resize and crop.
|
:param image: The image to resize.
|
||||||
:param size: The requested output size in pixels, given as a
|
:param size: The requested output size in pixels, given as a
|
||||||
(width, height) tuple.
|
(width, height) tuple.
|
||||||
:param method: Resampling method to use. Default is
|
:param method: Resampling method to use. Default is
|
||||||
|
@ -266,6 +266,35 @@ def contain(image, size, method=Image.Resampling.BICUBIC):
|
||||||
return image.resize(size, resample=method)
|
return image.resize(size, resample=method)
|
||||||
|
|
||||||
|
|
||||||
|
def cover(image, size, method=Image.Resampling.BICUBIC):
|
||||||
|
"""
|
||||||
|
Returns a resized version of the image, so that the requested size is
|
||||||
|
covered, while maintaining the original aspect ratio.
|
||||||
|
|
||||||
|
:param image: The image to resize.
|
||||||
|
:param size: The requested output size in pixels, given as a
|
||||||
|
(width, height) tuple.
|
||||||
|
:param method: Resampling method to use. Default is
|
||||||
|
:py:attr:`~PIL.Image.Resampling.BICUBIC`.
|
||||||
|
See :ref:`concept-filters`.
|
||||||
|
:return: An image.
|
||||||
|
"""
|
||||||
|
|
||||||
|
im_ratio = image.width / image.height
|
||||||
|
dest_ratio = size[0] / size[1]
|
||||||
|
|
||||||
|
if im_ratio != dest_ratio:
|
||||||
|
if im_ratio < dest_ratio:
|
||||||
|
new_height = round(image.height / image.width * size[0])
|
||||||
|
if new_height != size[1]:
|
||||||
|
size = (size[0], new_height)
|
||||||
|
else:
|
||||||
|
new_width = round(image.width / image.height * size[1])
|
||||||
|
if new_width != size[0]:
|
||||||
|
size = (new_width, size[1])
|
||||||
|
return image.resize(size, resample=method)
|
||||||
|
|
||||||
|
|
||||||
def pad(image, size, method=Image.Resampling.BICUBIC, color=None, centering=(0.5, 0.5)):
|
def pad(image, size, method=Image.Resampling.BICUBIC, color=None, centering=(0.5, 0.5)):
|
||||||
"""
|
"""
|
||||||
Returns a resized and padded version of the image, expanded to fill the
|
Returns a resized and padded version of the image, expanded to fill the
|
||||||
|
|
|
@ -170,11 +170,19 @@ def APP(self, marker):
|
||||||
# 1 dpcm = 2.54 dpi
|
# 1 dpcm = 2.54 dpi
|
||||||
dpi *= 2.54
|
dpi *= 2.54
|
||||||
self.info["dpi"] = dpi, dpi
|
self.info["dpi"] = dpi, dpi
|
||||||
except (TypeError, KeyError, SyntaxError, ValueError, ZeroDivisionError):
|
except (
|
||||||
# SyntaxError for invalid/unreadable EXIF
|
struct.error,
|
||||||
|
KeyError,
|
||||||
|
SyntaxError,
|
||||||
|
TypeError,
|
||||||
|
ValueError,
|
||||||
|
ZeroDivisionError,
|
||||||
|
):
|
||||||
|
# struct.error for truncated EXIF
|
||||||
# KeyError for dpi not included
|
# KeyError for dpi not included
|
||||||
# ZeroDivisionError for invalid dpi rational value
|
# SyntaxError for invalid/unreadable EXIF
|
||||||
# ValueError or TypeError for dpi being an invalid float
|
# ValueError or TypeError for dpi being an invalid float
|
||||||
|
# ZeroDivisionError for invalid dpi rational value
|
||||||
self.info["dpi"] = 72, 72
|
self.info["dpi"] = 72, 72
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1104,9 +1104,6 @@ def _write_multiple_frames(im, fp, chunk, rawmode, default_image, append_images)
|
||||||
for im_frame in ImageSequence.Iterator(im_seq):
|
for im_frame in ImageSequence.Iterator(im_seq):
|
||||||
if im_frame.mode == rawmode:
|
if im_frame.mode == rawmode:
|
||||||
im_frame = im_frame.copy()
|
im_frame = im_frame.copy()
|
||||||
else:
|
|
||||||
if rawmode == "P":
|
|
||||||
im_frame = im_frame.convert(rawmode, palette=im.palette)
|
|
||||||
else:
|
else:
|
||||||
im_frame = im_frame.convert(rawmode)
|
im_frame = im_frame.convert(rawmode)
|
||||||
encoderinfo = im.encoderinfo.copy()
|
encoderinfo = im.encoderinfo.copy()
|
||||||
|
@ -1167,6 +1164,8 @@ def _write_multiple_frames(im, fp, chunk, rawmode, default_image, append_images)
|
||||||
|
|
||||||
# default image IDAT (if it exists)
|
# default image IDAT (if it exists)
|
||||||
if default_image:
|
if default_image:
|
||||||
|
if im.mode != rawmode:
|
||||||
|
im = im.convert(rawmode)
|
||||||
ImageFile._save(im, _idat(fp, chunk), [("zip", (0, 0) + im.size, 0, rawmode)])
|
ImageFile._save(im, _idat(fp, chunk), [("zip", (0, 0) + im.size, 0, rawmode)])
|
||||||
|
|
||||||
seq_num = 0
|
seq_num = 0
|
||||||
|
@ -1228,11 +1227,7 @@ def _save(im, fp, filename, chunk=putchunk, save_all=False):
|
||||||
)
|
)
|
||||||
modes = set()
|
modes = set()
|
||||||
append_images = im.encoderinfo.get("append_images", [])
|
append_images = im.encoderinfo.get("append_images", [])
|
||||||
if default_image:
|
for im_seq in itertools.chain([im], append_images):
|
||||||
chain = itertools.chain(append_images)
|
|
||||||
else:
|
|
||||||
chain = itertools.chain([im], append_images)
|
|
||||||
for im_seq in chain:
|
|
||||||
for im_frame in ImageSequence.Iterator(im_seq):
|
for im_frame in ImageSequence.Iterator(im_seq):
|
||||||
modes.add(im_frame.mode)
|
modes.add(im_frame.mode)
|
||||||
for mode in ("RGBA", "RGB", "P"):
|
for mode in ("RGBA", "RGB", "P"):
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# Master version for Pillow
|
# Master version for Pillow
|
||||||
__version__ = "10.1.0.dev0"
|
__version__ = "10.2.0.dev0"
|
||||||
|
|
|
@ -1575,7 +1575,7 @@ if (PySequence_Check(op)) { \
|
||||||
}
|
}
|
||||||
double value;
|
double value;
|
||||||
if (image->bands == 1) {
|
if (image->bands == 1) {
|
||||||
int bigendian;
|
int bigendian = 0;
|
||||||
if (image->type == IMAGING_TYPE_SPECIAL) {
|
if (image->type == IMAGING_TYPE_SPECIAL) {
|
||||||
// I;16*
|
// I;16*
|
||||||
bigendian = strcmp(image->mode, "I;16B") == 0;
|
bigendian = strcmp(image->mode, "I;16B") == 0;
|
||||||
|
|