locan.data.imagesΒΆ

Image class

This module provides an adapter class for Image objects of third-party image processing libraries.

The Image class is the locan way to keep an image, the pixel coordinates and metadata in sync.

Image data is kept as an array compliant with the Python array API standard [1].

Pixel coordinates are kept as a Bins instance.

To create an Image object from any other image library modify the initialization of self.data and other attributes accordingly:

class MyImage(Image):
def __init__(self, image: Any):

super().__init__(image=image) self.data = some_function_or_attribute(self._image)

References

Classes

ArrayApiObject(*args, **kwargs)

Image([image, data, is_rgb, meta])

Adapter class for Image objects.

ImageBase()

Abstract base class of an adapter class for Image objects.

ImageProtocol(*args, **kwargs)

Interface specification for an adapter class for Image objects.

PillowImage(*args, **kwargs)

Interface specification for a pillow image.

Functions

is_array_api_obj(x)

Check if input is compliant with array API standard.