How to convert PNG to SVG and use it on your website without errors
Published October 10, 2026 · 15 min read
In this article13 sections
- What SVG is
- When to use SVG and when to choose another format
- Real vectors and SVG files with embedded images
- How to convert PNG or JPG to SVG
- Single-color icons and multicolor SVG
- What a clean SVG means
- SVG in WordPress and Elementor
- AI EPS CDR PDF and PSD files
- File size and performance
- SVG security
- SVG accessibility and Google
- Checklist before publishing an SVG
- Frequently asked questions
Does your logo become jagged when enlarged? Does an icon change color in Elementor, or disappear altogether? Before trying another converter, check what the file actually contains. An image with an .svg extension can hold vector shapes, a pixel-based photograph, or a mixture of both.
To convert PNG to SVG for free and get a useful result, start with a clear source image and a tool that traces the artwork. The Imagyc Convert to SVG tool creates single-color artwork: icons, logos and even photos in a stencil style. The site’s compression and format conversion cover other tasks, such as preparing photographs for the web.
If you already have a logo or icon, open Imagyc Convert to SVG while reading this guide. The examples will help you choose settings, recognize embedded raster images and fix problems before publishing.
What SVG is
SVG stands for Scalable Vector Graphics. It is based on XML, a text language that describes artwork. Instead of storing only a grid of pixels, it can define circles, lines and paths. You can open its code in a text editor.1
Think of a circle. A raster image, such as PNG or JPG, represents it with small colored pixels. A vector drawing can describe it by its center and radius. The browser uses that description to draw the circle at the required size.
Vector shapes can scale without the jagged edges caused by insufficient pixels. This does not recover detail missing from the source, and it does not apply to raster images embedded in an SVG. The format also supports text, styles and features beyond simple shapes.2
For a small icon, this makes it easier to use the same geometry on a computer and a phone. Still, examine the artwork at its actual display size. A very fine detail can become visually indistinct in a 24-pixel button, even when it is a vector.
When to use SVG and when to choose another format
SVG is often suitable for logos, icons, diagrams and illustrations with defined outlines and areas of color. Photographs are generally more efficient in raster formats such as JPEG, WebP and AVIF. PNG is an option when lossless compression or transparency is needed.3, 4
| Content | Starting point | What to check |
|---|---|---|
| Logo made of simple shapes | Vector SVG | Brand accuracy and readability at small sizes |
| Interface icon | Single-color SVG | Contrast and behavior when changing color |
| Illustration with a few colors | Multicolor SVG | Number of shapes and final file size |
| Product or portrait photograph | WebP, AVIF or JPEG | Sharpness, dimensions and destination support |
| Screenshot containing text | PNG or lossless WebP | Readability after optimization |
The destination matters too. An SVG that works on your website may be rejected by an advertising platform, messaging app or email system. Prepare a raster version for those channels when necessary, and retain the vector original for future exports.
Basic static SVG has broad support in current desktop and mobile browsers, including Chrome, Edge, Firefox, Safari, Chrome on Android and Safari on iPhone. This does not mean every filter, font or advanced feature behaves identically. Test app browsers and editing tools separately.5
Real vectors and SVG files with embedded images
A so-called “fake SVG” often places a PNG or JPG inside an SVG container. This is allowed by the format. The important distinction is that the embedded image remains raster. Changing its container does not turn pixels into curves.6, 7
For an initial inspection, make a copy and open that copy in Notepad or another text editor. Search for <image> and inspect its href attribute, or the older xlink:href. A fragment like this indicates an embedded PNG:
<image href="data:image/png;base64,..." width="300" height="300" />
This is an illustrative fragment. The dots replace the image data, so it is not a usable file. The prefix data:image/jpeg;base64, indicates JPEG. A file address can point to an external image. The <image> element can also reference another SVG, so its presence alone does not prove the content is raster.6, 7, 8
Elements such as <path>, <circle> and <rect> indicate vector geometry. A file can combine these with photographs. Examine the part you need to enlarge. This inspection helps explain the structure, but it does not verify the file's security.
How to convert PNG or JPG to SVG
Vectorization rebuilds artwork as outlines and shapes. A tool analyzes the image, identifies regions and generates paths. Results depend on contrast, noise and the details being interpreted. Photographs may produce many shapes or acquire a poster-like appearance with fewer tones.9
Start with the best available source. Prefer a PNG with genuine transparency or a solid background that clearly separates the subject. A larger image helps when it contains real detail. Artificially enlarging a small file does not restore edges that have already been lost.
Before conversion, check that a checkerboard is only the transparency preview. Some images have the pattern baked into their pixels, which makes it part of the artwork to be traced. Remove excessive margins and elements that should not appear in the icon.
A practical workflow in Imagyc
- Open Convert to SVG and choose your file. Besides PNG, JPG and WebP, it opens PDF, AI, PSD, TIFF, HEIC and SVG. For a logo, start with the transparent original or the PDF.
- Check which regions should become the artwork. For a logo, the color selection separates the icon from areas that should remain transparent; for a photo, stencil mode decides by light and shadow.
- Adjust detail gradually and examine the outlines. More detail may preserve small curves, but it can also retain unwanted noise.
- Use thickness and speck adjustments carefully. Compare with the original to avoid closing letter openings or removing meaningful dots.
- Choose a fixed color or currentColor. Check the frame, dimensions and appearance against light and dark backgrounds.
- Download the SVG and test it where it will be used. The goal is recognizable, well-sized artwork, not simply a smaller file.
Imagyc Convert to SVG works with one drawing color. It does not reproduce every color of a photograph or complex logo: to preserve a multicolor brand, use Imagyc Vectorize, which keeps the palette in layers, and review each region.

PNG192 × 192 px · zoomed 5×
SVG3.4 KB · 4 shapes · same zoom
Single-color icons and multicolor SVG
A monochrome icon uses one drawing color over a background that can be transparent. A two-color SVG has two visible colors; transparency does not count as another ink. A multicolor logo may need a separate fill for each area.
In SVG, fill sets the interior color and stroke sets the outline. The value currentColor uses the CSS color property available in that context. A fixed color such as #1A5F7A retains its selected value unless another style rule overrides it.10, 11
When SVG is inserted directly into HTML, the page can control its currentColor. With an external file displayed through <img>, the page's text color does not automatically pass into the drawing. The editor must provide a compatible integration; selecting the option alone does not make it work in every widget.10, 4
Choose currentColor for an icon that should follow button states, light mode or dark mode. Choose fixed colors for a brand whose palette must remain stable. Test focus states and contrast too, especially on small screens.
What a clean SVG means
For website icons, a clean SVG is a simple file containing the necessary geometry, coherent dimensions and few dependencies. This is a practical publishing profile. It does not invalidate SVG files with classes, styles, gradients or masks, which are supported features of the format.12
The viewBox describes an internal coordinate region: starting position, width and height. It helps relate the drawing to its display area. The width and height attributes supply explicit dimensions that can be useful in editors and integrations.13, 14
This original example contains a circle with a fixed color and an internal area of 24 by 24 units:
<svg xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24" width="24" height="24">
<circle cx="12" cy="12" r="8" fill="#1A5F7A" />
</svg>
For a simple icon, prefer fill and stroke on the shapes, without classes or style blocks. Remove scripts, external dependencies and unnecessary editor metadata. This profile improves portability and still requires proper sanitization. Preserve what supports the appearance and accessibility, including useful titles, descriptions and internal references. Do not delete credits or license information without checking their purpose.
An illustration with a gradient may require <defs> and identifiers. Removing everything in the name of cleaning can break it. Also distinguish optimization from sanitization: shorter code is not proof of safety.15
SVG in WordPress and Elementor
WordPress does not enable SVG in its default upload configuration. In Elementor, the options for accepting it depend on the version and available features. SVG can contain active content, so allowing the extension and evaluating its safety are different tasks.16, 17, 18
Use a maintained solution that sanitizes SVG, restrict uploads to trusted people and test on a staging copy first. Keep WordPress, Elementor and the sanitization mechanism updated. If you enable SVG through an Elementor setting, read the warning and check how files will be filtered.
Avoid tutorials that permit arbitrary files through ALLOW_UNFILTERED_UPLOADS. WordPress documentation warns about accepting executable files. A filter that adds SVG to the allowed MIME types is not a sanitizer either.19, 18
After uploading, check which widget you are using. An image widget, an icon widget and a dedicated SVG feature can handle color and size differently. Editor settings do not replace checking the published page.20
| Symptom | Possible causes | First check |
|---|---|---|
| SVG does not appear | Incorrect URL, invalid XML, blocked upload or filtered content | Open the media URL and compare the structure before and after upload |
| Artwork is cropped or displaced | viewBox does not cover the shapes, or sizing rules alter the visible area | Review the artwork bounds and frame |
| SVG turns black | Default fill, black currentColor, removed styles or widget rules | Compare fill, stroke and computed color |
| Size appears to be zero | Explicit zero dimensions, a collapsed container or incompatible CSS | Check the file, widget and container dimensions |
| Works in the editor but fails on the website | Different CSS, cache or unavailable external resources | Test the published page and actual SVG URL |
A missing viewBox is not a universal explanation for an invisible SVG. Browsers can render files without it. Likewise, omitting width and height does not alone mean zero size; the sizing context matters. For portability, supply dimensions and a coherent viewBox.13, 14
Many shapes initially use black as their fill. Losing a color rule can explain a change. An embedded PNG may work, depend on an external URL or be removed by a particular filter.6, 21
AI EPS CDR PDF and PSD files
If artwork was created as vectors, preserve its curves. Illustrator exports SVG, and CorelDRAW supports this format too. Asking the creator for an export usually provides better control over colors, fonts, effects and artwork bounds.22, 23
Without the original program, Inkscape can open various formats, including certain AI, PDF, EPS and CDR files. Compatibility depends on file versions and installed libraries; EPS may require additional components. Review fonts, colors and effects before saving a copy as plain SVG.24
| Received file | Recommended approach | Main concern |
|---|---|---|
| AI or EPS | Export from the original editor or test a compatible import | Fonts, effects and linked images |
| CDR | Request an SVG export or test a compatible import | Version and application-specific features |
| Check for vectors and extract the artwork in an editor | A scanned PDF may contain only pixels | |
| PSD | Request the vector version or export a suitable raster | Layers and paths do not make the whole composition vector |
PSD is a Photoshop working format that can combine different content types. For a raster icon, exporting PNG and tracing it may help. For photographs, retain a raster format and use Imagyc's conversions and transformations to prepare the publishing version.25
Imagyc Convert to SVG opens PDF, AI saved with PDF compatibility and PSD right in the browser: the page or composite image is rendered at high resolution and traced again, in one color. It helps when you don’t have the original program, but it does not recover the exact curves or the colors of the artwork; for that, exporting from the source editor is still the best route. EPS and CDR don’t open in the browser, and renaming the extension doesn’t help. Because the file is never uploaded to a server, this route also suits client files and confidential designs.
File size and performance
The declared dimensions of a vector SVG do not determine file size as they do for a pixel grid. A simple drawing spanning 512 units can be small; a visually smaller icon may contain thousands of points. Redundant curves, filters and embedded images increase complexity.26, 27
Match detail to the display size. Keeping every irregularity from a PNG often adds little value to a menu icon. For a logo, excessive simplification may change the brand. Compare the outline and readability at the actual size before accepting a reduction.
Tools such as SVGO remove or reorganize redundant information. Work on a copy and compare the output: changes to identifiers or styles can affect integrations. Optimization should not discard useful information or serve as evidence of sanitization.28
Because SVG is text, its transfer can be compressed with gzip or Brotli when the server and client negotiate that option. Not every hosting setup applies it automatically. In the browser's network panel, check Content-Encoding and the actual transferred size.26, 29
For publishing, a correctly served .svg is usually easier to manage than distributing .svgz without reviewing the configuration. A compressed extension needs appropriate destination support. Assess caching and HTTP compression alongside the file.24, 29
There is no kilobyte threshold that makes every SVG good for SEO. Measure the page with the actual resource. Fewer bytes help on limited connections, while highly complex drawings can also demand processing from less powerful phones. Visual quality and rendering cost both matter.
SVG security
SVG can contain scripts, event attributes and references to other resources. A third-party file therefore needs evaluation and sanitization before entering a website. Removing editor names or other metadata does not remove these risks.30
The usage context changes behavior. SVG displayed as an image through <img> has restrictions, including disabled scripting. Opening the same file as a document or inserting it directly into HTML is a different situation. A harmless-looking preview does not prove safety in every context.31
An upload workflow should validate content, apply rules for allowed elements and attributes, and restrict upload permissions. Use a maintained SVG-specific sanitizer. Manually searching for and deleting “script” does not cover every possibility; OWASP recommends multiple checks for file uploads.32
Keep the original outside the public area when appropriate, and maintain a reviewed publishing version. Static icons should not include code or external dependencies they do not use. If sanitization changes the appearance, correct the export rather than disabling the security filter.
SVG accessibility and Google
Google supports SVG as an image format in Search. This does not guarantee indexing or rank it above PNG. Access to the resource, page relevance and image context still matter. Use a descriptive filename and surrounding text that explains its purpose.33
For an external SVG file, alternative text belongs on the HTML <img> tag. Describe what the image communicates on that page; use alt="" for a decorative image. A logo identifying the company needs a context-appropriate description, without a list of keywords.34
<img src="logo-imagyc.svg" alt="Imagyc"
width="160" height="40">
These dimensions are an example, not a mandatory logo size. Preserve the file's aspect ratio and adjust the layout space. On phones, check that the image fits its container and that surrounding text and controls remain readable.
For SVG placed directly in HTML, the <svg> element does not take the alt attribute used by <img>. You can provide an accessible name through <title> and aria-labelledby. Use unique identifiers when more than one instance appears.35
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
width="24" height="24" role="img" aria-labelledby="badge1">
<title id="badge1">Confirmation badge</title>
<circle cx="12" cy="12" r="8" fill="#1A5F7A" />
</svg>
For a button, the accessible name should explain the action, such as “Open menu”. A decorative icon beside a sufficient label can be hidden from assistive technologies. Its description should help someone understand or operate the page.36
For other website images, explore the Imagyc guides to image formats and naming images for SEO.
Checklist before publishing an SVG
- The format suits the content and is accepted by the destination.
- The part that needs scaling contains vectors, rather than only an embedded raster.
- The drawing has been compared with the source, including letters, openings and small details.
- The viewBox covers the artwork, dimensions are coherent and the aspect ratio is correct.
- Fixed colors or currentColor work in the actual widget and backgrounds.
- The file has passed the security workflow appropriate to its source and usage.
- Optimization has preserved gradients, references, accessibility and necessary information.
- Transferred size and compression have been checked on the published website.
- Alternative text or the accessible name matches the image's purpose.
- The page has been tested on desktop and mobile, beyond the editor preview.
Frequently asked questions
Is SVG better than PNG
For shapes that need to scale, SVG may be more practical. PNG works well for lossless raster content. Compare the artwork, file size and destination; a complex SVG is not automatically smaller than a suitable PNG.3
Can a photograph be converted to SVG
Yes, through tracing, but the result simplifies tones. In Imagyc, stencil mode turns a photo into one-color artwork: skin becomes transparent, while hair, eyes, mouth and shadows become the drawing. Embedding the photograph in SVG retains its pixels, and to display a faithful photograph on a website, optimizing a raster format generally makes more sense.7, 9
Why does my SVG not appear in Elementor
Check that the upload was accepted, the URL works and sanitization preserved the drawing. Then review viewBox, colors, CSS and widget space. One missing dimension does not explain every case.16, 20
How do I open an SVG file
A current browser can display a static SVG. A vector editor lets you change its shapes, while a text editor exposes its code. Evaluate unknown files for security before opening or publishing them.1, 30
Can I convert PNG to SVG for free without keeping every color
Yes. A single-color icon can suit buttons and menus. In Imagyc, review the outlines and choose a fixed color or currentColor. For a multicolor brand, use Vectorize, which keeps every color.
Does removing metadata make an SVG safe
No. Metadata, visual structure and active content are different concerns. A publishing version needs appropriate sanitization and checking even when it contains no information about the program that created it.
Choose a simple icon and try Imagyc Convert to SVG. Compare the result at its actual display size, then use the checklist to review the version you will publish.
Sources 36 references · accessed on October 10, 2026
- MDN Web Docs. SVG Scalable Vector Graphics
- W3C. Scalable Vector Graphics SVG 2
- web.dev. Image performance
- MDN Web Docs. Including vector graphics in HTML
- MDN Web Docs. Image file type and format guide
- MDN Web Docs. The SVG image element
- W3C. SVG 2 Embedded content
- MDN Web Docs. Data URLs
- web.dev. SVGcode a PWA to convert raster images to SVG vector graphics
- MDN Web Docs. SVG color attribute
- MDN Web Docs. Fills and strokes
- W3C. SVG 2 Styling
- MDN Web Docs. SVG viewBox attribute
- MDN Web Docs. The svg element
- MDN Web Docs. Gradients in SVG
- Elementor Help. Enable SVG support in Elementor
- Elementor Help. Settings
- WordPress Developer Resources. upload_mimes
- WordPress Developer Resources. Common issues
- Elementor Help. SVG element
- MDN Web Docs. SVG fill attribute
- Adobe Help. How to export artwork in Illustrator
- CorelDRAW 2026 Help. Scalable Vector Graphics SVG
- Inkscape. Perguntas frequentes
- Adobe Photoshop Help. Supported image file formats
- web.dev. Image optimization
- SVGO. convertPathData
- SVGO. Introduction
- MDN Web Docs. Content Encoding header
- W3C. SVG 2 Interactivity
- MDN Web Docs. SVG as an image
- OWASP Cheat Sheet Series. File Upload Cheat Sheet
- Google Search Central. Google image SEO best practices
- W3C Web Accessibility Initiative. Images Tutorial
- MDN Web Docs. The SVG title accessible name element
- W3C Web Accessibility Initiative. Functional Images