Mention that tobytes() with the raw encoder uses Pack.c (#8878)

This commit is contained in:
wiredfool 2025-05-30 13:01:19 +01:00 committed by GitHub
commit e16f387bdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -767,18 +767,20 @@ class Image:
.. warning:: .. warning::
This method returns the raw image data from the internal This method returns raw image data derived from Pillow's internal
storage. For compressed image data (e.g. PNG, JPEG) use storage. For compressed image data (e.g. PNG, JPEG) use
:meth:`~.save`, with a BytesIO parameter for in-memory :meth:`~.save`, with a BytesIO parameter for in-memory data.
data.
:param encoder_name: What encoder to use. The default is to :param encoder_name: What encoder to use.
use the standard "raw" encoder.
A list of C encoders can be seen under The default is to use the standard "raw" encoder.
codecs section of the function array in To see how this packs pixel data into the returned
:file:`_imaging.c`. Python encoders are bytes, see :file:`libImaging/Pack.c`.
registered within the relevant plugins.
A list of C encoders can be seen under codecs
section of the function array in
:file:`_imaging.c`. Python encoders are registered
within the relevant plugins.
:param args: Extra arguments to the encoder. :param args: Extra arguments to the encoder.
:returns: A :py:class:`bytes` object. :returns: A :py:class:`bytes` object.
""" """