Astro throws “Unsupported image conversion” when you ask its image service to turn a raster image (PNG, JPEG, WebP, AVIF, GIF or TIFF) into an SVG, usually by setting format="svg" on <Image>, <Picture> or getImage() with a non-SVG source. Astro can’t trace bitmaps into vectors. Remove format="svg" or pick a raster output like webp or avif, and if you need a real SVG, replace the source file with one.
Key Takeaways
- The check is simple: source isn’t SVG and requested output is SVG.
- Usually caused by a shared component that sets
format="svg"for every image.- Use
webp(the default) oraviffor photos and screenshots.- The reverse, SVG to raster, is a different error controlled by
image.dangerouslyProcessSVG.
The exact error
Unsupported image conversion.
Converting between vector (such as SVGs) and raster (such as PNGs and JPEGs) images is not currently supported.
There’s no hint line, and the message doesn’t name the file. Look at the stack trace or the page that was building when it failed.
What causes it
Astro validates the options before transforming. If src is a raster image and format is "svg", it stops:
---
// src/components/Logo.astro (broken)
import { Image } from 'astro:assets';
import logo from '../assets/logo.png';
---
<Image src={logo} format="svg" alt="Company logo" />
A common version of this is a reusable component that hardcodes the format because it was written for SVG logos, then gets used for a PNG:
---
// src/components/BrandMark.astro (broken when src is a PNG)
import { Image } from 'astro:assets';
const { src, alt } = Astro.props;
---
<Image src={src} format="svg" alt={alt} />
The fix
Choose the output from the source, or leave format unset:
---
// src/components/BrandMark.astro
import { Image } from 'astro:assets';
import type { ImageMetadata } from 'astro';
interface Props {
src: ImageMetadata;
alt: string;
}
const { src, alt } = Astro.props;
const format = src.format === 'svg' ? 'svg' : 'webp';
---
<Image src={src} format={format} alt={alt} />
Imported images carry their format in the metadata, so the component can decide without guessing. For a one-off image, just delete format="svg"; Astro defaults to WebP.
You actually need a vector
If the goal is a crisp logo at any size, the source has to be an SVG. Ask the designer for the original vector, export it from your design tool, or redraw it. Automatic tracing tools exist, but results on logos and text are often poor, so check the output before shipping. Once you have logo.svg, import it and either pass format="svg" or render it as a component to inline it.
When the reverse happens
Turning an SVG into PNG or WebP is blocked by default too, but with a different message under the “Unsupported image format” title. That case and the image.dangerouslyProcessSVG setting are covered in unsupported image format. For the full <Image> and <Picture> options, see responsive images in Astro, and the Astro performance guide explains why format choice matters for page weight. Our styling docs cover where theme assets live, and the Komal theme catalog shows finished examples. The Astro error reference has the official entry.
FAQ
Can Astro convert PNG to SVG?
No. Astro’s image service resizes and re-encodes raster images and can pass SVGs through, but it can’t vectorize a bitmap.
What format does Astro’s Image component output by default?
WebP. Set format="avif", "png" or "jpeg" to change it for raster sources.
How do I keep an SVG as SVG with the Image component?
Import the .svg file and set format="svg". Astro copies it without processing and adds the width and height you pass.