def __init__(
        self,
        name=None,
        shape=None,
        scale=1.0,
        bias=None,
        color_layout=ColorLayout.RGB,
        channel_first=None,
        grayscale_use_uint8=False,
    ):
        """
        Configuration class used for image inputs in Core ML.

        Parameters
        ----------
        scale: float or list of floats
            The scaling factor for all values in the image channels.

        bias: float or list of floats
            * If ``color_layout`` is ``ct.colorlayout.GRAYSCALE`` or
              ``ct.colorlayout.GRAYSCALE_FLOAT16``, bias would be a ``float``.
            * If ``color_layout`` is ``ct.colorlayout.RGB`` or ``ct.colorlayout.BGR``,
              bias would be a list of ``float``.

        color_layout: string or enumeration of type ``ct.colorlayout``
            Color layout of the image. Valid values are as follows:

            Enumeration (recommended):
                * ``ct.colorlayout.RGB``
                * ``ct.colorlayout.BGR``
                * ``ct.colorlayout.GRAYSCALE``
                * ``ct.colorlayout.GRAYSCALE_FLOAT16``

            String values (older way to specify):
                * ``'G'``: Grayscale (maps to ``ct.colorlayout.GRAYSCALE``)
                * ``'RGB'``: [Red, Green, Blue] (maps to ``ct.colorlayout.BGR``)
                * ``'BGR'``: [Blue, Green, Red] (maps to ``ct.colorlayout.RGB``)

        channel_first: (bool) or None
            Set to ``True`` if input format is channel first.

            Default format:
                * For TensorFlow: channel last (``channel_first=False``).
                * For PyTorch: channel first (``channel_first=True``).

        grayscale_use_uint8: (bool)
            * Only applicable for GRAYSCALE color layout.
            * Defaults to ``False``, in which case fp32 will be used.
            * Using uint8 requires a ``minimum_deployment_target`` of iOS17 or newer.
            * Using uint8 restricts the number of avaliable MIL ops, which can cause
              conversion to fail.
        """
        super(ImageType, self).__init__(name, shape)
        self.scale = scale
        msg = "color_layout should be an enum of type ct.colorlayout, i.e. one of: " \
              "{ct.colorlayout.RGB, ct.colorlayout.BGR, " \
              "ct.colorlayout.GRAYSCALE, ct.colorlayout.GRAYSCALE_FLOAT16}"
        if not (isinstance(color_layout, str) or isinstance(color_layout, ColorLayout)):
            raise ValueError(msg)
        if isinstance(color_layout, str):
            if color_layout not in ("G", "RGB", "BGR"):
                raise ValueError(msg)
            color_layout = ColorLayout(color_layout)

        self.color_layout = color_layout
        if color_layout == ColorLayout.GRAYSCALE_FLOAT16:
            self.dtype = types.fp16
        if bias is None:
            if color_layout in (ColorLayout.GRAYSCALE, ColorLayout.GRAYSCALE_FLOAT16):
                self.bias = 0.0
            else:
                self.bias = [0.0, 0.0, 0.0]
        else:
            self.bias = bias
        self.channel_first = channel_first

        self.grayscale_use_uint8 = False
        if grayscale_use_uint8:
            if(color_layout != ColorLayout.GRAYSCALE):
                raise ValueError('"grayscale_use_uint8" can only be True when' \
                                 '"color_layout" is "GRAYSCALE"')
            self.grayscale_use_uint8 = grayscale_use_uint8

        Configuration class used for image inputs in Core ML.

        Parameters
        ----------
        scale: float or list of floats
            The scaling factor for all values in the image channels.

        bias: float or list of floats
            * If ``color_layout`` is ``ct.colorlayout.GRAYSCALE`` or
              ``ct.colorlayout.GRAYSCALE_FLOAT16``, bias would be a ``float``.
            * If ``color_layout`` is ``ct.colorlayout.RGB`` or ``ct.colorlayout.BGR``,
              bias would be a list of ``float``.

        color_layout: string or enumeration of type ``ct.colorlayout``
            Color layout of the image. Valid values are as follows:

            Enumeration (recommended):
                * ``ct.colorlayout.RGB``
                * ``ct.colorlayout.BGR``
                * ``ct.colorlayout.GRAYSCALE``
                * ``ct.colorlayout.GRAYSCALE_FLOAT16``

            String values (older way to specify):
                * ``'G'``: Grayscale (maps to ``ct.colorlayout.GRAYSCALE``)
                * ``'RGB'``: [Red, Green, Blue] (maps to ``ct.colorlayout.BGR``)
                * ``'BGR'``: [Blue, Green, Red] (maps to ``ct.colorlayout.RGB``)

        channel_first: (bool) or None
            Set to ``True`` if input format is channel first.

            Default format:
                * For TensorFlow: channel last (``channel_first=False``).
                * For PyTorch: channel first (``channel_first=True``).

        grayscale_use_uint8: (bool)
            * Only applicable for GRAYSCALE color layout.
            * Defaults to ``False``, in which case fp32 will be used.
            * Using uint8 requires a ``minimum_deployment_target`` of iOS17 or newer.
            * Using uint8 restricts the number of avaliable MIL ops, which can cause
              conversion to fail.
        
coremltools/converters/mil/input_types.py