code: def _rgbtomask(self, obj):
          
          dat = obj.get_image().get_data()  # RGB arrays
          return dat.sum(axis=2).astype(np.bool)
docs: Convert RGB arrays from mask canvas object back to boolean mask.