

def tile2WebPNG(self, tile, color, brightness):
    'Create PNG Images for the specified tile'
    if (tile.dtype == np.uint16):
        tile = np.uint8((tile / 256))
    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', [tile.tilesz, self.tilesz], tile.flatten(), 'raw', 'RGBA', 0, 1)
    if (brightness != None):
        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/VarMisuse@93/134 `self`->`tile`