Skip to content

Commit 35004da

Browse files
committed
Clarified that the sequence object for putdata() should be flattened
1 parent 11c536b commit 35004da

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/PIL/Image.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,13 +1707,14 @@ def putalpha(self, alpha):
17071707

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

0 commit comments

Comments
 (0)