diff --git a/esphome/components/image/__init__.py b/esphome/components/image/__init__.py index 4a92ed25c5..bf11f506f5 100644 --- a/esphome/components/image/__init__.py +++ b/esphome/components/image/__init__.py @@ -260,6 +260,7 @@ def load_svg_image(file: bytes, resize: tuple[int, int]): return Image.open(io.BytesIO(svg_image)) + def invert_image_colors(image): from PIL import Image @@ -271,6 +272,7 @@ def invert_image_colors(image): r, g, b = map(invert, (r, g, b)) return Image.merge(image.mode, (r, g, b, a)) + async def to_code(config): # Local import only to allow "validate_pillow_installed" to run *before* importing it from PIL import Image