Create an image of a quantum circuit.

    A convenience function that calls circuit_to_latex() and render_latex().

    Args:
        circ:       A quantum Circuit
        qubits:     Optional qubit list to specify qubit order

    Returns:
        Returns: A PIL Image (Use img.show() to display)

    Raises:
        NotImplementedError: For unsupported gates.
        OSError: If an external dependency is not installed.

def circuit_to_image(circ: Circuit,
                     qubits: Qubits = None) -> PIL.Image:   # pragma: no cover
    """Create an image of a quantum circuit.

    A convenience function that calls circuit_to_latex() and render_latex().

    Args:
        circ:       A quantum Circuit
        qubits:     Optional qubit list to specify qubit order

    Returns:
        Returns: A PIL Image (Use img.show() to display)

    Raises:
        NotImplementedError: For unsupported gates.
        OSError: If an external dependency is not installed.
    """
    latex = circuit_to_latex(circ, qubits)
    img = render_latex(latex)
    return img