diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 96a4f6319..49e676a29 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -2851,6 +2851,11 @@ def open(fp, mode="r", formats=None): ``file.seek``, and ``file.tell`` methods, and be opened in binary mode. :param mode: The mode. If given, this argument must be "r". + :param formats: A list or tuple of formats to attempt to load the file in. + This can be used to restrict the set of formats checked. + Pass ``None`` to try all supported formats. You can print the set of + available formats by running ``python -m PIL`` or using + the :py:func:`PIL.features.pilinfo` function. :returns: An :py:class:`~PIL.Image.Image` object. :exception FileNotFoundError: If the file cannot be found. :exception PIL.UnidentifiedImageError: If the image cannot be opened and