Skip to content

Commit

Permalink
Document mct and no_jp2 options for saving JPEG 2000
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Mar 31, 2022
1 parent 698f529 commit e0de5b6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/handbook/image-file-formats.rst
Expand Up @@ -513,6 +513,8 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options:
Reversible Color Transformation. MCT works best with a ``mode`` of
``RGB`` and is only applicable when the image data has 3 components.

.. versionadded:: 9.1.0

**progression**
Controls the progression order; must be one of ``"LRCP"``, ``"RLCP"``,
``"RPCL"``, ``"PCRL"``, ``"CPRL"``. The letters stand for Component,
Expand All @@ -536,6 +538,8 @@ The :py:meth:`~PIL.Image.Image.save` method supports the following options:
saving, otherwise the extension of the filename will be used to determine
the format (default).

.. versionadded:: 9.1.0

.. note::

To enable JPEG 2000 support, you need to build and install the OpenJPEG
Expand Down
24 changes: 18 additions & 6 deletions docs/releasenotes/9.1.0.rst
Expand Up @@ -146,12 +146,24 @@ At present, the information within each block is merely returned as a dictionary
"data" entry. This will allow more useful information to be added in the future without
breaking backwards compatibility.

Added rawmode argument to Image.getpalette()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

By default, :py:meth:`~PIL.Image.Image.getpalette` returns RGB data from the palette.
A ``rawmode`` argument has been added, to allow the mode to be chosen instead. ``None``
can be used to return data in the current mode of the palette.
Added mct and no_jp2 options for saving JPEG 2000
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :py:meth:`PIL.Image.Image.save` method now supports the following options for
JPEG 2000:

**mct**
If ``1`` then enable multiple component transformation when encoding,
otherwise use ``0`` for no component transformation (default). If MCT is
enabled and ``irreversible`` is ``True`` then the Irreversible Color
Transformation will be applied, otherwise encoding will use the
Reversible Color Transformation. MCT works best with a ``mode`` of
``RGB`` and is only applicable when the image data has 3 components.

**no_jp2**
If ``True`` then don't wrap the raw codestream in the JP2 file format when
saving, otherwise the extension of the filename will be used to determine
the format (default).

Added PyEncoder
^^^^^^^^^^^^^^^
Expand Down

0 comments on commit e0de5b6

Please sign in to comment.