Commons:Graphics village pump

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

Shortcut

color palette logo WELCOME TO THE GRAPHICS VILLAGE PUMP!

This Graphics village pump aims to be technical support forum for all the local Labs, graphists (graphic artists), and volunteers interested in graphic works, and is a page where graphists and users from all the Labs can talk about graphics, tutorials, graphic software, help to build new Graphic Labs, etc. Also for exchanging opinions, ideas, protocols, and ways of improvement.

See also: Graphics abilities page | Graphic Tool | Project Insignia | Stroke Order Project | Current requests/discussions


To have the opinion of graphists check

Illustration Workshop   Map Workshop   Photography Workshop   Video and Sound Workshop

Graphics village pump archives
Monthly archives
2007 Apr May Jun Jul Aug Sep Oct Nov Dec
2008 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2009 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2010 Jan Feb Apr May Jun Jul Aug Sep Oct Nov Dec
2011 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Dec
2012 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2013 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Dec
2014 Jan Feb Mar Apr May Jul Aug Sep Oct Nov Dec
2015 Jan Mar Apr May Jun Jul Sep Oct Nov Dec
2016 Jan Feb Mar Apr May Jun Jul Aug Sep Nov Dec
2017 Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2018 Jan Feb Mar May Jun Jul Aug Sep Nov Dec
2019 Jan Feb Mar Apr May Jun Jul Aug Sep Nov Dec
2020 Jan Feb Mar Apr May Jun Jul Aug Sep
2021 Mar Apr Jun Jul Aug Sep
2022 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2023 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Topic-specific archives

The svg is valid according to Validator.nu and is rendered flawlessly by Chrome, Firefox, and https://svgcheck.toolforge.org/index.php, which states "This image was rendered using rsvg-convert version 2.40.21, almost certainly the same version as in use on Wikimedia wikis."

Still, the text in the automatically generated PNGs is grossly misplaced. I have resized a screenshot to 800×318. How can I use that PNG as a substitute for the rsvg-generated ones? --Rainald62 (talk) 21:30, 13 November 2023 (UTC)Reply[reply]

@Rainald62: WMF renders the image using the 5 year old librsvg v 2.44.10. That version has a bug with centered and right aligned text. That bug was fixed in the more recent librsvg v2.40. Glrx (talk) 21:35, 13 November 2023 (UTC)Reply[reply]
@Rainald62: I have worked around this problem by avoiding <tspan> elements completely. I now use separate <text> elements, and specify attributes (especially "x=" and "y=" attributes) inside each <text ...> element. RCraig09 (talk) 22:22, 13 November 2023 (UTC)Reply[reply]
You can still use tspan as long as you specify x – the bug arises when there are multiple non-left-justified tspan on a line with x unspecified. It might be better to keep related tspan together as styling their parent text keeps their appearance consistent. cmɢʟee ⋅τaʟκ 23:45, 13 November 2023 (UTC)Reply[reply]
@RCraig09: <tspan> elements nicely fit together and keep doing so on a change of font, while separately positioned <text> elements could overlap or leave gaps.
@Glrx: Do you really mean that v2.40 is more recent than v2.44? Because svgcheck uses another version as WMF, I had to do experiments by uploading several versions.
The latest experiment (00:34) was a copy of the original file from User:DeWikiMan. It is also not converted properly to PNG. Obviously, there was a regression in PNG generation since the original version had been uploaded in 2018.
I reverted to my first version, which (viewed as svg) is the best one. Just ignore the bad thumbnail PNG. WMF has enough money to fix the problem. --Rainald62 (talk) 00:26, 14 November 2023 (UTC)Reply[reply]
@Rainald62:
Yes, I really mean it. Version 2.44.10 is an early release of the Rust language conversion. It is older than the most recent version of 2.40, the last release of the C++ version. WMF should be running version 2.50 or later. WMF's "update" in April 2023 introduced a few regression errors.
I would not modify SVG files to work around this problem. WMF should run more recent versions of librsvg.
Glrx (talk) 01:39, 14 November 2023 (UTC)Reply[reply]
Thanks for the clarification and the endordsement not to work around. Who can clean up the file's version history (delete all but the first two versions)? --Rainald62 (talk) 08:40, 14 November 2023 (UTC)Reply[reply]
@Rainald62: Inkscape makes the .svg text files too long and complicated. I still think the simplest solution is to simplify <text> specifications as I do in File:1880- Global average sea level rise (SLR) - annually.svg, though it requires manual text editing. Whatever your approach, good luck! (I don't know who to ask, to remove unwanted versions; it usually isn't done. Maybe open a separate section here on the Village Pump if it's important to remove earlier versions.) RCraig09 (talk) 17:27, 14 November 2023 (UTC)Reply[reply]
Nice code. I won't further edit the Inkscape mess. I won't proceed at all without an idea how to get "CO2" with subscript and 90° rotation. Here is what I tried: File:Test workaround.svg (some comment lines contain the test result for the previous version). Feel free to continue. --Rainald62 (talk) 17:41, 14 November 2023 (UTC)Reply[reply]
I removed unnecessary #text nodes; a newline after a tspan element exacerbates the issue. Unicode subscripts can be used for carbon dioxide: CO2 → CO₂, but it is not needed here because the librsvg bug has little impact on the placement of the text. Glrx (talk) 19:00, 14 November 2023 (UTC)Reply[reply]

What is exactly wrong with these inkscape SVGs? Server won't render SVGs in file description or scaled-down alternatives - reports "Error Our servers are currently under maintenance..." (Request from <redacted-ip> via cp3075 cp3075, Varnish XID 42369810 Upstream caches: cp3075 int Error: 429, Too Many Requests at Sat, 18 Nov 2023 19:29:00 GMT). But if I press to proceed directly to file, it shows correctly. Other, similar-sized and similar-loaded, SVGs are fine. Retired electrician (talk) 19:39, 18 November 2023 (UTC)Reply[reply]

The text in the original version of this svg file displays correctly:

https://upload.wikimedia.org/wikipedia/commons/6/6c/Leukotriene_B4_hydroxylation.svg

But the none of the thumb nail version display correctly (one of the hydroxyl groups (OH) is not displayed and the OH from the carboxylic acid (-C(=O)-OH)) has been moved next to carbonyl (C=OHOHO). Note that the original was created in ChemDraw, exported as an eps file then imported into Inkscape where is looked OK and then saved as a svg file. Any idea on how to get this to work? This is one of several svg files that I had similar problems. Thanks. Boghog (talk) 11:06, 26 November 2023 (UTC)Reply[reply]

Sigh. IIRC, the WMF rasterizer does not support x attributes with multiple values (e.g., x="12.45 20.23"). See Commons:Commons SVG Checker and Phab:T35245.
<text
           transform="matrix(1,0,0,-1,151.5,53.35)"
           style="font-variant:normal;font-weight:normal;font-size:10px;font-family:Helvetica;-inkscape-font-specification:Helvetica;writing-mode:lr-tb;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
           id="text328"><tspan
             x="0"
             y="0"
             id="tspan322">O</tspan><tspan
             x="12.45 20.23"
             y="21.549999"
             sodipodi:role="line"
             id="tspan324">OH</tspan><tspan
             x="-49.099998 -41.32"
             y="-0.34999999"
             sodipodi:role="line"
             id="tspan326">OH</tspan></text>
I deleted all the subsequent (and unneeded) coordinates to make it display better.
In addition, the SVG is poor: the symbols should be separate text elements.
Glrx (talk) 19:05, 26 November 2023 (UTC)Reply[reply]
Thanks for the corrections and the explanation! I also wasn't aware of the Commons:Commons SVG Checker. Cheers. Boghog (talk) 19:53, 27 November 2023 (UTC)Reply[reply]

Vectorisation of Seedfeeder PNGs[edit]

As an experiment, I vectorised a couple of the images in Category:Sex drawings by User:Seedfeeder. I wrote up my findings here, in case they're useful for anyone else:

User:I am not Seedfeeder/Vectorising the Seedfeeder images

Possibly my findings are also of use beyond the Seedfeeder images, and perhaps they can be usefully merged into some of the Help:SVG documents?

In addition, I note some expressions of concern on the category's talk page about the lack of diversity in the images. Since vectorisation (done rightly) separates the characters into separate layers, it should make diversification simpler. I am not Seedfeeder (talk) 20:35, 6 December 2023 (UTC)Reply[reply]

Nice work. Maybe in your findings you could talk a bit about the actual software you used, so the vectorisation process becomes more tangible. Alexpl (talk) 18:59, 7 December 2023 (UTC)Reply[reply]
I used GIMP and Inkscape, and I've now mentioned that in the findings. Thank you! I am not Seedfeeder (talk) 19:29, 7 December 2023 (UTC)Reply[reply]