darsia.imread_from_bytes#

imread_from_bytes(data, transformations=None, native=False, **kwargs)[source]#

Initialization of Image by reading from the bytes of an image file.

The image is read like a single optical image file (see imread_from_optical): color space RGB unless given, the date from the EXIF data unless given (also None), and floats unless native.

Parameters:
databytes

Bytes of an image file (any format OpenCV decodes, e.g. jpg, png, tif).

transformationslist of callables

Transformations.

nativebool

Keep the data type resulting from the transformations instead of converting to float in the end, see imread_from_optical.

**kwargs

Keyword arguments accepted by Image, e.g. date, reference_date, name.

Returns:
darsia.Image

Image; scalar or optical, depending on the number of channels.