title: How can i convert blob data received from database to image in python
body: <p>I receive longblob data from database.</p>
  
  <p>and i try to convert blob data to image and read image using cv2.</p>
  
  <p>So I tried converting blob data to base64 like below code but it failed.</p>
  
  <pre><code>img = base64.decodebytes(img_str)
  </code></pre>
  
  <p>How can i convert blob to image? Is there a converting feature for this problem in the cv2 package? </p>