diff --git a/adafruit_imageload/__init__.py b/adafruit_imageload/__init__.py index bf7d3e2..e149c41 100644 --- a/adafruit_imageload/__init__.py +++ b/adafruit_imageload/__init__.py @@ -24,7 +24,7 @@ Union, ) - from displayio import Bitmap, Palette + from displayio import Bitmap, ColorConverter, Palette from .displayio_types import BitmapConstructor, PaletteConstructor except ImportError: @@ -39,7 +39,7 @@ def load( *, bitmap: Optional[BitmapConstructor] = None, palette: Optional[PaletteConstructor] = None, -) -> Tuple[Bitmap, Optional[Palette]]: +) -> Tuple[Bitmap, Optional[Union[Palette, ColorConverter]]]: """Load pixel values (indices or colors) into a bitmap and colors into a palette. bitmap is the desired type. It must take width, height and color_depth in the constructor. It diff --git a/adafruit_imageload/bmp/__init__.py b/adafruit_imageload/bmp/__init__.py index d7b9801..5c9c1df 100755 --- a/adafruit_imageload/bmp/__init__.py +++ b/adafruit_imageload/bmp/__init__.py @@ -15,9 +15,9 @@ try: from io import BufferedReader - from typing import List, Optional, Set, Tuple + from typing import List, Optional, Set, Tuple, Union - from displayio import Bitmap, Palette + from displayio import Bitmap, ColorConverter, Palette from ..displayio_types import BitmapConstructor, PaletteConstructor except ImportError: @@ -32,10 +32,11 @@ def load( *, bitmap: Optional[BitmapConstructor] = None, palette: Optional[PaletteConstructor] = None, -) -> Tuple[Optional[Bitmap], Optional[Palette]]: +) -> Tuple[Optional[Bitmap], Optional[Union[Palette, ColorConverter]]]: """Loads a bmp image from the open ``file``. - Returns tuple of bitmap object and palette object. + Returns tuple of `displayio.Bitmap` object and + `displayio.Palette` object, or `displayio.ColorConverter` object. :param io.BufferedReader file: Open file handle or compatible (like `io.BytesIO`) with the data of a BMP file.