How to return images in Flask?

from flask import send_file

@app.route('/get_image')
def get_image():
    filename = 'ok.png'
    return send_file(filename, mimetype='image/png')