def tile2WebPNG ( self, tile, color, brightness ):
    """Create PNG Images for the specified tile"""

    # 16 bit images map down to 8 bits
    if tile.dtype == np.uint16:
      tile = np.uint8(tile/256)

    # false color the image
    if tile.dtype != np.uint8:
      raise ("Illegal color option for data type %s" % ( tile.dtype ))
    else:
      tile = self.falseColor ( tile, color )

    img = Image.frombuffer ( 'RGBA', [self.tilesz,self.tilesz], tile.flatten(), 'raw', 'RGBA', 0, 1 )

    # enhance false color images when requested
    if brightness != None:
      # Enhance the image
      from PIL import ImageEnhance
      enhancer = ImageEnhance.Brightness(img)
      img = enhancer.enhance(brightness)

    return img
dataset/ETHPy150Open neurodata/ndstore/django/catmaid/deprecated/colorcatmaid.py/ColorCatmaid.tile2WebPNG/original