title: How to render SVG image to PNG file in Python?
body: <p>So I want to render SVG from python code having target resolution WxH (having SVG text as str, <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDisplacementMap" rel="noreferrer">like this</a> that I generate dynamically):</p>
  <pre><code>&lt;svg width=&quot;200&quot; height=&quot;200&quot; viewBox=&quot;0 0 220 220&quot;
       xmlns=&quot;http://www.w3.org/2000/svg&quot;&gt;
    &lt;filter id=&quot;displacementFilter&quot;&gt;
      &lt;feTurbulence type=&quot;turbulence&quot; baseFrequency=&quot;0.05&quot;
          numOctaves=&quot;2&quot; result=&quot;turbulence&quot;/&gt;
      &lt;feDisplacementMap in2=&quot;turbulence&quot; in=&quot;SourceGraphic&quot;
          scale=&quot;50&quot; xChannelSelector=&quot;R&quot; yChannelSelector=&quot;G&quot;/&gt;
    &lt;/filter&gt;
  
    &lt;circle cx=&quot;100&quot; cy=&quot;100&quot; r=&quot;100&quot;
        style=&quot;filter: url(#displacementFilter)&quot;/&gt;
  &lt;/svg&gt;
  </code></pre>
  <p>into a png image. How to do such a thing in Python?</p>