Commons:Transition to SVG
From Wikimedia Commons, the free media repository
The MediaWiki software running on our Wikimedia project wikis is enhanced to deal with SVG (Scalable Vector Graphics).
SVG has these advantages:
- It is not a pixel-based image file format and thus is scalable to any size without quality loss.
- SVG is a much better fit with wiki editing because unlike raster images it is fairly straightforward to edit SVGs.
- Since Wikimedia projects are intended to be free content SVGs are important because a raster image that is difficult to modify is not free.
SVG has these disadvantages:
- Problems with SVG images of poor technical quality have also caused more serious problems sometimes and limits have been set for SVG rendering time to try to limit this harm.
- The servers cannot render all types of SVG features, so the generated PNGs are sometimes not as the author intended.
Even with the disadvantages of SVG, it is good to encourage the use of lossless image formats, so there is merit in providing SVG alternatives and encouraging people to use them. To request a raster image to be converted to SVG, add the label {{convert to SVG}} to its description page.
Contents |
[edit] Flags
As flags are used heavily in all Wikimedia projects they need at first to be replaced with the SVG-version there. So basically you have to do the following steps:
- Check that the policy on the project you want to change wants this change. If it does not, you must not make the change at that project. The project policies rule when there is a conflict with preferences here. If there is no policy or you don't find it, ask first! Wikinews is one project which does not want this, in part because it needs a complete and accurate historical record of exactly what its old stories contained!
- Go to Category:Flags take your nation/country/city whatever flag that is interesting to you and look if there is already a replacement SVG-version of it in Wikimedia Commons.
- If not, go to http://www.openclipart.org/ or create an own SVG-version of the flag (e.g. with Inkscape) and upload it to Wikimedia Commons.
- Mark the description page of the pixel-flag-version with a hint that there exists an SVG version, using the {{vector version available}} template. This suggests that people use the SVG version if practical. (You can use {{SupersededSVG}} instead if you are sure that the SVG is superior in every respect and that the server renders it correctly to PNG.)
- Give people and projects time to replace the image if they want—many months because it takes time to discover and decide.
- Go to http://tools.wikimedia.de/~daniel/WikiSense/CheckUsage.php and look up the current usage of the pixel-version-flag. Change the image links in articles to the SVG version, starting with those on your own project. Remember to ask for help from others on your project, as conversion is a lot of work.
[edit] Bots
The many bots that run on the wikis are very capable of this task and bot operators tend to be very eagerly willing to help and show off their monsters where they can. Make sure that you leave a message in the Village Pump of each project requesting bot help if it's available. Also, many, if not all, of the bot operators habitually read this mailing list and your request may be especially effective there. It takes a bot, depending on many different factors, from a few hours to perhaps a day to run through the whole Wikipedia replacing images; it takes a human eons and they're in a bad mood when they finish.
Please remember that a bot needs specific permission from every project in which it operates and that permission must be given for each different task the bot does. There is no permission which applies for all projects and all uses of a bot. Operating a bot on all projects is likely to get the bot and/or its operator blocked on all projects as an emergency measure if it breaks policies on the wikis where it is being used!
[edit] Notes
There have been complaints about PNG images being replaced by inferior quality SVG images, or even by factually incorrect ones. Especially the latter is not acceptable by an encyclopedia project. Make absolutely sure that the quality of the replacement is the same or superior to the original, before marking it as redundant.
PNGs shouldn't just be replaced en masse the instant an SVG replacement becomes available. It is often sufficient to label the image description page with a {{vector version available}} tag, and it will be migrated over to the SVG version by editors where appropriate.
[edit] Limitations
MediaWiki SVG support has serious limitations when it comes to rendering:
- The marker tag (<marker>) isn't supported correctly so that e.g. arrows aren't displayed. This can be worked around by converting the relevant arrow to a path. To do this in Inkscape, select the path containing the arrow, then choose Stroke to Path from the Path menu.
- Text flow (<flow...>) is not supported - use <text> instead. In general, problems with text rendering can be fixed by converting the text to a path, but this has the following disadvantages:
- The file size increases dramatically.
- The text is not searchable as text any more.
- The Gaussian blur filter is not supported. (blurred objects do not show up at all).
When uploading SVG images an additional PNG version might be appropriate.
These and other bugs should be reported at the librsvg (GNOME) bugzilla, and example images get a tag Category:Pictures showing a librsvg bug.
[edit] See also
- Commons:CommonsProject Insignia for coordination with all aspects of insignias.
- SVG for more text and other links
- Top 200 Images that should use vector graphics by usage
- Top 200 Non-Icons which have a Vector version available by usage
- Top 200 Images which have a Vector version available by usage


