Skip to content

Commit 37d28ce

Browse files
authored
Merge pull request #6095 from radarhere/pyencoder
2 parents 2f2b48d + f2987d6 commit 37d28ce

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/releasenotes/9.1.0.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ By default, :py:meth:`~PIL.Image.Image.getpalette` returns RGB data from the pal
153153
A ``rawmode`` argument has been added, to allow the mode to be chosen instead. ``None``
154154
can be used to return data in the current mode of the palette.
155155

156+
Added PyEncoder
157+
^^^^^^^^^^^^^^^
158+
159+
:py:class:`~PIL.ImageFile.PyEncoder` has been added, allowing for file encoders to be
160+
written in Python. See :ref:`Writing Your Own File Codec in Python<file-codecs-py>` for
161+
more information.
162+
156163
Other Changes
157164
=============
158165

@@ -169,3 +176,10 @@ Image._repr_pretty_
169176
``im._repr_pretty_`` has been added to provide a representation of an image without the
170177
identity of the object. This allows Jupyter to describe an image and have that
171178
description stay the same on subsequent executions of the same code.
179+
180+
Added BLP saving
181+
^^^^^^^^^^^^^^^^
182+
183+
Support has been added for saving BLP images. ``blp_version`` can be used to specify
184+
whether the image should be saved as BLP1 or BLP2, e.g.
185+
``im.save("out.blp", blp_version="BLP1")``. By default, BLP2 will be used.

src/PIL/ImageFile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,8 @@ class PyEncoder(PyCodec):
702702
"""
703703
Python implementation of a format encoder. Override this class and
704704
add the decoding logic in the :meth:`encode` method.
705+
706+
See :ref:`Writing Your Own File Codec in Python<file-codecs-py>`
705707
"""
706708

707709
_pushes_fd = False

0 commit comments

Comments
 (0)