def format_to_ext(output_format):
    """Get a file extension from the output format

    Args:
        output_format (str): The target format.
    Returns:
        str: The corresponding file extension with '.ext' format.
    """
    if output_format == 'txt':
        return '.atxt'
    if output_format == 'braille':
        return '.braille.png'
    index = output_format.find(':')
    if index != -1:
        return '.' + output_format[0:index]
    return '.' + output_format