code: def remove(image, mask=None, iterations=1):
      '''Turn 1 pixels to 0 if their 4-connected neighbors are all 0
      
      ? 1 ?     ? 1 ?
      1 1 1  -> 1 0 1
      ? 1 ?     ? 1 ?
      '''
      global remove_table
      if mask is None:
          masked_image = image
      else:
          masked_image = image.astype(bool).copy()
          masked_image[~mask] = False
      result = table_lookup(masked_image, remove_table, False)
      if not mask is None:
          result[~mask] = image[~mask]
      return resulf remove(image, mask=None, iterations=1):
      '''Turn 1 pixels to 0 if their 4-connected neighbors are all 0
      
      ? 1 ?     ? 1 ?
      1 1 1  -> 1 0 1
      ? 1 ?     ? 1 ?
      '''
      global remove_table
      if mask is None:
          masked_image = image
      else:
          masked_image = image.astype(bool).copy()
          masked_image[~mask] = False
      result = table_lookup(masked_image, remove_table, False)
      if not mask is None:
          result[~mask] = image[~mask]
      return result
docs: Turn 1 pixels to 0 if their 4-connected neighbors are all 0
      
      ? 1 ?     ? 1 ?
      1 1 1  -> 1 0 1
      ? 1 ?     ? 1 ?