SDF.data_model.image_data module

class ImageData(data: PIL.Image.Image)[source]

Bases: SDF.data_model.abstract.Data

Wraps a PIL Image. Represents an SDF <data> element of type ‘img’.

static base64_to_image(base64_str: str)PIL.Image.Image[source]

Read base64-encoded PNG image

property data
classmethod from_xml_element(element: xml.etree.ElementTree.Element)SDF.data_model.image_data.ImageData[source]

Generates an instance of this class from an Element

static image_to_base64(image: PIL.Image.Image)str[source]

Return base64-encoded PNG representation of image

to_xml_element()xml.etree.ElementTree.Element[source]

Returns an Element object that contains all information needed to export this object as XML.

property type_for_xml

The ‘type’ attribute the wrapping <dataset> element has to have