def method2png(output, mx, raw=False):
    """
    Export method to a png file format

    :param output: output filename
    :type output: string
    :param mx: specify the MethodAnalysis object
    :type mx: :class:`MethodAnalysis` object
    :param raw: use directly a dot raw buffer
    :type raw: string
    """
    buff = raw
    if not raw:
        buff = method2dot(mx)

    method2format(output, "png", mx, buff)