Skip to content

Commit

Permalink
Clarified that the sequence object for putdata() should be flattened
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 27, 2021
1 parent 11c536b commit 35004da
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/PIL/Image.py
Expand Up @@ -1707,13 +1707,14 @@ def putalpha(self, alpha):

def putdata(self, data, scale=1.0, offset=0.0):
"""
Copies pixel data to this image. This method copies data from a
sequence object into the image, starting at the upper left
corner (0, 0), and continuing until either the image or the
sequence ends. The scale and offset values are used to adjust
the sequence values: **pixel = value*scale + offset**.
:param data: A sequence object.
Copies pixel data from a flattened sequence object into the image. The
values should start at the upper left corner (0, 0), continue to the
end of the line, followed directly by the first value of the second
line, and so on. Data will be read until either the image or the
sequence ends. The scale and offset values are used to adjust the
sequence values: **pixel = value*scale + offset**.
:param data: A flattened sequence object.
:param scale: An optional scale value. The default is 1.0.
:param offset: An optional offset value. The default is 0.0.
"""
Expand Down

0 comments on commit 35004da

Please sign in to comment.