Community Wishlist Survey 2023/Multimedia and Commons/Native SVG support
Appearance
Native SVG support
- Problem: SVG files are currently rendered out as PNG files on pages that use the image.
- Proposed solution: Embed the SVG into the page output, only using PNG as a fallback on devices that don't support SVG.
- Who would benefit: Readers on various devices when zooming in on the image within an article.
- More comments: Currently SVG files are rendered out in a fixed resolution PNG file which, when scaled, suffers from the usual issues when zooming into a raster image. Embedded SVG (allowing clients/web browsers to render the images instead) would allow these images to be scaled infinitely with the only restriction being the client/browser.
- Phabricator tickets: T5593 (see related tickets)
- Proposer: —Locke Cole • t • c 18:59, 23 January 2023 (UTC)
Discussion
- I wonder how worthwhile it would be to give users the option to forcibly use the PNG fallback for individual images if performance improvements are necessary, such as
[[File:Example.svg|forcepng]]
. -BRAINULATOR9 (TALK) 19:52, 23 January 2023 (UTC)- We can't rely on that. If someone adds a 28MB SVG to the frontpage... there has to be some sort of technical protection against that. Also we have the problem with fonts not being consistent across browsers, so for that you also need some sort of processing before you can have files included (these are details which are already mentioned in the relevant tickets). —TheDJ (talk • contribs) 19:54, 23 January 2023 (UTC)
- Just a clarification. I think this wish is very much doable. But it's going to be a little bit more involved than 'just switch to the original svg'. Will easily take a few weeks of work. —TheDJ (talk • contribs) 23:48, 26 January 2023 (UTC)
- Huh? I'm talking about, if this proposal is implemented and SVGs default to being rendered as SVGs, then the option should exist to use the PNG format as a fallback. -BRAINULATOR9 (TALK) 18:16, 16 February 2023 (UTC)
- @Brainulator9: I understand what you're asking for, but is there a reason someone concerned about that couldn't just simply upload a PNG rendering of the SVG for such a use-case? I think @TheDJ and I are thinking of technical restrictions to (as TheDJ suggested) limit gigantic SVG files from being sent as-is. But if there's some edge-case where a PNG is desired, simply uploading a PNG and then the SVG source for future editors to make changes to as-needed would suffice, no? —Locke Cole • t • c 18:41, 16 February 2023 (UTC)
- That could work, as long as the end users remember to update the PNG fallback alongside the SVG original. -BRAINULATOR9 (TALK) 02:01, 17 February 2023 (UTC)
- @Brainulator9: I understand what you're asking for, but is there a reason someone concerned about that couldn't just simply upload a PNG rendering of the SVG for such a use-case? I think @TheDJ and I are thinking of technical restrictions to (as TheDJ suggested) limit gigantic SVG files from being sent as-is. But if there's some edge-case where a PNG is desired, simply uploading a PNG and then the SVG source for future editors to make changes to as-needed would suffice, no? —Locke Cole • t • c 18:41, 16 February 2023 (UTC)
- I definitely think there should be a cutoff for how large of an SVG we'd want sent to clients. For all SVG < 32KB *or* where the SVG is smaller than a PNG, I'd presume we just send the SVG. For situations where the SVG is larger than 32KB AND the PNG is smaller, then it might make sense to send the PNG still. 32KB is a purely arbitrary number, I'd hope we'd look at the existing average sizes of SVG files throughout the projects and do some data crunching to come up with a number that makes sense. —Locke Cole • t • c 19:59, 23 January 2023 (UTC)
- We can't rely on that. If someone adds a 28MB SVG to the frontpage... there has to be some sort of technical protection against that. Also we have the problem with fonts not being consistent across browsers, so for that you also need some sort of processing before you can have files included (these are details which are already mentioned in the relevant tickets). —TheDJ (talk • contribs) 19:54, 23 January 2023 (UTC)
- There's a script I used to test how native SVGs would work on Wikipedia... and they worked okay unless they were detailed geo maps with many tiny polygons, in which case large parts of the wikipage would stop rendering, text and pics. This is the code for your common.js:
//mw.loader.load( '/w/index.php?title=User:Opencooper/svgReplace.js&action=raw&ctype=text/javascript' );
ponor (talk) 21:27, 23 January 2023 (UTC) - Why can't Wikipedia clean up svg pictures before uploading them to the server? There are resources with an open license such as SVGo. This will ensure the safety of this format of images. It is also possible to make a limit on the size of uploaded svg for example in 56Kb (talk) 12:07, 26 January 2023 (UTC)
- Limit the size of the SVG is not a good idea. Or at least if limited, should be some reasonable big number (at least 25-30 MB). I have some maps in svg that require details and easily go over 10-15 MB. Ikonact (talk) 08:33, 27 January 2023 (UTC)
- It's will be awesome, because SVG is can contain not only vector graphics, but also animated and also interactive graphics. Although, it was a security and peroformace issuie if WP will embed every SVG image. Maybe, we need special tag or something for svg-images, that checked for issues to decide, embed this image into page or make png thumbnail.--Tucvbif (talk) 15:38, 11 February 2023 (UTC)
- I understood
embedding SVGs
to mean "using the original SVG wherever PNG thumbnails are currently being used". That being said, there's no risk of interactive graphics screwing with the page, as an SVG's code needs to be embedded directly into the page in order to respond to user activity. Moreover, this feature wouldn't introduce new security issues, as WP already blocks SVG uploads that contain scripts and other "problematic" content. Alhadis (talk)
- I understood
Voting
- Oppose —2dk (talk) 18:58, 10 February 2023 (UTC)
- I wasn't aware this was even an option. Guess I need to go oppose a bunch of things. —Locke Cole • t • c 22:04, 10 February 2023 (UTC)
- Support Tol (talk | contribs) @ 20:45, 10 February 2023 (UTC)
- Support Strainu (talk) 21:23, 10 February 2023 (UTC)
- Support Geert Van Pamel (WMBE) (talk) 22:03, 10 February 2023 (UTC)
- Support Magnoliasouth (talk) 22:09, 10 February 2023 (UTC)
- Support Pamputt (talk) 22:25, 10 February 2023 (UTC)
- Support SHB2000 (talk | contribs) 23:12, 10 February 2023 (UTC)
- Support Boehm (talk) 23:30, 10 February 2023 (UTC)
- Support عُثمان (talk) 23:49, 10 February 2023 (UTC)
- Support --Tinker Bell ★ ♥ 00:18, 11 February 2023 (UTC)
- Support Yeeno (talk) 02:10, 11 February 2023 (UTC)
- Support XtexChooser (talk) 02:42, 11 February 2023 (UTC)
- Support Hehua (talk) 03:04, 11 February 2023 (UTC)
- Support * Pppery * it has begun 03:55, 11 February 2023 (UTC)
- Support Hans5958 (talk) 05:14, 11 February 2023 (UTC)
- Support EpicPupper (talk) 05:20, 11 February 2023 (UTC)
- Support Goliv04053 (talk) 06:48, 11 February 2023 (UTC)
- Support Doktor Züm (talk) 09:22, 11 February 2023 (UTC)
- Support Globbet (talk) 09:28, 11 February 2023 (UTC)
- Support MoreInput (talk) 13:00, 11 February 2023 (UTC)
- Support RVA2869 (talk) 13:13, 11 February 2023 (UTC)
- Support Lion-hearted85 (talk) 13:15, 11 February 2023 (UTC)
- Strong support Alhadis (talk) 13:17, 11 February 2023 (UTC)
- Support OwenBlacker (Talk) 15:02, 11 February 2023 (UTC)
- Support Ayack (talk) 15:12, 11 February 2023 (UTC)
- It is doubtful --Tucvbif (talk) 15:38, 11 February 2023 (UTC)
- Strong support Waldyrious (talk) 20:59, 11 February 2023 (UTC)
- Support MASUM THE GREAT (talk) 21:13, 11 February 2023 (UTC)
- Support Veikk0.ma (talk) 22:01, 11 February 2023 (UTC)
- Support No problems considering the SVG advantage. Thingofme (talk) 03:39, 12 February 2023 (UTC)
- Support Betseg (talk) 04:10, 12 February 2023 (UTC)
- Support HLFan (talk) 07:42, 12 February 2023 (UTC)
- Support Mauricio V. Genta (talk) 07:57, 12 February 2023 (UTC)
- Support TFerenczy (talk) 08:12, 12 February 2023 (UTC)
- Support Arnd (talk) 08:37, 12 February 2023 (UTC)
- Support Likibp (talk) 08:49, 12 February 2023 (UTC)
- Support especially useful for animated SVGs Dexxor (talk) 10:01, 12 February 2023 (UTC)
- Support Maxwxyz (talk) 11:17, 12 February 2023 (UTC)
- Support Fvtvr3r (talk) 14:30, 12 February 2023 (UTC)
- Support Nyat (talk) 16:48, 12 February 2023 (UTC)
- Support Jusore (talk) 21:26, 12 February 2023 (UTC)
- Support Very important, since in mobile mode it is very complicated to reach the original full scale image. A11w1ss3nd (talk) 21:27, 12 February 2023 (UTC)
- Support Izno (talk) 08:17, 13 February 2023 (UTC)
- Support Tacsipacsi (talk) 20:59, 13 February 2023 (UTC)
- Oppose Meganinja202 (talk) 15:32, 14 February 2023 (UTC)
- Comment : I Oppose because it would ruin support of direct liking of a CC media, some people use CC photos as references in other sites (mostly forums), on those sites SVG is not even close to be supported as PNG is
- PNG is more accepted in general
- Unless SVG becomes more accepted, i will oppose to this, as it goes against the idea of provide free sharable images for everyone Meganinja202 (talk) 15:36, 14 February 2023 (UTC)
- SVG has been around for decades. Every major browser supports it. I'm not sure opposing for how non-Wikimedia sites use our content is even a valid reason to oppose here, as this is a wishlist survey for the community here. Is there a reason direct SVG would be a net negative for the Wikimedia community? —Locke Cole • t • c 18:38, 14 February 2023 (UTC)
- Support Sometimes I download the thumbnail instead of the original SVG image, which I want to edit. ZandDev (talk) 18:27, 14 February 2023 (UTC)
- Support Labdajiwa (talk) 00:15, 15 February 2023 (UTC)
- Support --Polarlys (talk) 21:24, 15 February 2023 (UTC)
- Support β16 - (talk) 17:44, 16 February 2023 (UTC)
- Support ಮಲ್ನಾಡಾಚ್ ಕೊಂಕ್ಣೊ (talk) 17:50, 16 February 2023 (UTC)
- Support Tbartovic (talk) 20:24, 16 February 2023 (UTC)
- Support Kays (talk) 02:05, 17 February 2023 (UTC)
- Support cyrfaw (talk) 13:59, 17 February 2023 (UTC)
- Support. stjn[ru] 14:02, 17 February 2023 (UTC)
- Support Kurmanbek 💬 17:11, 17 February 2023 (UTC)
- Support —CX Zoom (A/अ/অ) (let's talk|contribs) 19:54, 17 February 2023 (UTC)
- Support Daniel Case (talk) 06:27, 18 February 2023 (UTC)
- Support Herbert Ortner (talk) 12:41, 18 February 2023 (UTC)
- Support Vulcan❯❯❯Sphere! 15:55, 18 February 2023 (UTC)
- Support Albinfo (talk) 21:28, 18 February 2023 (UTC)
- Support with fallback to PNG for large SVGs Dominic Z. (talk) 17:36, 19 February 2023 (UTC)
- Support Scewing (talk) 21:05, 19 February 2023 (UTC)
- Support —TheDJ (talk • contribs) 10:35, 20 February 2023 (UTC)
- Support Watty62 (talk) 17:58, 20 February 2023 (UTC)
- Support Lectrician1 (talk) 23:07, 20 February 2023 (UTC)
- Support UTF48 (talk) 23:14, 20 February 2023 (UTC)
- Support —מקף⁻ණ (Hyphen) 00:15, 21 February 2023 (UTC)
- Support Borys Kozielski (talk) 19:27, 21 February 2023 (UTC)
- Support MehdiTalk 06:48, 22 February 2023 (UTC)
- Support Especially touchscreen devices with benefit from this due to easy zooming. Morten Haan (talk) 18:29, 22 February 2023 (UTC)
- Support Alistair3149 (talk) 20:23, 22 February 2023 (UTC)
- Support hgzh 07:19, 23 February 2023 (UTC)
- Support --Tchoř (talk) 10:16, 23 February 2023 (UTC)
- Support. —— Eric Liu(Talk) 03:26, 24 February 2023 (UTC)