Skip to content
Snippets Groups Projects
Commit 73de978a864b authored by Hugo van Kemenade's avatar Hugo van Kemenade
Browse files

Merge pull request #4735 from nulano/refs-type

No related branches found
No related tags found
No related merge requests found
......@@ -273,9 +273,10 @@
Instances of the :py:class:`Image` class have the following attributes:
.. py:attribute:: filename
.. py:attribute:: Image.filename
:type: str
The filename or path of the source file. Only images created with the
factory function ``open`` have a filename attribute. If the input is a
file like object, the filename attribute is set to an empty string.
......@@ -277,13 +278,12 @@
The filename or path of the source file. Only images created with the
factory function ``open`` have a filename attribute. If the input is a
file like object, the filename attribute is set to an empty string.
:type: :py:class:`string`
.. py:attribute:: format
.. py:attribute:: Image.format
:type: Optional[str]
The file format of the source file. For images created by the library
itself (via a factory function, or by running a method on an existing
image), this attribute is set to ``None``.
......@@ -285,13 +285,12 @@
The file format of the source file. For images created by the library
itself (via a factory function, or by running a method on an existing
image), this attribute is set to ``None``.
:type: :py:class:`string` or ``None``
.. py:attribute:: mode
.. py:attribute:: Image.mode
:type: str
Image mode. This is a string specifying the pixel format used by the image.
Typical values are “1”, “L”, “RGB”, or “CMYK.” See
:ref:`concept-modes` for a full list.
......@@ -293,11 +292,10 @@
Image mode. This is a string specifying the pixel format used by the image.
Typical values are “1”, “L”, “RGB”, or “CMYK.” See
:ref:`concept-modes` for a full list.
:type: :py:class:`string`
.. py:attribute:: size
.. py:attribute:: Image.size
:type: tuple[int]
Image size, in pixels. The size is given as a 2-tuple (width, height).
......@@ -301,9 +299,8 @@
Image size, in pixels. The size is given as a 2-tuple (width, height).
:type: ``(width, height)``
.. py:attribute:: width
.. py:attribute:: Image.width
:type: int
Image width, in pixels.
......@@ -307,9 +304,8 @@
Image width, in pixels.
:type: :py:class:`int`
.. py:attribute:: height
.. py:attribute:: Image.height
:type: int
Image height, in pixels.
......@@ -313,11 +309,10 @@
Image height, in pixels.
:type: :py:class:`int`
.. py:attribute:: palette
.. py:attribute:: Image.palette
:type: Optional[PIL.ImagePalette.ImagePalette]
Colour palette table, if any. If mode is "P" or "PA", this should be an
instance of the :py:class:`~PIL.ImagePalette.ImagePalette` class.
Otherwise, it should be set to ``None``.
......@@ -319,11 +314,10 @@
Colour palette table, if any. If mode is "P" or "PA", this should be an
instance of the :py:class:`~PIL.ImagePalette.ImagePalette` class.
Otherwise, it should be set to ``None``.
:type: :py:class:`~PIL.ImagePalette.ImagePalette` or ``None``
.. py:attribute:: info
.. py:attribute:: Image.info
:type: dict
A dictionary holding data associated with the image. This dictionary is
used by file handlers to pass on various non-image information read from
......@@ -335,5 +329,3 @@
keep a reference to the info dictionary returned from the open method.
Unless noted elsewhere, this dictionary does not affect saving files.
:type: :py:class:`dict`
This diff is collapsed.
......@@ -98,7 +98,8 @@
.. py:currentmodule:: None
.. py:function:: abs(image)
:noindex:
Absolute value.
.. py:function:: convert(image, mode)
......@@ -101,9 +102,10 @@
Absolute value.
.. py:function:: convert(image, mode)
:noindex:
Convert image to the given mode. The mode must be given as a string
constant.
.. py:function:: float(image)
......@@ -105,10 +107,11 @@
Convert image to the given mode. The mode must be given as a string
constant.
.. py:function:: float(image)
:noindex:
Convert image to 32-bit floating point. This is equivalent to
convert(image, “F”).
.. py:function:: int(image)
......@@ -110,8 +113,9 @@
Convert image to 32-bit floating point. This is equivalent to
convert(image, “F”).
.. py:function:: int(image)
:noindex:
Convert image to 32-bit integer. This is equivalent to convert(image, “I”).
......@@ -119,7 +123,8 @@
integers if necessary to get a correct result.
.. py:function:: max(image1, image2)
:noindex:
Maximum value.
.. py:function:: min(image1, image2)
......@@ -122,6 +127,7 @@
Maximum value.
.. py:function:: min(image1, image2)
:noindex:
Minimum value.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment