code: def image_shape(img):
      '''handle different image formats, returning (width,height) tuple'''
      if hasattr(img, 'shape'):
          return (img.shape[1], img.shape[0])
      return (img.width, img.heightf image_shape(img):
      '''handle different image formats, returning (width,height) tuple'''
      if hasattr(img, 'shape'):
          return (img.shape[1], img.shape[0])
      return (img.width, img.height)
docs: handle different image formats, returning (width,height) tuple