@staticmethod<EOL><INDENT>def _setup_images(directory, brightness, saturation, hue, preserve_transparency):<DEDENT>
for file_name in os.listdir(directory):<EOL><INDENT>with open(os.path.join(directory, file_name), "<STR_LIT:rb>") as fi:<EOL><INDENT>image = Image.open(fi).convert("<STR_LIT>")<EOL><DEDENT>if brightness != <NUM_LIT:1.0>:<EOL><INDENT>enhancer = ImageEnhance.Brightness(image)<EOL>image = enhancer.enhance(brightness)<EOL><DEDENT>if saturation != <NUM_LIT:1.0>:<EOL><INDENT>enhancer = ImageEnhance.Color(image)<EOL>image = enhancer.enhance(saturation)<EOL><DEDENT>if hue != <NUM_LIT:1.0>:<EOL><INDENT>image = imgops.shift_hue(image, hue)<EOL><DEDENT>if preserve_transparency is True:<EOL><INDENT>image = imgops.make_transparent(image)<EOL><DEDENT>image.save(os.path.join(directory, file_name.replace("<STR_LIT>", "<STR_LIT>")))<EOL>image.close()<EOL><DEDENT>for file_name in (item for item in os.listdir(directory) if item.endswith("<STR_LIT>")):<EOL><INDENT>os.remove(os.path.join(directory, file_name))<EOL><DEDENT>
Apply modifiers to the images of a theme

Modifies the images using the PIL.ImageEnhance module. Using
this function, theme images are modified to given them a
unique look and feel. Works best with PNG-based images.