title: Insert a matplotlib text on an existing image and preserve dpi
body: <p>I would like to use matplotlib  flexible text abilities on an existing image in PNG format with 300 dpi resolution.
  I must preserve size and resolution.</p>
  
  <p>what I tried :</p>
  
  <pre><code>from pylab import *
  background = imread('Invitation.png')
  imshow(background)
  text(500,100, "n° 00001", size=20, rotation=30,
               ha="right", va="top",
               bbox=dict(boxstyle="round",
                         ec=(1., 0.5, 0.5),
                         fc=(1., 0.8, 0.8),
                       )) 
  axis(off)
  savefig('Invitation00001.png',dpi=300)
  close()
  </code></pre>
  
  <p>But I encounter bounding box problems and dpi loss (left is before, right is after):</p>
  
  <p><a href="https://i.stack.imgur.com/NbY4a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NbY4a.png" alt="enter image description here"></a></p>
  
  <p>What is the good way to keep the original image features in the result? 
  Is there an alternative (at image level ?) for slanted text box ?
  Thanks for any advice.</p>