Commit 59802fa1 authored by surgan12's avatar surgan12 Committed by Francisco Massa
Browse files

docs added 2 channel Mode (#692)

* docs added

* Update transforms.py

* Update transforms.py
parent be6f6c29
...@@ -97,10 +97,11 @@ class ToPILImage(object): ...@@ -97,10 +97,11 @@ class ToPILImage(object):
Args: Args:
mode (`PIL.Image mode`_): color space and pixel depth of input data (optional). mode (`PIL.Image mode`_): color space and pixel depth of input data (optional).
If ``mode`` is ``None`` (default) there are some assumptions made about the input data: If ``mode`` is ``None`` (default) there are some assumptions made about the input data:
1. If the input has 3 channels, the ``mode`` is assumed to be ``RGB``. - If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``.
2. If the input has 4 channels, the ``mode`` is assumed to be ``RGBA``. - If the input has 3 channels, the ``mode`` is assumed to be ``RGB``.
3. If the input has 1 channel, the ``mode`` is determined by the data type (i,e, - If the input has 2 channels, the ``mode`` is assumed to be ``LA``.
``int``, ``float``, ``short``). - If the input has 1 channel, the ``mode`` is determined by the data type (i.e ``int``, ``float``,
``short``).
.. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes .. _PIL.Image mode: https://pillow.readthedocs.io/en/latest/handbook/concepts.html#concept-modes
""" """
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment