| 1 | from io import BytesIO |
| 2 | from typing import Union, BinaryIO |
| 3 | from pathlib import Path |
| 4 | |
| 5 | try: |
| 6 | from numpy.typing import ArrayLike |
| 7 | except ImportError: |
| 8 | # numpy<1.20 fall back to using ndarray |
| 9 | from numpy import ndarray as ArrayLike |
| 10 | |
| 11 | ImageResource = Union[str, bytes, BytesIO, Path, BinaryIO] |
| 12 | |
| 13 | |
| 14 | __all__ = [ |
| 15 | "ArrayLike", |
| 16 | "ImageResource", |
| 17 | ] |