title: Add svg path on image using vips
body: <p>I am using vips PHP library. I want to add svg path on my image. I implemented below code for that but it's not giving me expected output. The problem is how can I set svg path according to the actual image height &amp; width. I tried using resize and thumbnail but it doesn't give me expected output. Also I want to fill the grey color on my actual image blocks like in expected output image.</p>
  <p><strong>The expected output image generated using imagick</strong></p>
  <pre><code>$background = Vips\Image::newFromFile($arg[1], ['access' =&gt; 'sequential']);
  $svg = Vips\Image::svgload_buffer('&lt;svg&gt;
    &lt;path 
      d=&quot;M0 200 v-200 h200 
      a100,100 90 0,1 0,200
      a100,100 90 0,1 -200,0
      z&quot; stroke=&quot;#fff&quot; fill=&quot;transparent&quot;/&gt;
  &lt;/svg&gt;');
  // $svg = $svg-&gt;resize(2.5);
  $svg = $svg-&gt;thumbnail_image(700, ['height' =&gt; 700, 'size' =&gt; 'both']);
  $image = $background-&gt;composite($svg, 'dest-in');
  $image-&gt;writeToFile([$arg2], ['background' =&gt; [128, 128, 128], 'Q' =&gt; 100]);
  </code></pre>
  <p>Below is the image on which I added my svg path
  <a href="https://i.stack.imgur.com/4Sfwk.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Sfwk.jpg" alt="enter image description here" /></a></p>
  <p>My vips output image
  <a href="https://i.stack.imgur.com/YR9AP.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YR9AP.jpg" alt="enter image description here" /></a></p>
  <p>Expected output image
  <a href="https://i.stack.imgur.com/0pXkh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0pXkh.jpg" alt="enter image description here" /></a></p>