How to pass Base64 image string from Flask Python code to HTML?
1.First Add A empty Image Tag Without A Source
2.Then With Javascript preprocess the base64 data string
3.update the Image src with updated base64 data
<img src="" id="img" alt="Chart" height="100" width="100"><script> data = "{{data}}" data = data.replace("b'", "") //to get rid of start curly brace code data = data.replace("'", "") //to get rid of end curly bracecode document.getElementById("img").src = "data:image/png;base64,"+data; // set src</script>