def restore_original_texture_name(filename: str) -> str:
    """Create original texture name from RSB filename"""
    newfilename = filename
    if filename.startswith("TGA"):
        #Strip TGA from front of filename
        newfilename = filename[3:]
        newfilename = newfilename[:-4] + ".tga"
    else:
        newfilename = newfilename[:-4] + ".bmp"
    return newfilename