From 35004daaea210f9bbc80de62ca05c61869766718 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 27 Dec 2021 16:11:43 +1100 Subject: [PATCH] Clarified that the sequence object for putdata() should be flattened --- src/PIL/Image.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 0fca3fa5cc4..926e3285efa 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -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. """