def METHOD_NAME(self, image):
    """
    transforms raw image into colored version
    """
    # randomcolor is a flag orthogonal to num-back-both
    if self.flag_rand_color:
        c_f = self.get_foreground_color(np.random.randint(0, self.get_num_colors()))
        c_b = 0
        if self.color_scheme == 'both':
            count = 0
            while True:
                c_b = self.get_background_color(np.random.randint(0, self.get_num_colors()))
                if c_b != c_f and count < 10:
                    # exit loop if background color
                    # is not equal to foreground
                    break
    else:
        if self.color_scheme == 'num':
            # domain and class label has perfect mutual information:
            # assign color
            # according to their class (0,10)
            c_f = self.get_foreground_color(self.ind_color)
            c_b = np.array([0]*3)
        elif self.color_scheme == 'back':  # only paint background
            c_f = np.array([0]*3)
            c_b = self.get_background_color(self.ind_color)
        else:  # paint both background and foreground
            c_f = self.get_foreground_color(self.ind_color)
            c_b = self.get_background_color(self.ind_color)
    image[:, :, 0] = image[:, :, 0] / 255 * c_f[0] + \
        (255 - image[:, :, 0]) / 255 * c_b[0]
    image[:, :, 1] = image[:, :, 1] / 255 * c_f[1] + \
        (255 - image[:, :, 1]) / 255 * c_b[1]
    image[:, :, 2] = image[:, :, 2] / 255 * c_f[2] + \
        (255 - image[:, :, 2]) / 255 * c_b[2]
    return image