| Create a new request |
|
SVG help Scalable Vector Graphics is a commonly used file format for providing a geometrical description of an image using basic objects such as labels, circles, lines, curves and polygons. An image can be reduced or enlarged to an arbitrary size, and will not suffer image data loss, nor will it become pixelated. SVG makes an excellent format for artwork, diagrams and drawings. SVG images are defined in XML text files. This means that they can be searched, indexed, scripted, and compressed. Since they are XML files, SVG images can be edited with any text editor, but SVG-based drawing programs are also available. However, the rendering engine used by wiki is not perfect, and may cause the image to be shown incorrectly, or differently from how it is displayed in your vector editor of choice. This page enables authors experiencing problems with SVG graphics to obtain some help in getting their images into wiki the way they intend. |
Things we can help with Understanding SVG
Using SVG appropriately
What you see is not what you get
Something new
| ||||||
General suggestionsThe following is a list of common vector editors and suggested settings for compatibility. The user guide of your chosen program may also be valuable in troubleshooting. BrowsersMost modern browsers can render SVGs in view-only mode. It may be convenient to set a browser as the default SVG viewer, but you can also paste the file path into the address bar. Please note that even if your browser renders an SVG correctly, it may render differently on Wikipedia. Text editorsSVG documents are text files, and can be edited like any other text file. Specifically, SVGs are XML documents, which have special support in many text editors. One potential disadvantage to editing SVGs by hand is that previewing your changes is more cumbersome. A rudimentary solution would be to open the SVG file in a browser while working on it, and manually refreshing the document to see the result of changes. InkscapeThere is a simple work-around for the scarcities of librsvg. The operation “Stroke to Path”, to be found under Menu>Path in Inkscape or via Ctrl+Alt+C, can be applied to all of the objects that are not rendered correctly. To keep the SVGs editable, this should only be done to the files intended for upload, and these files can be deleted afterwards. As of February 2014, the objects that must be modified to render correctly by librsvg include:
OpenOffice.orgOpenOffice.org SVG files may require manual modification before being uploaded to Wikipedia. To achieve this:
NB: Vector graphics line widths may also need to be set explicitly in OpenOffice.org Draw. SVG code replacement guide (executing replace all using Nedit regular expressions)
This SVG export procedure has been tested using OO 2.3.0 and OO 3.2.1 with a simple .odg candidate. Microsoft PowerpointIt is easiest to save entire slides from Powerpoint as svg rather than saving multiselected objects with right click / save as picture, because for entire slides the boundaries will be cropped to the size of the slide and the background will be set to white. To save slides as svg, use file / save as / browse / save as type –> svg. If your slide has text, open the exported svg into Notepad and replace all the existing font-family specifications with Text can also get chopped up on export, which causes rendering and localization bugs. To fix this, search for all Microsoft VisioGenerating SVG charts from spreadsheet programs such as Microsoft ExcelWarming stripes Warming stripes bar chart Waffle chart Bar chart Pie chart Variable-width bar chart Line charts Scatterplot Radar chart I’ve uploaded spreadsheets that automatically generate XML code for charts in SVG format. Summary: You simply paste or enter your data into the spreadsheet, and specify image dimensions, number of grid lines, data ranges, font sizes, etc. The spreadsheets instantly and automatically generate a column of XML code. You simply copy and paste that code into a text editor and save as an “.svg” file. The spreadsheets produce lean SVG code, and should save you time in creating SVG charts. Though my original spreadsheets are written in Microsoft Excel, I’ve received reports that they also work if read into other spreadsheet programs. Feedback and suggestions on my talk page are welcome. RCraig09 (talk) 23:41, 19 February 2021 (UTC) Click HOW TO for detailed explanation.
Click here to see an example of how the spreadsheets work, internally.
Example SVG files: Category:SVG graphics created with spreadsheet.
Text guidanceUse text over pathsConverting text in an SVG file into paths (shapes) increases file size, prevents localization/accessibility features, and complicates edits/modifications down the line. It is therefore generally disfavored, with some exceptions, such as text-based logos. The Wikimedia text renderer can introduce bugs as its fonts may differ from browser fonts or SVG editor fonts, but following the guidance below should minimize these errors. font-family propertyDue to copyright restrictions, MediaWiki cannot use proprietary fonts that are commonly found on several proprietary operating systems. Fonts such as Geneva require licensing fees to distribute. rsvg will not be able to locate such fonts, and the text will fail to appear in the rendered image. There are three solutions to this issue:
For ease of subsequent editing and significantly smaller file sizes, substituting the font with an available font is recommended. Many common fonts have non-proprietary alternatives that are similar in typographical style, resulting in minimal disruption to existing images during substitution. For a list of fonts available in Wikipedia, see available fonts on Meta. Wikimedia has default fonts, and will use Liberation Serif for Times New Roman and Liberation Sans for Arial. For further fallbacks see c:Help:SVG#fallback. Fonts that are available on Wikimedia servers may or may not be available on a visitor’s machine. If the placement or appearance of text in the image is important and there is uncertainty about which fonts are installed on a visitor’s machine, then converting text into path information may be necessary. font-size propertyfont-size="35" (or larger) appears to avoid this problem, depending on the pixel size of your graphic.Fonts should be sized so that they look good as thumbnails on wikipedia pages and so they are easy to view on smartphones. Smartphones are how most people access wikipedia. Thumbnails are how most other people see images, as very few people click images and zoom them in to see them. Avoid using or creating images with fonts that are too small to be legible in thumbnail or smartphone views. The font size that appears in a thumbnail is a combination of svg width, thumbnail width, and font size. To match wikipedia font size as a thumbnail, use font-size = (63/(your upright value))*((your svg width)/1000). For instance, if the thumbnail will be scaled up to thumb upright=1.35 and your image has svg width of 960, set font-size in the svg to (63/1.35)*(960/1000) = 44.8. Background colorsTransparent backgrounds are fine, but do not think your image will always be displayed on a light or white background. The wikipedia smartphone app, for instance, renders images on a black background, so if you show black text on a transparent background it will be invisible. Testing for problemsThe following SVG checkers may help you to detect SVG problems before you upload: None of these checkers are foolproof, so it’s wise to validate images. You can preliminarily validate images by uploading them to the shared, temporary-use location Test.svg, though other users may overwrite your image at any time. To force refresh images in your browser use Ctrl+F5 (Shift-Reload on Mac), so that you see the latest upload and not cached image copies (this is necessary even on wikimedia upload pages). Rendering SVG filesOn Wikipedia SVGs are interpreted by the librsvg-library to create PNG previews at different image sizes (to rasterize them). That library only recognizes a subset of all valid SVG syntax, and may render your SVG without many features. In order to bypass these deficiencies in the library, there are certain parameters that need to be formatted in specific ways or be assigned a workaround value in order for librsvg to accurately render views of your SVG file. Some issues are enumerated below, but be sure to test your SVG files before and after uploading them. _parameter_maskUnits="userSpaceOnUse"-Rendering_SVG_files”>The librsvg-library does not interpret the value of parameter stroke-dasharrayThe librsvg-library does not accept a _statements-Rendering_SVG_files”>
CSS selectors or identifiers must start with a letter or hyphenhttp://w3.org/TR/css-syntax-3 states, “Property names and at-rule names are always identifiers, which have to start with a letter or a hyphen…” Common problemsMisaligned textThe latest thumbnail-image-maker (named rsvg) unfortunately has a bug which misaligns centre- or right-aligned While developers work on a solution, here are some remedies in decreasing usefulness:
flowRoot does not appearIf a black box appears, read c:User:JoKalliauer/RepairFlowRoot how to solve this issue, but do not remove those objects since they might contain text. The workarounds that one can employ are either not to use flowed text (by using the text tool without creating a text field), or convert the text to normal text (by Text-editor or sed-command, or with Inkscape-GUI or with a Inkscape-batch), but to stroke the text using “object to path”, since path-text is not recommended and increases file-size. Missing embedded JPEG imagesWhen a raster graphic is embedded in an SVG it is encoded into base64 data. That data is then assigned a MIME type in the <image> element. In the case of an embedded JPEG, the MIME type is “image/jpeg”. Older versions of Inkscape (and possibly other editors) assigned the MIME type “image/jpg”. While Inkscape and most web browsers will display such an SVG image just fine, the MediaWiki software that rasterizes the SVG file will have trouble with it. Not recognizing the MIME type “image/jpg” there will simply be an empty space where the image is supposed to be. The fix is to open the SVG file in a text editor, find the <image> element, locate “image/jpg”, change it to “image/jpeg” and re-save. At right is an example of this problem. The Commons SVG Checker looks for this problem; see Commons:Commons:Commons SVG Checker/KnownBugs#Checks for details. Though Web browsers cope with image tags without width and height specified, librsvg ignores such images. Further issuesFurther issues can be found at c:Librsvg_bugs or at Commons:Commons:Commons SVG Checker/KnownBugs, and examples can be found at c:Category:Pictures_demonstrating_a_librsvg_bug. However most issues (for files <1MB) can be fixed using https://svgworkaroundbot.toolforge.org/ (enable “run svgcleaner” and enable “run scour” before clicking convert), for a more detailed list check c:User:SVGWorkaroundBot. | |||||||
Assistance
If you have a tricky SVG file with a problem not described, or can’t quite figure out what the previous section was talking about, you can simply ask for assistance by posting a quick note hereafter that outlines the problem, as well as providing links to the files that are exhibiting these problems. Don’t forget to sign your name with four tilde symbols (~~~~) and an editor will attempt to reply here to help!
When you are happy that a request has been fulfilled, just leave a note so that the request can be archived later, as needed.
An alternative source of help is Commons:Graphics village pump.
Current requests
Create a new request
PNG preview shows text shifted left by ~20px
The preview of this looks bad as the text is not aligned properly, however if you open the original file it looks fine. Having a look at the raw file, I don’t see anything obvious that would cause this. Best, Carlinmack (talk) 14:53, 17 May 2026 (UTC)
- @Carlinmack: The file uses the CSS declaration
font-family:Helvetica,Arial,sans-serifbut neither of the first two are installed on Commons. This means that it should use the fallback font specified at c:Help:SVG#Font substitution and fallback fonts, which is Nimbus Sans L. —Redrose64 🌹 (talk) 21:01, 17 May 2026 (UTC)- Thanks for spotting the bug. I was the image’s creator.
- The issue is http://phabricator.wikimedia.org/T370044 in which text non-uniformly scaled in vertical and horizontal directions is misaligned.
- I’ll work around the bug. cmɢʟee τaʟκ (please add
{{ping|cmglee}}to your reply) 09:28, 18 May 2026 (UTC)
rsvg messes up feDisplacementMap filter

Hi SVG experts,
As rsvg does not support textPath, I decided to curve text using an SVG filter with feDisplacementMap. (I had previously set the dy of each character, but that makes it difficult to translate the labels.)
It looks fine on the preview when uploading a new version on http://commons.wikimedia.org/w/index.php?title=Special:Upload&wpDestFile=Milky_Way_Arms_ssc2008-10.svg&wpForReUpload=1 as on Firefox, Chrome and Edge, but the text is badly and seemingly randomly distorted in thumbnails.
Could someone please have a look and suggest a fix? Thanks, cmɢʟee τaʟκ (please add {{ping|cmglee}} to your reply) 01:05, 12 November 2025 (UTC)
Repost due to https://commons.wikimedia.org/w/index.php?title=File_talk:Milky_Way_Arms_ssc2008-10.svg&diff=next&oldid=1116978713 cmɢʟee τaʟκ (please add {{ping|cmglee}} to your reply) 10:54, 24 May 2026 (UTC)
- @Cmglee: In the upload feature, the preview is generated by your browser – it’s not been sent to the Commons servers, so hasn’t been processed by rsvg at that point. —Redrose64 🌹 (talk) 20:14, 24 May 2026 (UTC)
Text is messed up.
My image (here) has all of the text shifted to the right and a little to the bottom.
- This is really frustrating.
- Why?
- How do I fix it?
It might show a deletion nomination with a reason “I uploaded it by mistake.” That was before I knew of this page. Inactive000 (talk) | Political and geographical. 14:12, 27 May 2026 (UTC)
- @Inactive000: Clicking the link leads to “File usage on Commons/There are no pages that use this file.”. —RCraig09 (talk) 14:41, 27 May 2026 (UTC)
- @RCraig09: I think this is the correct link. Inactive000 (talk) | Political and geographical. 14:55, 27 May 2026 (UTC)
@Inactive000: Nope. Maybe, you could just post the exact name of the image and we’ll track it down. Is it one of those shown at this search results page on Commons? —RCraig09 (talk) 17:15, 27 May 2026 (UTC)
- @RCraig09: I think this is the correct link. Inactive000 (talk) | Political and geographical. 14:55, 27 May 2026 (UTC)

- Assuming that c:File:Flag of North Korea (20-33 construction sheet).svg is meant, this image has several instances of the declaration
font-family:Arial,sans-serif. See my reply at #PNG preview shows text shifted left by ~20px above. In short: Arial is not installed on Commons. —Redrose64 🌹 (talk) 21:53, 27 May 2026 (UTC)
- Assuming that c:File:Flag of North Korea (20-33 construction sheet).svg is meant, this image has several instances of the declaration
- @RCraig09 Yes, that is what I mean. Inactive000 (talk) | Political and geographical. 22:00, 27 May 2026 (UTC)
- I have used
font-family="Liberation Sans,sans-serif"in many svg files. —RCraig09 (talk) 22:10, 27 May 2026 (UTC)- @RCraig09 Thanks for the tip.
- Also, thanks @Redrose64 for telling me the problem. I’ll upload the new image here as soon as I’m ready. Inactive000 (talk) | Political and geographical. 22:49, 27 May 2026 (UTC)
- Update: Uploaded it, can’t find it on Commons or Wikipedia. Seems like I’ll need help again. Inactive000 (talk) | Political and geographical. 23:09, 27 May 2026 (UTC)
- Surely it’s listed at c:Special:Contributions/Inactive000? —Redrose64 🌹 (talk) 13:09, 28 May 2026 (UTC)
- I’ll check that after I’m done with school today. Inactive000 (talk) | Political and geographical. 18:13, 28 May 2026 (UTC)
- I did not find it on my Commons contributions. I do think I might’ve found it, but if I did, it still looks the exact same. Inactive000 (talk) | Political and geographical. 23:29, 28 May 2026 (UTC)
- Well, if it’s not there, and not listed at c:Special:Log/Inactive000 either, I can only assume that you didn’t upload it to Commons. If you want help, it is essential that we are told the exact filename for which help is required. —Redrose64 🌹 (talk) 06:47, 29 May 2026 (UTC)
- I did not find it on my Commons contributions. I do think I might’ve found it, but if I did, it still looks the exact same. Inactive000 (talk) | Political and geographical. 23:29, 28 May 2026 (UTC)
- I’ll check that after I’m done with school today. Inactive000 (talk) | Political and geographical. 18:13, 28 May 2026 (UTC)
- Surely it’s listed at c:Special:Contributions/Inactive000? —Redrose64 🌹 (talk) 13:09, 28 May 2026 (UTC)
- Update: Uploaded it, can’t find it on Commons or Wikipedia. Seems like I’ll need help again. Inactive000 (talk) | Political and geographical. 23:09, 27 May 2026 (UTC)
- I have used
- @Inactive000:@Redrose64:@RCraig09: The original file uses
transform-box:fill-boxandtransform-originCSS properties which rsvg does not seem to support. I’ve remade and uploaded the file without them: 
cmɢʟee τaʟκ (please add{{ping|cmglee}}to your reply) 21:48, 31 May 2026 (UTC)- I cannot find either of these properties in the Scalable Vector Graphics (SVG) 1.1 (Second Edition) specification (W3C Recommendation 16 August 2011). The only place that I can find them described is in CSS Transforms Module Level 1 (W3C Candidate Recommendation, 14 February 2019). As has been described before, rsvg doesn’t recognise any CSS except for that explicitly described in either the SVG 1.1 spec, or in Cascading Style Sheets, level 1 (W3C Recommendation 17 Dec 1996, revised 11 Apr 2008). —Redrose64 🌹 (talk) 17:41, 1 June 2026 (UTC)





