Help talk:SVG

From Wikimedia Commons, the free media repository
Jump to: navigation, search

Please remember that this talk page is not for questions and answers.

It is intended for discussing improvements to the Help:SVG page.

Information icon.svg

The best place for questions and discussion about SVG is the Graphics village pump

Previous discussion[edit]

See Commons:Graphics village pump/November 2007#Proposal: an SVG How-to page for initial proposals for this page. ButterStick 23:29, 2 December 2007 (UTC)

Version 0.1[edit]

I've put up a very rough version to get things going. Be bold and edit it, please :D The IP that's in the page history is me (I forgot to sign in before editing).

There is a lot of overlap with Commons:Transition to SVG, though over time I see this problem being resolved. ButterStick 23:41, 2 December 2007 (UTC)


Add things here...

  • Colors
  • ViewBox
  • Image size
  • Setting monitor to sRGB color space in order to edit for Web

Undesirable Restrictions[edit]

The section Help:SVG#Creating_SVG_images_for_Wikimedia_Commons makes a generalization that Help:SVG#Bitmaps are a bad thing, inserting the opinions of a third party who is neither the image's author nor it's consumer. Should all of mankind's uses of imagery be restricted to those uses that have been witnessed and understood by a group of programmers? Some examples of svgs with bitmaps:

  1. map of Arid Badlands includes the reference image from which it is vectorized. In this capacity, the bitmap provides a measurement of accuracy, and a way for the consumer of the image to visually verify/validate the information presented.
  2. A vector graphic of the constellations, with bitmap renderings of the stars.
  3. A map of teeth in a mouth, with x-rays for each tooth.
  4. It might also be possible to use a self-contained bitmap as a thumbnail in future versions of the SVG interpreters.

AngleWyrm (talk) 16:48, 4 December 2009 (UTC)

Agreed that there are valuable uses, though I’d caution that it can easily be misused or done from expedience rather than because a bitmap is actually useful or necessary. I’ve re-written it more even-handedly in this revision.
—Nils von Barth (nbarth) (talk) 05:40, 23 June 2010 (UTC)


This may not be quite so simple. A problem with validation is that it will not be successful without a DOCTYPE declaration, but a man who knows, I think, says here that you don't want to do that. Globbet 01:14, 4 December 2007 (UTC)

I know a lot of validators just mentioned the doctype missing as a warning rather then an error, also mention that it's not strictly needed for SVG1.1 /Lokal_Profil 00:51, 8 December 2007 (UTC)


I think it may be a bit too dogmatic strong to advise avoiding metadata. The recent discussion at Commons:Graphics village pump/November 2007#SVG Metadata did not really come to that conclusion, (or any conclusion, for that matter). How about saying something like "it is not necessary for Wikimedia use because ..., but can be included if you want to" but more elegantly expressed? Globbet 01:31, 4 December 2007 (UTC)

I think it's good to have some metadata in your images. It doesn't take much space and can help in categorizing/finding/(re)using them. ZeroOne 11:05, 4 December 2007 (UTC)
I've removed the comment about avoiding metadata (since there seemed to be no agreement). As for filesizes it's probably better to recommend using the "Vacuum defs" function in Inkscape. Or mentioning which default values certain parametrs have so that these can be removed by "search and replaced" using a text editor (inkscape has an unfortunate way of defining every possible parameter for say stroke even though only the width and coulour are desired) /Lokal_Profil 00:57, 8 December 2007 (UTC)
Even though I personally don't like metadata in SVGs (totally a different issue than with formats that aren't human-readable), I support not advising one way or another right now. It's true it may be undesirable when editing SVGs to see them packed full of extraneous text, but I have to admit even I have found it useful in the past. In a few cases where I found some images I wanted to upload to Commons, there was no notification of the license—except when I viewed the source. Of course this isn't an issue for Commons, but once our images leave here it can be. As long as people tend to disregard what the license requires, there's a good case for including metadata. Personally, this isn't a good enough reason, but I know others think differently, so, as for an "official" stance on the issue, it's best to leave it up to the author(s). Some have their reasons for including it, some have their reasons for not including it. As long as it doesn't become excessive or cause copyright issues, I guess the rest of us can live with it. :) Rocket000 21:34, 2 January 2008 (UTC)
BTW, I should also mention I have found visible watermarks useful in the past, too. (Like when the uploader doesn't give the source, yet there it is stamped across the image.) You can see what I put about this on a related page, Ownership of pages and files (the last part). That's not SVG specific, but I think it's pretty much what we should be saying here (if we say anything). Rocket000 21:43, 2 January 2008 (UTC)

About adding new FAQs[edit]

Should I add new FAQs into the page even if I don't know the answers? I'm thinking of "My image has some unintended black boxes in it, how do I get rid of them?" and "My texts float into wrong places or show up very wrongly sized, how to fix them?". ZeroOne 11:03, 4 December 2007 (UTC)

In my opinion you shouldn't.
  • Slightly facetiously, a question is not a FAQ until it is asked frequently.
  • And an unanswered question probably does not qualify as help.
  • I don't think a FAQ is the best long term format for a help page. It serves well enough as an add-hoc, easily built arrangement, but it is not as good as a carefully laid out logical exposition of the subject.
  • Individual questions are more ephemeral than I think we want here, and should be asked and dealt with at Commons:Graphics village pump: we need to be on guard against this discussion page getting cluttered up with questions.
On the other hand, this page is new and does not have a lot of content yet, so if it seems that the problem and solution would be of general help, then suggest it here for discussion, which may be slower but may allow several heads to ponder whether and how to add it, or, if there is an answer, work out how to explain it well and just go edit. This depends to some extent on how much editorial effort the page attracts. Globbet 00:22, 5 December 2007 (UTC)
Well, I've asked the latter question twice and never got an answer. I've also asked the former question once and the same question is on Commons:Graphics village pump at the moment, too. But I agree that an unanswered question doesn't qualify as help... So maybe we could just list those questions on this talk page and then move them into the help page if they ever get answered. And yes, some careful prose is usually better than a list of FAQs, but for now the FAQs should do fine... We could also separate them into, say, Help:SVG FAQ and reserve this page for prose. ZeroOne 12:08, 5 December 2007 (UTC)

Commons:Tutorial for Vectorial graphism[edit]

I have added a link to this page. It is interesting and partially overlaps the purpose of this page but I think it is archly named. Some of the stuff at the top introducing SVG might well be moved and adapted here, leaving the rest to be renamed as an introductory Inkscape tutorial page. Help:Inkscape introduction, perhaps. Globbet 01:05, 5 December 2007 (UTC)

That tutorial looks and sounds like something that could be hosted in Wikibooks. The Inkscape introduction, too. ZeroOne 12:09, 5 December 2007 (UTC)
Here's something else you may be interested in: meta:Talk:Philip Greenspun illustration project/Requests#FLOSS Manuals. I mentioned the Inkscape WikiBook there, but it's not much. There seems to be a lot of people trying to get some tutorials written, and there's definitly a need, we just need to start putting our resources together. Rocket000 21:56, 2 January 2008 (UTC)

No more SVG?[edit]

SVG-Pictures aren't renderd also they work with rsvg on my machine. Example: Image:Wertachtal.svg, Image:Netzwerkanalyse beispiel.svg --Mik81 16:22, 4 January 2008 (UTC)

Problem found, external referenc to a second png-File. Inkscape doesn't want to import correctly --Mik81 16:46, 4 January 2008 (UTC)
Yes, it's best never to mix bitmaps and vectors. Rocket000 21:04, 4 January 2008 (UTC)

Multiple Language SVG[edit]


I made a SVG-file with support for multiple languages, so it can easily be translated and used in other languages IN ONE FILE. With the code:

 <text y="20" systemLanguage="de">vor</text>
 <text y="20" systemLanguage="fr">avant</text>
 <text y="20">before</text>

every language can be added and depending on the language setting of a SVG-supporting browser you'll have the image in your language. ([Example]) Unfortunatly, by the conversion of SVG to PNG the chosen language is always english. Will there be a possibility to include real multi-language-SVGs in WikiCommon? --Ffsepp (talk) 15:36, 8 September 2008 (UTC)

That's a good question. The text without the systemLanguage attribute, English in this case, is considered the fallback measure when the language of the software program cannot be determine. A PNG converter probably doesn't have a language key so this is why the switch element uses the English text, in your example, as the default text. Wgabrie (talk) 21:17, 8 September 2008 (UTC)
Yeah, the behaviour is right, but especially for a page like commons the multi-language-feature is great. Are there any plans to remove the converter since every browser exept IE is now supporting natively SVG? --Ffsepp (talk) 22:05, 8 September 2008 (UTC)
It would be nice, but probably no (or at least, not yet). Many SVGs run into megabytes compared to bitmaps which probably would be smaller. Spadeparty (talk) 06:14, 6 November 2008 (UTC)
Are there any news for this? Is Commons supporting this feature now? That would be really great!!! --Perhelion (talk) 11:01, 13 May 2010 (UTC)
I looking forward for this feature. It would be very easy to implement. It is possible to use "uselang" URL parameter to make things happen. But will they? BPK (talk) 01:15, 8 August 2011 (UTC)
If size matters, the server may compare and send the smaller one (which in case my svg files is the svg ;-)
There may be an opt-in mechanism for registered users. – Rainald62 (talk) 16:08, 9 October 2011 (UTC)
This is supported now. (Thanks to user:Jarry1250). You can now use syntax like [[file:Foo.svg|lang=de]] Bawolff (talk) 03:12, 11 November 2013 (UTC)


Is there rather too much detailed instruction on categorization in this article? I see no discussion here, who decided on the scheme, and on what basis? Would all this, if necessary at all, not be better elsewhere? Globbet (talk) 00:30, 17 December 2008 (UTC)

yes, I did it once just as a sum up of completely undocumented stuff - in fact its no kind of policy at all, and there was neither discussion nor decision at all, its just some hints about what we've got by now --W!B: (talk) 02:52, 17 December 2008 (UTC)

in fact, I'd suppose categorizing, as its done by now, for useless: to my feeling, there is no sense of ripping categories apart (by now you have to look up eg. both Cat:Maps of China and Cat:SVG maps of China to find a image you need)
I'd suggest to remove all SVG cats, and just tag {{SVG}}: so we could use CatScan in any category to find out which media is svg - whould be much more easy than mirroring our complete category structure in a SVG-branch, which always will be inclomplete --W!B: (talk) 02:52, 17 December 2008 (UTC)

Stupidly, tag {{SVG}} redirects to {{Convert to SVG}}. The former should surely just be something informative about SVG, no? Globbet (talk) 22:37, 12 July 2009 (UTC)

Vector magic no longer free[edit]

The help page says that Vector magic is free, but it is no longer so. If an editor here is using this tool anyway, an explanation of the charges would be helpful. Apparently, they do offer a few free conversions to allow potential customers a chance to try their service.

The link above doesn't seem to work. Was found here:
Perhaps they can't be bothered to provide a redirect page to their for-profit product.
May be fine print elsewhere; the home page says:
Free to try, no signup necessary, and results ready right away.
Is a link to this site linkspam if they are truly providing what appears to be this free service?
-Wmc824 (talk) 15:11, 30 January 2011 (UTC)

scripted SVGs allowed or not?[edit]

The page states several times that scripted SVGs are not accepted; however, there are examples of scripted SVGs, e.g., Image:Ampel.svg. Shouldn't the text be adapted? --Martin (talk) 12:29, 15 July 2009 (UTC)

I think they squeaked in before the Mediawiki software was changed to prevent them. I have tried uploading files containing scripts and not been able to, but do not intend to waste time trying to break in. I am no cracker, anyway. Ideally, of course, it is the software that wants to be adapted to let perfectly safe scripts in. Globbet (talk) 17:36, 15 July 2009 (UTC)
Thanks for the explanation! --Martin (talk) 11:59, 16 July 2009 (UTC)

SVG-logo template from en[edit]

en:Template:SVG-logo Is there any reason to have a similar template on the commons? ~ PaulC/T+ 18:05, 13 September 2009 (UTC)

interesting presentation about Wikimedia and SVG[edit] --Kolossos (talk) 22:37, 9 October 2009 (UTC)

Inkscape problem[edit]

I'm running out of ideas regarding the ugly black rectangle in an image I've uploaded (repeatedly, by now...) at - I gather from Help:SVG that

"Text in Inkscape by default uses a Flowed Text box which can result in problems (it will likely not render at all or render as a large black rectangle). To fix this, simply use the Convert To Text command in the Inkscape Text menu."

- but I've tried everything now: Converting to Text. Re-writing without moving my mouse. Converting to a path. That rectangle just keeps re-appearing in the same spot. (And yes, I'm saving as plain svg.) I'm using the newest stable Inkscape (0.46) on a Mac (Leopard). And this is supremely frustrating - I'm trying to get a bunch of images done for an astronomy article, instead I'm stuck uploading umpteen versions of the same stupid black rectangle. Any help would be greatly appreciated. As2Wi (talk) 00:20, 19 November 2009 (UTC) 

✓ Done, by using a text editor to delete an empty (and invisible and unselectable!) flowRoot and flowRegion rectangle that causes problems in Firefox 3.5.5 but not Opera. Somehow Inkscape left that element in the file even though it should have no effect as it contained no text. I guess that a Flowed Text box was created at the beginning, and the text inside was deleted, but that Inkscape failed to then delete the wrapper. To complicate matters Firefox's implementation of SVG fills the empty box with black. Google Chrome and Opera rendered all versions correctly. -84user (talk) 07:49, 19 November 2009 (UTC)
Great! Many thanks! And it's good to know the way to get rid of stuff like this in the future. As2Wi (talk) 10:17, 19 November 2009 (UTC)

How SVGs work in MediaWiki[edit]

In this section there is a broken link to rsvg-view. Also, it says "If you want the SVG file you must save the link to the image instead of the image itself." But how do you do this?--RockMagnetist (talk) 14:11, 5 October 2010 (UTC)

I have added "by right mouse clicking on the link under the image". For example File:Example.svg‎ has the line "Example.svg‎ (SVG file, nominally 600 × 600 pixels, file size: 10 KB)". You would right-mouse click the blue "Example.svg‎" link. -84user (talk) 17:03, 5 October 2010 (UTC)
Oh - I misunderstood the statement. I thought it was telling me how to access the SVG file from a Wikipedia article. I would like to do that because the PNG conversions are terrible.--RockMagnetist (talk) 17:40, 5 October 2010 (UTC)
I could not find a way to do this using the existing gadgets in Wikipedia:Special:Preferences. You would need to create a link using the Media:namespace to "link directly to a file". I made a quick example at Wikipedia:Extended image syntax#Link. -84user (talk) 18:21, 5 October 2010 (UTC)
MediaWiki talk:Stockphoto.js is now tracking feature requests for the recently installed Share this feature, and it has "Version for Wikipedias to show on transcluded pages" which *might* give what what you are asking for, if transcluded is extended to include thumnbnails. -84user (talk) 18:49, 5 October 2010 (UTC)
I tried using your syntax (and some variations from Wikipedia:Images linking to articles) and I don't get a direct link to the SVG image. One difference I see between my media page and yours is that I have an explicit link to the SVG and you don't. I would really appreciate it if you would look at my link to Media:SingleDomainMagneticCharges.svg in Wikipedia:Demagnetizing field and show me how to fix it.--RockMagnetist (talk) 18:56, 5 October 2010 (UTC)
My placing of the example in the "link=" section was misleading: Media:Example.svg does not gives a direct link when used after "link=", only when used in plaintext so to speak. I tried a clunky workaround using imagemap to create a direct link to the SVG file in Wikipedia:en:Demagnetizing field#Single domain but this link will not update when a new version is uploaded.
I do not think Mediawiki has a way to force the link= to be a direct URL to a media file like this (even hard-coding the full url fails). But are you also asking for the wikimedia server to send your browser the actual SVG file so that the browser performs the rendering? That desirable feature has been requested in long-standing bug 3593, linked from Wikipedia:Wikipedia:Village pump (technical)/Archive 36#Serving SVG images themselves instead of rasterizations. One possibility is some javascript such as prototyped by User:TheDJ in 2008 being added to wikipedia's Monobook.js. Try asking at Wikipedia:Wikipedia:Village pump (technical). -84user (talk) 00:19, 6 October 2010 (UTC)
Thank you for your help, 84user. This all sounds so tricky! Would I be better off uploading PNG files? I have made scores of images for peer-reviewed publications and I have never had so much trouble getting them to look good. Usually I create PDF files.--RockMagnetist (talk) 01:46, 6 October 2010 (UTC)

This section could also have some explanation of the dimensions of the PNG images. For example, File:CategoricalProduct0x0Test0.svg has the sentence "This image rendered as PNG in other sizes: 200px, 500px, 1000px, 2000px." More correctly it should be "other widths" rather than "other sizes". Where do these widths originate? Why not 100 px wide also? Are all SVGs rendered to these widths? Regards, ... PeterEasthope (talk) 17:37, 10 October 2012 (UTC)

SVG software tagging[edit]

When is it appropriate to use those tags? Is it ever appropriate to specify what software was used? I think not! Many files are only converted. The same is, if someone makes a (minor tweak) editing tweak with other software? -- πϵρήλιο 01:15, 3 August 2011 (UTC)

I never use them. The only tag of real importance is valid SVG. I agree it should only be used if it is either vectorized or created from the ground up. -- RE rillke questions? 09:48, 3 August 2011 (UTC)

"upcoming SVG 1.2 standard"[edit]

It's not "upcoming" any more -- "SVG 1.2 Tiny" has now been changed to be completely independent from "SVG 1.2 Full", while "SVG 1.2 Full" itself was never officially adopted (and the current working draft hasn't been updated for over seven years), and the next official standard will apparently be called SVG 2.0... AnonMoos (talk) 16:36, 4 July 2012 (UTC)

Scrubbed with[edit]

Isn't it worth while to establish a template and a hidden category for these optimized files? --Maxxl2 (talk) 19:12, 15 September 2012 (UTC)

I really think not. I see really no reason, for example in contrast to Category:SVG Simplified!? -- πϵρήλιο 23:00, 15 September 2012 (UTC)
There is a difference. The intro of Category:SVG Simplified says: This category is intended to show examples of manually drawn SVG graphics .... Isn't that reason enough to form a new category? --Maxxl2 (talk) 11:05, 16 September 2012 (UTC)
Symbol oppose vote.svg Oppose Yes for sure, I know that there is a difference, the difference is that this category is usefully. Can you please more characterize this reason!? I still can not see them. There is no comparable category "automatically saved/optimized ... graphics" ... Thats like a job for a bot, so this is like a hidden bot category!? Anyway if we assume only hypothetically, that there is this category who will all inspect and maintain? And in general I've always automatically saved with Scour. So I would have to categorize all my SVG files afterwards? And alone, what are the real reasons to optimize with Scour? Also then this category should have another pointless template for all this SVG. -- πϵρήλιο 13:53, 16 September 2012 (UTC)
Thanks a lot for the enlightment. I've learned from your experience and explainations today. Yes, you are right, it was just an idea to be discussed and that is sufficiently done by now. --Maxxl2 (talk) 12:08, 17 September 2012 (UTC)

new rsvg[edit]

This should purge a lot of thumbnails and we now have a new rsvg on one imagescaler out of seven (?), so please give a look to Category:Pictures showing a librsvg bug to see if there are more/less/new errors. --Nemo 06:15, 11 October 2012 (UTC)

Not all layers renders, Inkscape[edit]

I have a pretty complicated image download here that has some problems. When I try it in the tool for check rendering in wikimedia it doesn't render all my layers. It's the same with the thumbnail in a folder when I view it as icon (ubuntu 12.04). I have tried to find out which layers that is the problem but they all work one by one but not together. I "think" the problem could be in some of those layers; 8, 1 from left,right top side, text 14pt lines, number 26pt lines but I'm really not sure. I have used Path/Union, Difference and so on (read that this could be a problem) and there are gradients, maybe 20 or so.
Path/Union, Difference and so on and gradients have I used in most of the stuff I have made here so I can't really understand this.
I have tried to save it as Plain svg, less layers and a other things but nothing helps.
If anyone have any idea of what to do or look for I would be very very thankful. --Goran tek-en (talk) 13:50, 27 February 2014 (UTC)

✓ Done I found the problem after some deep search. --Goran tek-en (talk) 17:00, 2 March 2014 (UTC)
Hello Goran tek-en, can you please tell more!? Thank you -- Perhelion (talk) 21:06, 2 March 2014 (UTC)
It will be some of a story. I run ubuntu 12.04 so from my understanding this uses the same lib as wikimedia does for rendering svg to bitmap.
  • I started of with an empty Inkscape document with EXACT (I had to adjust it in the code (opened as text)) the same page size as the one with the problem.
  • Then I had both documents open and a window with the folder containing the two documents viewed as icons.
  • I then copied one layer at the time from the document with the problem pasted it into place in the new document and saved a copy into that same folder and looked at the icon. If the icon rendered OK then I had no problem in that layer.
  • I then added layer by layer and when saving a copy making sure all of the added layers was visible so I could see if it rendered well. When I found a layer with problem I removed "half of that layers drawing" and saved a copy. Did it save OK I knew the problem was in the half removed (or the other way around) and I then had to remove half of that and so on until I found the path or what was the problem.
  • So it was basically a slow tidies work to break down each layer into parts to be able to find the piece that was the problem. If you don't run ubuntu you can use this tool svg check because it does exactly the same thing when it comes to rendering.
I'm not sure if I made myself clear on how I did it but if not just ask what and I will try to explain in some other way. --Goran tek-en (talk) 22:50, 2 March 2014 (UTC)

Onmouseover effects - script?[edit]

I recently tried to upload an SVG, which was blocked by a warning that it contained code or scripts which might not be displayed property with all browsers. It looked like a warning but acted as an absolute block.

I know that scripts are not permitted in images. Using Inkscape I added to an SVG image an action "onmouseover", which comes out in the XML code for the object as:

onmouseover="" onmouseout=""

I was not aware it would be deemed a script, if indeed it is. Is it?

Mouseover effects can be an effective way to display information. They can be misused: it would be possible to hide a pornographic image beneath an innocent scene, to be revealed when the mouse passes over, and this would not necessarily be spotted by those who vet new uploads. (I was just getting areas of a map to light up.)

Does this mouseover effect count as a blocked script?

Hogweard (talk) 20:21, 1 April 2014 (UTC)

Yes, this is an interactive event handler, although the same can be resolved in HTML also by employing CSS only. For putting information up you can use the Help:Gadget-ImageAnnotator. -- Perhelion (talk) 13:26, 11 April 2014 (UTC)

#Cleaning up SVG-files to W3C-valid[edit]

Cross-link: I completely disagree with most, see → User_talk:Wereldburger758 -- Perhelion (talk) 13:10, 11 April 2014 (UTC)