Skip to content

ImageFormat

Represents image format metadata (dimensions and optionally pixel format, channel datatype, and color model) without storing pixel data. This datatype is used when only format or metadata is required within the Telekinesis ecosystem.

Field

Required

FieldTypeDescription
widthintImage width in pixels (int).
heightintImage height in pixels (int).

Optional

FieldTypeDescription
pixel_formatintPixel format enum value (int).
channel_datatypeChannelDatatypeChannel datatype. See Enums.
color_modelColorModelColor model. See Enums.

Example

python
from datatypes import datatypes
from loguru import logger

# ------------------------------------------------
# 1. Create ImageFormat instance
# ------------------------------------------------
image_format = datatypes.ImageFormat(
    width=2,
    height=2,
    pixel_format=1,
    channel_datatype=0,
    color_model=1,
)

# ------------------------------------------------
# 2. Access format attributes
# ------------------------------------------------
logger.info("ImageFormat width={}", image_format.width)
logger.info("ImageFormat height={}", image_format.height)
logger.info("ImageFormat pixel_format={}", image_format.pixel_format)
logger.info("ImageFormat channel_datatype={}", image_format.channel_datatype)
logger.info("ImageFormat color_model={}", image_format.color_model)