from PIL import Image


def rgba_to_rgb(im, rgb):
    """Translate an RGBA-mode image to an RGB image. 

    im
        The transparent image.

    rgb
        The RGB-value to use for the transparent areas.  This should be
        a 3-tuple of integers, 8 bits for each band.
    """
    new_im = Image.new("RGB", im.size, rgb)
    new_im.paste(im, None, im)
    return new_im