code: def convert_to_rgb(image: ImageInput) -> ImageInput:
      """
      Converts an image to RGB format. Only converts if the image is of type PIL.Image.Image, otherwise returns the image
      as is.
  
      Args:
          image (Image):
              The image to convert.
      """
      requires_backends(convert_to_rgb, ["vision"])
  
      if not isinstance(image, PIL.Image.Image):
          return image
  
      image = image.convert("RGB")
      return image
  
imports: import warnings
  from typing import Iterable, List, Optional, Tuple, Union
  import numpy
  from .image_utils import ChannelDimension, ImageInput, get_channel_dimension_axis, get_image_size, infer_channel_dimension_format
  from .utils import ExplicitEnum, TensorType, is_jax_tensor, is_tf_tensor, is_torch_tensor
  from .utils.import_utils import is_flax_available, is_tf_available, is_torch_available, is_vision_available, requires_backends
label_desc: Use image node_id 20 for calling a global function with example usage: convert_to_rgb(image) and returns: image, image