It is possible if you use one pattern
within svg linking the image in Shape (rect, Polygon, Circle, even path works).
First you create the definition <defs>
then the <pattern>
and puts the image that will be the BG <image>
Then you use the Pattern-img as fill
of the element fill="url(#ID-do-pattern)"
See in the example to better understand.
<svg xmlns="http://www.w3.org/2000/svg" id="svg2" version="1.1" width="900px" height="611px" viewBox="0 0 900 611">
<defs>
<pattern id="p2" x="0" y="0" height="1" width="1">
<image x="0" y="0" xlink:href="https://unsplash.it/300/300"></image>
</pattern>
</defs>
<rect x="0" y="0" width="300px" height="100px" fill="url(#p2)" stroke="black" />
<rect x="0" y="110" width="150" height="200" fill="url(#p2)" stroke="red" stroke-width="2" />
<circle cx="250" cy="200" r="70" fill="url(#p2)" stroke="blue" stroke-width="3"/>
<polygon points="300,300, 250,390, 180,420, 100,400, 200,270" fill="url(#p2)" stroke="green" stroke-width="4"/>
<path d="M350 400 L475 300 L225 200 Z" fill="url(#p2)" stroke="red" stroke-width="8" />
</svg>
Link I used base to do
I posted a reply an answer unintentionally :/ , want to run snipped and clicked without thinking. Anyway, see if this helps you: https://stackoverflow.com/questions/13217669/svg-image-with-a-borderstroke
– Miguel
@Miguel publishes it translated to nóis ;p
– Wallace Maxters
I’m working on it, it’s personal now lol, pride speak out now
– Miguel