def create_grayscale(self, icon_size_set, image): new_image = image[1:].replace('.', '-disabled.', 1) opacity = 1.0 if image[0] == "-" else 0.9 data = {} try: for size in icon_size_set: data[size] = grayscale.image_to_graysacle( get_image(self._settings, size, image[1:]), opacity) return data, new_image except ValueError: print("image %s does not exist" % image) return None, None
def create_image(image, size): try: return Image.open(get_image(self._settings, size, image)) except IOError: print("image %s does not exist" % image)