def METHOD_NAME(data):
    """Convert a RGB bitmap to PNG.
    It only supports RGB bitmap with one byte per channel stored as a 3D array.
    See `Definitive Guide <http://www.libpng.org/pub/png/book/>`_ and
    `Specification <http://www.libpng.org/pub/png/spec/1.2/>`_ for details.
    :param data: A 3D array (h, w, rgb) storing an RGB image
    :type data: numpy.ndarray of unsigned bytes
    :returns: The PNG encoded data
    :rtype: bytes
    """
    height, width = data.shape[0], data.shape[1]
    depth = 8  # 8 bit per channel
    colorType = 2  # 'truecolor' = RGB
    interlace = 0  # No
    IHDRdata = struct.pack(">ccccIIBBBBB", b'I', b'H', b'D', b'R',
                           width, height, depth, colorType,
                           0, 0, interlace)
    # Add filter 'None' before each scanline
    preparedData = b'\x00' + b'\x00'.join(line.tobytes() for line in data)
    compressedData = zlib.compress(preparedData, 8)
    IDATdata = struct.pack("cccc", b'I', b'D', b'A', b'T')
    IDATdata += compressedData
    return b''.join([
        b'\x89PNG\r\n\x1a\n',  # PNG signature
        # IHDR chunk: Image Header
        struct.pack(">I", 13),  # length
        IHDRdata,
        struct.pack(">I", zlib.crc32(IHDRdata) & 0xffffffff),  # CRC
        # IDAT chunk: Payload
        struct.pack(">I", len(compressedData)),
        IDATdata,
        struct.pack(">I", zlib.crc32(IDATdata) & 0xffffffff),  # CRC
        b'\x00\x00\x00\x00IEND\xaeB`\x82'  # IEND chunk: footer
    ])