diff --git a/PIL/Image.py b/PIL/Image.py index 54291fbdd..cad13c3b6 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -664,6 +664,10 @@ class Image: # Declare tostring as alias to tobytes def tostring(self, *args, **kw): + """Deprecated alias to tobytes. + + .. deprecated:: 2.0 + """ warnings.warn( 'tostring() is deprecated. Please call tobytes() instead.', DeprecationWarning,