I am trying to modify the stroke and fill of an .svg image.
I have been getting some information from Is it possible to manipulate an SVG document embedded in an HTML doc wi
If you use an img tag then for security reasons you will not be able to access the DOM of the image data. The image is effectively the same as an animated bitmap as far as the container is concerned.
Using an or tag will allow you to manipulate the embedded object's DOM.