def redraw_required(self, image):
"""
Calculates the difference from the previous image, return a boolean
indicating whether a redraw is required. A side effect is that
``bounding_box`` and ``image`` attributes are updated accordingly, as is
priming :py:func:`getdata`.
:param image: An image to render
:type image: PIL.Image.Image
:returns: ``True`` or ``False``
"""
self.bounding_box = ImageChops.difference(self.image, image).getbbox()
if self.bounding_box is not None:
self.image = image.copy()
return True
else:
return False
评论列表
文章目录