Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,14 @@ def __setstate__(self, state):

def tobytes(self, encoder_name="raw", *args):
"""
Return image as a bytes object
Return image as a bytes object.

.. warning::

This method returns the raw image data from the internal
storage. For compressed image data (e.g. PNG, JPEG) use
:meth:`~.save`, with a BytesIO parameter for in-memory
data.

:param encoder_name: What encoder to use. The default is to
use the standard "raw" encoder.
Expand Down