If possible, the utilisation of svg image format (or <svg/> html tag) is recommended over other image format.

Because SVGs are generally smaller than other image format, they’re less taxing on your server despite needing to render on load.

When to use SVG :

Some advantages of using SVG:

Noncompliant Code Example

img_jpg = "image.jpg"

Compliant Solution

img_svg = "image.svg"

Noncompliant Code Example

public void foo() {
    // ...
    image_format = testImage("image.jpg")
    // ...
}

Compliant Solution

public void foo() {
    // ...
    image_format = testImage("image.svg")
    // ...
}

Noncompliant Code Example

public void foo() {
    // ...
    return '<html><img src="xx/xx/image.bmp"></html>'
    // ...
}

Compliant Solution

public void foo() {
    // ...
    return '<html><img src="xx/xx/image.svg"></html>'
    // ...
}

Or

 public void foo() {
    // ...
    return ('<html><svg width="100" height="100"><circle cx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow"/></svg></html>')
    // ...
}