示例#1
0
def markImage(image):
    assert Image
    if 1:                               # shadow
        color, factor = '#6ae400', 0.3
        sh = Image.new('RGBA', image.size, color)
        tmp = Image.blend(image, sh, factor)
    else:                               # negate
        tmp = ImageOps.invert(image.convert('RGB'))
    out = Image.composite(tmp, image, image)
    return out
示例#2
0
def markImage(image):
    assert Image
    if 1:  # shadow
        color, factor = '#6ae400', 0.3
        sh = Image.new('RGBA', image.size, color)
        tmp = Image.blend(image, sh, factor)
    else:  # negate
        tmp = ImageOps.invert(image.convert('RGB'))
    out = Image.composite(tmp, image, image)
    return out
示例#3
0
 def _createDisabledButtonImage(self, tkim):
     # grayscale and light-up image
     if not tkim:
         return None
     im = tkim._pil_image
     dis_im = ImageOps.grayscale(im)
     ##color = '#ffffff'
     ##factor = 0.6
     color = '#dedede'
     factor = 0.7
     sh = Image.new(dis_im.mode, dis_im.size, color)
     tmp = Image.blend(dis_im, sh, factor)
     dis_im = Image.composite(tmp, im, im)
     dis_tkim = ImageTk.PhotoImage(image=dis_im)
     return dis_tkim
示例#4
0
 def _createDisabledButtonImage(self, tkim):
     # grayscale and light-up image
     if not tkim:
         return None
     im = tkim._pil_image
     dis_im = ImageOps.grayscale(im)
     # color = '#ffffff'
     # factor = 0.6
     color = '#dedede'
     factor = 0.7
     sh = Image.new(dis_im.mode, dis_im.size, color)
     tmp = Image.blend(dis_im, sh, factor)
     dis_im = Image.composite(tmp, im, im)
     dis_tkim = ImageTk.PhotoImage(image=dis_im)
     return dis_tkim