SponsorHueclip · A moodboard maker for designers. Clip fonts, colors and screenshots. · Moodboard makerTry it
  1. Dashboard
  2. Svg Image Element
Local Processing
MintConvertMintConvertMintConvert•100% Client-Side

© 2026 MintConvert. Files process locally in your browser and never touch a server.

All ToolsGuidesAboutFAQPrivacyTermsCookiesllms.txtDonate
Crafted byNikhil SaiNikhil Sai
MintConvertMintConvertMintConvert
Tools
PNG to SVGJPG to SVGWebP to SVGImage to SVGDXF to SVGGIF to SVGBMP to SVGICO to SVGTIFF to SVG
SVG to PNGSVG to JPGSVG to WebPSVG to ICOSVG Code to ImageSVG ConverterSVG to PDFSVG to STLSVG to DXFSVG to BMPSVG to GIFSVG to TIFF
SVG to CodeQR Code SVGBarcode Generator SVGSVG to Base64SVG FormatterSVG ValidatorSVG Sprite GeneratorBase64 to SVG
SVG ViewerSVG AnimatorSVG EditorSVG Background RemoverSVG CompressorSVG MakerSVG ResizerSVG CropperSVG Color ChangerSVG Rotate & FlipSVG MergerSVG Path EditorText to SVGSVG Wave GeneratorSVG Blob GeneratorSVG Pattern Generator
GuidesAboutDonate

SVG Image Element: How to Add Pictures Inside an SVG

Use the SVG image element to place PNG, JPG or SVG pictures inside a graphic. Covers href, sizing, cropping, shaped clips, embedding and missing images.

November 27, 2026 · MintConvert Team

"Shapes and text aren't the only things an SVG can hold. With the <image> element, you can place a photo inside a badge, put a screenshot under labels or crop a portrait into a circle.

This isn't the same as tracing. The picture stays a picture: a PNG or JPG is still made of pixels. Tracing turns pixels into vector shapes.

Basic syntax

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300">
  <image href="photo.jpg" x="0" y="0" width="400" height="300" />
</svg>
AttributePurpose
hrefAddress of the picture, or a data URL
x, yPosition of the top-left corner
width, heightSize of the rectangle for the picture. Set both for predictable results
preserveAspectRatioHow the picture fits that rectangle

According to MDN's element reference, SVG software must support JPEG, PNG and SVG. Older files may use xlink:href, which is deprecated in favor of href. Some older software may still expect it.

Inside HTML, use <image> only within an <svg>. For an ordinary picture on a page, use <img>.

Fit or crop the picture

ValueResult
xMidYMid meetShows the whole picture, centered. This is the usual default
xMidYMid sliceFills the rectangle and crops the overflow
noneStretches the picture to fill the rectangle

These examples describe PNG and JPG pictures. A referenced SVG has some different sizing rules, so test it separately.

Crop a picture into a circle

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200">
  <defs>
    <clipPath id="avatar">
      <circle cx="100" cy="100" r="90" />
    </clipPath>
  </defs>
  <image href="portrait.jpg" width="200" height="200"
         preserveAspectRatio="xMidYMid slice" clip-path="url(#avatar)" />
</svg>

Not every application supports clipping paths. Cutting software is one place to check, as explained in our Cricut file guide.

Linked or embedded?

A linked picture stays in a separate file. An embedded picture is written into the markup as a data URL:

<image href="data:image/png;base64,PASTE_BASE64_HERE" width="400" height="300" />

Replace the placeholder with your picture's Base64 data, and match the media type to its format.

LinkedEmbedded
Travels as one fileNoYes
SVG file sizeSmallerLarger
Replacing the pictureEasyRequires editing the markup
Works when the SVG is used as an imageExternal picture isn't loadedData URL can be used

That last row catches many people. A linked picture may appear in inline SVG, then vanish when the same graphic is loaded through <img> or as a CSS background. Browsers restrict external resources in that mode.

Why is my picture missing?

  • Wrong path: relative addresses are resolved from a base location, so check where the file and picture are.
  • No size: add width and height.
  • External link in image mode: embed the picture.
  • Outside the `viewBox`: check x, y and the dimensions.
  • Covered: elements written later are painted on top. See how SVG markup is structured.

Check and export your file

Open the graphic in an SVG viewer, which can point out external links. To get a flat image from your markup, embed the pictures first, then use the code to image tool. If the file feels heavy, resize the source picture before embedding it. An SVG compressor can trim markup, but don't expect it to do the work of resizing a large embedded photo.

Key takeaways

Set href, width and height, then choose meet, slice or none. Embed pictures when your graphic must travel as one file or be displayed as an image.

Frequently asked questions

More articles

November 27, 2026

SVG Documents Explained: Structure, Elements and Examples

How SVG documents are structured: the root element, namespace, viewBox, groups, definitions, reuse, drawing order and the errors that stop a file rendering.

Read article
November 27, 2026

SVG Files for Cricut: Free Downloads, Licenses and Uploading

Using SVG files for Cricut? Learn where to get free downloads, how to check the license, how to upload to Design Space and how to fix files that look wrong.

Read article
November 27, 2026

How to Use an SVG Shape as a Background Image in CSS

Use an SVG shape as a background image in CSS. Covers sizing, stretching, placement, data URIs, changing color with masks and fixes for common problems.

Read article
All articles

On this page