'Use the mapping to convert images image_r, image_g, and image_b to a triplet of uint8 images'

def _convert_images_to_uint8(self, image_r, image_g, image_b):

    image_r = (image_r - self.minimum[0])
    image_g = (image_g - self.minimum[1])
    image_b = (image_b - self.minimum[2])
    fac = self.map_intensity_to_uint8(self.intensity(image_r, image_g, image_b))
    image_rgb = [image_r, image_g, image_b]
    for c in image_rgb:
        c *= fac
        c[(c < 0)] = 0
    pixmax = self._uint8Max
    (r0, g0, b0) = image_rgb
    with np.errstate(invalid=u'ignore', divide=u'ignore'):
        for (i, c) in enumerate(image_rgb):
            c = np.where((r0 > g0), np.where((r0 > b0), np.where((r0 >= pixmax), ((c * pixmax) / r0), c), np.where((b0 >= pixmax), ((c * pixmax) / b0), c)), np.where((g0 > b0), np.where((g0 >= pixmax), ((c * pixmax) / g0), c), np.where((b0 >= pixmax), ((c * pixmax) / b0), c))).astype(np.uint8)
            c[(c > pixmax)] = pixmax
            image_rgb[i] = c
    return image_rgb
