code: def run(self, workspace):
      parent_image = None
      parent_image_name = None
      imgset = workspace.image_set
      rgb_pixel_data = None
      input_image_names = []
      channel_names = []
      channelstack = self.scheme_choice == SCHEME_STACK
      if self.scheme_choice not in (SCHEME_STACK, SCHEME_COMPOSITE):
          for color_scheme_setting in self.color_scheme_settings:
              if color_scheme_setting.image_name.is_blank:
                  channel_names.append("Blank")
                  continue
              image_name = color_scheme_setting.image_name.value
              input_image_names.append(image_name)
              channel_names.append(image_name)
              image = imgset.get_image(
                  image_name, must_be_grayscale=True
              )
              multiplier = (
                  color_scheme_setting.intensities
                  * color_scheme_setting.adjustment_factor.value
              )
              pixel_data = image.pixel_data
              if self.wants_rescale.value:
                  pixel_data = pixel_data / numpy.max(pixel_data)
              if parent_image is not None:
                  if parent_image.pixel_data.shape != pixel_data.shape:
                      raise ValueError(
                          "The %s image and %s image have different sizes (%s vs %s)"
                          % (
                              parent_image_name,
                              color_scheme_setting.image_name.value,
                              parent_image.pixel_data.shape,
                              image.pixel_data.shape,
                          )
                      )
                  rgb_pixel_data += (
                      numpy.dstack([pixel_data] * 3) * multiplier
                  )
              else:
                  parent_image = image
                  parent_image_name = (
                      color_scheme_setting.image_name.value
                  )
                  rgb_pixel_data = (
                      numpy.dstack([pixel_data] * 3) * multiplier
                  )
      else:
          input_image_names = [
              sc.image_name.value for sc in self.stack_channels
          ]
          channel_names = input_image_names
          source_channels = [
              imgset.get_image(name, must_be_grayscale=True).pixel_data
              for name in input_image_names
          ]
          parent_image = imgset.get_image(input_image_names[0])
          for idx, pd in enumerate(source_channels):
              if pd.shape != source_channels[0].shape:
                  raise ValueError(
                      "The %s image and %s image have different sizes (%s vs %s)"
                      % (
                          self.stack_channels[0].image_name.value,
                          self.stack_channels[idx].image_name.value,
                          source_channels[0].shape,
                          pd.pixel_data.shape,
                      )
                  )
          if self.scheme_choice == SCHEME_STACK:
              rgb_pixel_data = numpy.dstack(source_channels)
          else:
              colors = []
              pixel_data = parent_image.pixel_data
              if self.wants_rescale.value:
                  pixel_data = pixel_data / numpy.max(pixel_data)
              for sc in self.stack_channels:
                  color_tuple = sc.color.to_rgb()
                  color = (
                      sc.weight.value
                      * numpy.array(color_tuple).astype(
                          pixel_data.dtype
                      )
                      / 255
                  )
                  colors.append(color[numpy.newaxis, numpy.newaxis, :])
              rgb_pixel_data = (
                  pixel_data[:, :, numpy.newaxis] * colors[0]
              )
              for image, color in zip(source_channels[1:], colors[1:]):
                  if self.wants_rescale.value:
                      image = image / numpy.max(image)
                  rgb_pixel_data = (
                      rgb_pixel_data
                      + image[:, :, numpy.newaxis] * color
                  )
  
      if (
          self.scheme_choice != SCHEME_STACK
          and self.wants_rescale.value
      ):
          # If we rescaled, clip values that went out of range after multiplication
          rgb_pixel_data[rgb_pixel_data > 1] = 1
  
      ##############
      # Save image #
      ##############
      rgb_image = Image(
          rgb_pixel_data,
          parent_image=parent_image,
          channelstack=channelstack,
      )
      rgb_image.channel_names = channel_names
      imgset.add(self.rgb_image_name.value, rgb_image)
  
      ##################
      # Display images #
      ##################
      if self.show_window:
          workspace.display_data.input_image_names = input_image_names
          workspace.display_data.rgb_pixel_data = rgb_pixel_data
          workspace.display_data.images = [
              imgset.get_image(name, must_be_grayscale=True).pixel_data
              for name in input_image_names
          ]
  
imports: import numpy
  from cellprofiler_core.image import Image
  from cellprofiler_core.module import Module
  from cellprofiler_core.setting import Color, Binary
  from cellprofiler_core.setting import HiddenCount
  from cellprofiler_core.setting import SettingsGroup
  from cellprofiler_core.setting import ValidationError
  from cellprofiler_core.setting.choice import Choice
  from cellprofiler_core.setting.do_something import DoSomething, RemoveSettingButton
  from cellprofiler_core.setting.subscriber import ImageSubscriber
  from cellprofiler_core.setting.text import ImageName, Float
label_desc: Use image node_id 8 for calling the GrayToColor obj's underlying member method code with example usage: obj.run(workspace) without return types