Commons:Graphics village pump/February 2019

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

Blank SVG image after upload

I have modified File:SevenSisterStates.svg file to create a few SVG maps using Inkscape. These images are rendered correctly in browser (Chrome, Firefox, IE), but after uploading to Commons the files look empty ((File:Assam district locator map Baksa.svg and others in Category:Locator maps of districts of Assam) where the original file still correctly renders (here). I am not sure what is happening, may be there is something going wrong in rendering the PNG images. Does anyone have any idea how to fix this? --SlowPhoton (talk) 10:13, 28 December 2018 (UTC)

@SlowPhoton: Please use Commons:Commons SVG Checker, and you will know the problem:
 — Johannes Kalliauer - Talk | Contributions 11:05, 28 December 2018 (UTC)
@SlowPhoton: is it on purpose that they have a transpraency? I removed it in File:Assam_district_locator_map_Baksa.svg, but not in the others.
@JoKalliauer: That was not on purpose. I did not realiser that there were transparency. Is there a quick way to fix this? --SlowPhoton (talk) 16:13, 28 December 2018 (UTC)
If you ungroup everything in inkscape it will remove the transparency (that's how I did it) I think it is related to mask2921 with opacity:0.97000002. I will check that /or do that.  — Johannes Kalliauer - Talk | Contributions 22:11, 28 December 2018 (UTC)
@SlowPhoton: I think now all files are fixed. Please check  — Johannes Kalliauer - Talk | Contributions 12:47, 3 February 2019 (UTC)

Fonts for SVGs on WCommons

Hello, I'm starting this conversation to understand the working of fonts in SVG (vector graphics) files on Wikimedia Commons. Starting from 21 February 2018, we will be starting a campaign in India to translate SVG files from Category:SVG diagrams in English into different Indian languages. The campaign page is at Commons:SVG Translation Campaign 2019 in India. While translating these files using Inkscape or any other software/tool, fonts are very crucial. When we use the default fonts, they maybe copyrighted. When uploaded to WCommons, it gets rendered to the closest available open-source font from the library (correct me if I am wrong). This may lead distortion of text or nearby paths in the vector file. To avoid these issues, we would like directly use the open source fonts that WCommons uses for SVG rendering. This will hopefully eliminate the distortion issues. It would extremely helpful if I can get the list of fonts used by WCommons for all the languages, and if possible, links to download these. Particularly for this campaign, our scope is limited to 20 languages as listed at Commons:SVG Translation Campaign 2019 in India/Organisers. Suggestions for the overall campaign are also welcome, thanks in advance. KCVelaga (talk · mail) 07:10, 3 February 2019 (UTC)

@KCVelaga: Please read meta:SVG_fonts, Help:SVG#Fonts_/_text, w:Wikipedia:SVG_help#font-family_issues — Johannes Kalliauer - Talk | Contributions 10:35, 3 February 2019 (UTC)

Resizing transparent PNG files

I have created as set of PNG transparencies for the Tai Tham script (e.g. because I need to display glyph variations that are not, and should probably not be, supported by Unicode and also unencoded characters. (The portability/quality of fonts also leaves a lot to be desired.) The glyphs are nominally black with a greyscale defined by the alpha channel. When the unresized glyph is displayed on a coloured background, I get the right appearance.

However, when I use '|xpx40' to shrink the images for sober use within tables, it seems that the thumbnail is generated by assuming the background is white; the thumbnail's white background then gives an unwanted contrast with the background of the cell in the table. I had expected the thumbnail to also have a transparent background.

How should I solve this problem? I can see several solutions:

  1. Raise a bug report/feature request on Phabricator - or is the problem intractable?
  2. I've missed a work-around of specifying a background colour for the image
  3. Generate and upload a strike of opaque images for each background colour (other than white) that is used
  4. Generate and upload a strike of transparent images for each chosen size

Which should I adopt? Options 2 and 3 could be defeated by the same cell having different background colours for different readers. --RichardW57 (talk) 23:18, 26 January 2019 (UTC)

@RichardW57: Would it be possible for you to generate SVGs instead of PNGs? I've been told that SVGs don't have these transparency problems and they look nice and anti-aliased at any size (assuming they are not just wrappers for PNG files). TilmannR (talk) 12:34, 28 January 2019 (UTC)
@TilmannR: My starting point is a PostScript master, but I can see how to automatically generate an SVG file from it, though I'm having trouble with the image size and am including far too much space at the bottom. My first effort, , scales to give a proper transparency. I shall probably have to study the specifications. --RichardW57 (talk) 22:48, 29 January 2019 (UTC)
@RichardW57: After setting the width and height of the viewBox to the width and height of the image (while ignoring its unit of measurement "pt"), everything looks fine. Maybe that'll help you debug the problem. TilmannR (talk) 22:57, 29 January 2019 (UTC)
@TilmannR: Yes, thanks, I think I can now see what's going on and what went wrong. Now to automate the conversion! --RichardW57 (talk) 23:52, 29 January 2019 (UTC)
@TilmannR: Now automated for images using the Hariphunchai/Lamphun font. --RichardW57 (talk) 23:57, 5 February 2019 (UTC)