Skip to main content

encoder

superduper.ext.pillow.encoder

Source code

encode_pil_image​

encode_pil_image(x,
info: Optional[Dict] = None)
ParameterDescription
xThe image to encode.
infoAdditional information.

Encode a PIL.Image to bytes.

image_type​

image_type(identifier: str,
encodable: str = 'lazy_artifact',
media_type: str = 'image/png',
db: Optional[ForwardRef('Datalayer')] = None)
ParameterDescription
identifierThe identifier for the data type.
encodableThe encodable type.
media_typeThe media type.
dbThe datalayer instance.

Create a DataType for an image.

DecoderPILImage​

DecoderPILImage(self,
handle_exceptions: bool = True)
ParameterDescription
handle_exceptionsreturn a blank image if failure

Decoder to convert bytes back into a PIL.Image class.