import torch


def FloattoRGB(images):
    """Converts a 0-1 float image with an alpha channel into RGB"""
    if len(images.size()) < 4:
        images = torch.unsqueeze(images, 0)
    return torch.clip(images[:,:3,:,:] * images[:,3,:,:] * 255 + (1-images[:,3,:,:])*255, 0, 255).type(torch.uint8)