Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ To run the test suite:
* extract the :file:`lib/matplotlib/tests` or :file:`lib/mpl_toolkits/tests`
directories from the source distribution;
* install test dependencies: `pytest <https://pypi.org/project/pytest>`_,
Pillow, MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and `Inkscape
MiKTeX, GhostScript, ffmpeg, avconv, ImageMagick, and `Inkscape
<https://inkscape.org/>`_;
* run ``python -mpytest``.

Expand Down Expand Up @@ -126,6 +126,7 @@ Matplotlib requires the following dependencies:
* `cycler <http://matplotlib.org/cycler/>`_ (>= 0.10.0)
* `dateutil <https://pypi.org/project/python-dateutil>`_ (>= 2.1)
* `kiwisolver <https://github.com/nucleic/kiwi>`_ (>= 1.0.0)
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 6.2)
* `pyparsing <https://pyparsing.wikispaces.com/>`_

Optionally, you can also install a number of packages to enable better user
Expand Down Expand Up @@ -160,8 +161,6 @@ etc., you can install the following:
<https://libav.org/avconv.html>`_: for saving movies;
* `ImageMagick <https://www.imagemagick.org/script/index.php>`_: for saving
animated gifs;
* `Pillow <https://pillow.readthedocs.io/en/latest/>`_ (>= 3.4): for a larger
selection of image file formats: JPEG, BMP, and TIFF image files;
* `LaTeX <https://miktex.org/>`_ and `GhostScript (>=9.0)
<https://ghostscript.com/download/>`_ : for rendering text with LaTeX.

Expand Down
4 changes: 1 addition & 3 deletions lib/matplotlib/figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -2143,9 +2143,7 @@ def savefig(self, fname, *, transparent=None, **kwargs):

pil_kwargs : dict, optional
Additional keyword arguments that are passed to `PIL.Image.save`
when saving the figure. Only applicable for formats that are saved
using Pillow, i.e. JPEG, TIFF, and (if the keyword is set to a
non-None value) PNG.
when saving the figure.
"""

kwargs.setdefault('dpi', rcParams['savefig.dpi'])
Expand Down
5 changes: 3 additions & 2 deletions lib/matplotlib/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -1629,8 +1629,9 @@ def thumbnail(infile, thumbfile, scale=0.1, interpolation='bilinear',
Parameters
----------
infile : str or file-like
The image file -- must be PNG, or Pillow-readable if you have Pillow_
installed.
The image file. Matplotlib relies on Pillow_ for image reading, and
thus supports a wide range of file formats, including PNG, JPG, TIFF
and others.

.. _Pillow: http://python-pillow.org/

Expand Down
8 changes: 2 additions & 6 deletions lib/matplotlib/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,8 @@ def test_imshow_zoom(fig_test, fig_ref):
def test_imshow_pil(fig_test, fig_ref):
style.use("default")
PIL = pytest.importorskip("PIL")
Comment thread
QuLogic marked this conversation as resolved.
Outdated
# Pillow<=6.0 fails to open pathlib.Paths on Windows (pillow#3823), and
# Matplotlib's builtin png opener doesn't handle them either.
png_path = str(
Path(__file__).parent / "baseline_images/pngsuite/basn3p04.png")
tiff_path = str(
Path(__file__).parent / "baseline_images/test_image/uint16.tif")
png_path = Path(__file__).parent / "baseline_images/pngsuite/basn3p04.png"
tiff_path = Path(__file__).parent / "baseline_images/test_image/uint16.tif"
axs = fig_test.subplots(2)
axs[0].imshow(PIL.Image.open(png_path))
axs[1].imshow(PIL.Image.open(tiff_path))
Expand Down