Community Wishlist Survey 2017/Multimedia and Commons/Client side SVG rendering
Client side SVG rendering
- Problem: Currently we show PNG derivatives for all SVG images. As SVG support has expanded significantly, the proposal is to start preferring SVG rendering client side.
- Who would benefit: More accurate and infinitely scaling detail of SVG resources.
- Proposed solution: Make SVGs the default when their size/complexity is not prohibitively large and the browser supports it.
- More comments:
- Phabricator tickets: phab:T5593
- Translations: none yet
- Agree. Instead of transferring to user a 4 KB SVG image, we transfer 100 KB PNG render of it. Also, the PNG render sent to user is chosen depending on his screen resolutions, so if he scales in the page, the new render needs to be transferred. --Tohaomg (talk) 20:51, 8 November 2017 (UTC)
- Sometimes, the opposite can be the case, for example File:Flag of Mexico.svg is 220kb while most of its uses are tiny flag icons that weigh just 1kb as PNGs. Max Semenik (talk) 23:47, 8 November 2017 (UTC)
Rendering may also get less predictable with more diversity in rendering software. Most of the rendering bugs that appear with the current software chain are not present in the browsers I tried, though...--Reseletti (talk) 22:02, 9 November 2017 (UTC)
SVGs are preferred for lossless image quality at any zoom factor, but since we don't actually display SVG, we get blurry images, especially noticeable is then marquee/main image on mobile. Senator2029 talk 00:15, 17 November 2017 (UTC)
- I really would like to see this but I also see the problem with large svg-filesizes. We have maps where the svg-file is several MB big while the 250px PNG is just a few kb. And there are cases where browsers will mess up the rendering. I think we will have to introduce a new keyword with which you can choose if the svg or the png is served. I would propose the following:
- Will force the use of svg-file.
- Will force the use of png-file.
- Will use whatever is the smaller file.
- This way in most situations the default will be the optimal solution while we can still handle special-cases manually. -- MichaelSchoenitzer (talk) 16:14, 25 November 2017 (UTC)
- I am a bit hesitant if this is a good idea. I agree that for some files png offers a possibility to reduce the file size. However, server rendering offers fixed preview that does not depend on client browsers. Although , most of the modern browsers support correctly SVG, there may be some differences in the final result. Another issue is the use of fonts. There may be alignment and positioning issues as the font actually used varies from system to system. If a client side solution is agreed I would prefer to have the option in the Preferences as for the Math expressions - the user should choose client side rendering --Ikonact (talk) 09:03, 28 November 2017 (UTC)
- @Ikonact: The current SVG renderer, librsvg, is actually terrible at handling fonts and the display of text – including font size and letter spacing – varies widely depending on the dimensions of the rendered file. Fonts could be stored server-side although I don't think this is possible in MediaWiki yet. Jc86035 (talk) 05:00, 29 November 2017 (UTC)
- I would not like this discussion to get too hung up on file sizes. Generally, taking SVG files and turning them into something else is no longer either necessary or desirable. SVG is the best way we have to present many types of image, and that is what we should do. SVG animations would be really good too, but as yet still present difficuilties. Globbet (talk) 21:47, 3 December 2017 (UTC)
It seems to me that a huge problem is not being mentioned. SVGs on this site are specifically written with he onsite fonts in mind. Pretty much any SVG with fonts will break if rendered client side. Most users will not have the free fonts installed. The wrong fonts can completely mess up images. Unless a method is devised to handle this situation (falling back to PNG if the file has fonts, or maybe automatically embedding the needed fonts into the SVG), I do not think this is a good idea. Trlkly (talk) 07:58, 5 December 2017 (UTC)
- Support MichaelSchoenitzer (talk) 19:00, 27 November 2017 (UTC)
- Support Tacsipacsi (talk) 20:50, 27 November 2017 (UTC)
- Support --Boehm (talk) 21:58, 27 November 2017 (UTC)
- Support Jc86035 (talk) 01:19, 28 November 2017 (UTC)
- Support Mahir256 (talk) 08:00, 28 November 2017 (UTC)
- Support —viciarg414 08:25, 28 November 2017 (UTC)
- Support Dvorapa (talk) 10:32, 28 November 2017 (UTC)
- Support --Liuxinyu970226 (talk) 13:17, 28 November 2017 (UTC)
- Support YFdyh000 (talk) 17:29, 28 November 2017 (UTC)
- Support — Draceane talkcontrib. 18:40, 28 November 2017 (UTC)
- Support should be optional in the Preferences — Johannes Kalliauer - Talk | Contributions 21:51, 28 November 2017 (UTC)
- Support Thomas Obermair 4 (talk) 23:02, 28 November 2017 (UTC)
- Support Shizhao (talk) 03:23, 29 November 2017 (UTC)
- Support Donald Trung (Talk 🤳🏻) (My global lock 🔒) (My global unlock 🔓) 10:53, 29 November 2017 (UTC)
- Support Simon Villeneuve 15:34, 29 November 2017 (UTC)
- Support —TheDJ (talk • contribs) 15:36, 29 November 2017 (UTC)
- Support MGChecker (talk) 22:08, 29 November 2017 (UTC)
- Support Giovanni Alfredo Garciliano Diaz (talk) 22:21, 29 November 2017 (UTC)
- Support - Evad37 (talk) 00:41, 30 November 2017 (UTC)
- Support Midleading (talk) 01:57, 30 November 2017 (UTC)
- Support Izno (talk) 04:02, 30 November 2017 (UTC)
- Support finally, I could be able to use textPaths, patterns, css, etc in SVG images without rain dancing Tohaomg (talk) 09:39, 30 November 2017 (UTC)
- Support with an option to force PNG rendering Dominic Z. (talk) 17:10, 30 November 2017 (UTC)
- Support Laurentius (talk) 20:53, 1 December 2017 (UTC)
- Support Waldir (talk) 10:48, 3 December 2017 (UTC)
- Support LikeLifer (talk) 18:10, 3 December 2017 (UTC)
- Support Globbet (talk) 21:49, 3 December 2017 (UTC)
- Support Emw (talk) 22:06, 3 December 2017 (UTC)
- Support Trockennasenaffe (talk) 20:56, 4 December 2017 (UTC)
- Support JAn Dudík (talk) 21:51, 4 December 2017 (UTC)
- Oppose trlkly (talk) per above. —Preceding undated comment added 07:59, 5 December 2017 (UTC).
- Support Reneman (talk) 17:13, 5 December 2017 (UTC)
- Support • • hugarheimur 22:20, 6 December 2017 (UTC)
- Support Ahm masum (talk) 13:08, 10 December 2017 (UTC)
- Support Martin Kraft (talk) 17:58, 11 December 2017 (UTC)