Docs /Templates/ sinapsis-generic-data-tools

ImageColorConversionNumpy

sinapsis-generic-data-toolscommunitycolorcolor_conversionimagecolor_space

Python template · sinapsis_generic_data_tools.templates.image_color_conversion_np

Overview

A template for converting the color space of images within a DataContainer.

This template applies color space conversion to all image packets contained within a DataContainer. The target color space is specified in the template's attributes.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-generic-data-tools==1.0.0
uv pip install sinapsis-generic-data-tools==1.0.0
uv add sinapsis-generic-data-tools==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
target_color_spaceRequired

The target color space to which all images will be converted. - RGB = 1 - BGR = 2 - GRAY = 3 - RGBA = 4

ImageColor
Required
Default: null

Configuration example

Generated from documented defaults. Replace any placeholders and complete required nested settings before running.

yaml
templates:
  - template_name: "ImageColorConversionNumpy"
    class_name: "ImageColorConversionNumpy"
    attributes:
      target_color_space: {}
View original docstring example

The source example references ColorConversion, not ImageColorConversionNumpy.

yaml
agent:
    name: my_test_agent
templates:
-   template_name: InputTemplate
    class_name: InputTemplate
    attributes: {}
-   template_name: ColorConversion
    class_name: ColorConversion
    template_input: InputTemplate
    attributes:
        target_color_space: 2

Inheritance

Immediate parent: sinapsis_core.template_base.template.Template

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.