Template talk:Chess diagram

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
WikiProject Chess (Rated Template-class)
WikiProject icon This template is within the scope of WikiProject Chess, a collaborative effort to improve the coverage of Chess on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
 Template  This template does not require a rating on the project's quality scale.
 

Change to version with better alt text[edit]

{{editprotected}} I changed {{chess diagram small}} a while back to have better alt text. I'd like to change this one in the same way by changing it to the one shown here: User:H2g2bob/chess diagram. There's a test case here. --h2g2bob (talk) 23:43, 16 January 2010 (UTC)

discussion at wikiproject from a while back. --h2g2bob (talk) 00:29, 17 January 2010 (UTC)
 DoneTheDJ (talkcontribs) 16:15, 17 January 2010 (UTC)

Fix appearance in print[edit]

{{editprotected}} I've fixed the horrible stretching that was going on in the PDFs and Books versions of articles. So if you could copy-paste the Template:Chess diagram/sandbox version into the real template, that would be great. Once that's done, you can delete Template:Chess diagram/Print, as it will be uneeded. Headbomb {talk / contribs / physics / books} 01:54, 17 May 2010 (UTC)

I've been playing around with the template and improved its efficiency radically. Can you check if it's okay? — Martin (MSGJ · talk) 11:45, 17 May 2010 (UTC)
If you want to do that rewrite, we should also be able to use it on the other templates (Omega grand grid, 10x10 grid, 10x8 grid, 8x8 grid, 6x6 grid, 5x5 grid, 4x4 grid ...), and able to chose between 26px or 22px squares (18x/16px for the white/black corners). Headbomb {talk / contribs / physics / books} 13:36, 17 May 2010 (UTC)
MSJG, that was not the edit I requested. I spent over 16 hours making sure my code was fine and displayed correctly. The sandbox version was not tested, and now nothing displays in print! Please revert and place the code I requested. The sandbox version needs much testing before it can be used live. Headbomb {talk / contribs / physics / books} 14:18, 17 May 2010 (UTC)
I took your previous message as support for this version. I haven't actually changed the functionality, I just made it more efficient - it should work exactly as your proposed version. Can you check again and try to fix this version rather than we revert the whole thing? — Martin (MSGJ · talk) 14:22, 17 May 2010 (UTC)
I just said that if we were going to rewrite the whole thing, we should have the other templates in mind. I've recreated the /Print version for now, this will safeguard against problems. I'll test the new template series when I have time, which may not be anytime soon. Headbomb {talk / contribs / physics / books} 14:25, 17 May 2010 (UTC)
Well this version seems to work for me. Perhaps if you give me an example of a page where it wasn't working I can look again. — Martin (MSGJ · talk) 14:30, 17 May 2010 (UTC)

Well, the way the /Print templates works is that they override the main template when in print. So what you need to do to see the problem is set up a page that calls the sandbox version of the template (since Template:Chess diagram/sandbox/Print doesn't exist) such as User:Headbomb/Sandbox20. (You can see that the diagram of the starting position is not rendered at all).

Also this only tests the PDF. The template may still cause problem in printed book (which uses a different renderer), although it is very rare that the book does not render fine when the PDF does. To test the printed books, you need a book that includes a version of the article that uses the sandbox template, as well as being on an email whitelist. I can arrange for this if you are interested, although it may take a day or so (you can send me your email if you are interested). Headbomb {talk / contribs / physics / books} 16:01, 17 May 2010 (UTC)

Okay I accept that there is a problem. I only tested it by printing it from the browser, not with PDF. Do you know why it's not working with this version? (By the way, I guess we don't need to revert right now as you have recreated /Print?) — Martin (MSGJ · talk) 18:00, 17 May 2010 (UTC)
Alright, now that the below problem is fixed, there's no more hurry in synchronizing the live Main and /Print versions. I don't yet know what causes the problem, but I haven't checked things in details. Don't know when I'll be able to either. Headbomb {talk / contribs / physics / books} 18:56, 17 May 2010 (UTC)

errors[edit]

Something that was done to Template:Chess diagram today has messed it up. Diagrams that are not marked "small" seem to have the pieces on ranks 1-7 shifted one rank file to the right. Bubba73 (You talkin' to me?), 17:33, 17 May 2010 (UTC)

Yes, that's because on the current version, there are "||" which should be "|". I asked for the template to be reverted to a working version, but I'm still waiting on that.Headbomb {talk / contribs / physics / books} 17:42, 17 May 2010 (UTC)
Fixed, sorry about that! — Martin (MSGJ · talk) 17:55, 17 May 2010 (UTC)

rank and file labels[edit]

I don't think the labels of the files and ranks need to be on the top and right side - along the left and bottom only would be better. Bubba73 (You talkin' to me?), 18:54, 17 May 2010 (UTC)

Or we could make it optional? — Martin (MSGJ · talk) 19:39, 17 May 2010 (UTC)
OK, but have it default to "off" because very little literature labels all sides. Bubba73 (You talkin' to me?), 22:22, 17 May 2010 (UTC)
The labels are always present on both sides in every book I saw on the topic. See this for example. Headbomb {talk / contribs / physics / books} 22:25, 17 May 2010 (UTC)
I have about 250 chess books and the only ones that have the labels on all four sides are for beginners. I don't see a point to duplicating them on the right and top. It wastes space. Bubba73 (You talkin' to me?), 23:07, 17 May 2010 (UTC)
As Bubba says, labels on all four sides are rare and in fact most chess books don't label the files and ranks on their diagrams at all. It may still be desirable to mark one side in Wikipedia since it is not expected that all readers will be avid chess players. In some past versions of the chess diagram template labeling all four sides helped make the diagram symmetrical so that centering the caption would center below the board portion only (space used by rank labels on one side shouldn't be considered in the caption placement). I don't know if that is still an issue. Quale (talk) 03:01, 18 May 2010 (UTC)
Yes, I think that labeling along the left and bottom is great - a lot of readers will not be that accustomed to algebraic notation. But doing it on all four sides is an unneeded redundancy that doesn't accomplish anything (except perhaps center the diagram). Bubba73 (You talkin' to me?), 03:21, 18 May 2010 (UTC)
Okay I have removed the top and right labels. — Martin (MSGJ · talk) 10:48, 18 May 2010 (UTC)

I like that better. What do others think? Bubba73 (You talkin' to me?), 16:35, 18 May 2010 (UTC)

I find that horrible. And now this template stands alone in the sea of chess templates, which all have labels on all sides. Headbomb {talk / contribs / physics / books} 22:35, 18 May 2010 (UTC)
It's horrible without letters top and right, it's out of balance. Please revert. Regards, SunCreator (talk) 22:52, 18 May 2010 (UTC)
a b c d e f g h
8
Chessboard480.svg
a8 black rook
b8 black knight
c8 black bishop
d8 black queen
e8 black king
f8 black bishop
g8 black knight
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
e7 black pawn
f7 black pawn
g7 black pawn
h7 black pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
e2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
d1 white queen
e1 white king
f1 white bishop
g1 white knight
h1 white rook
8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
Removing the top and right rows creates a huge style clash with all the animations which were generated through the use of this template.
Removing the top and right rows creates a huge style clash with all the animations which were generated through the use of this template.
Here's another reason why this should be reverted. With all the animations and images which used the chess diagrams, this will introduce chaos were non existed. Headbomb {talk / contribs / physics / books} 03:45, 19 May 2010 (UTC)

Looking at the animation, I would say there should be a simple text based way to create such an animation. I mean it is we can all follow a game that starts 1.d4 d5 2.Nf3, but how about when it becomes 10 moves deep? We should be able to input a starting position and a starting move number and enter moves to annimate as simple as moves=2...Nf6 3.c4--Mokru (talk) 15:55, 7 October 2010 (UTC)

I like the change, but the consensus seems to go back to the other way. Of course, I'll go along with the consensus. Bubba73 (You talkin' to me?), 04:00, 19 May 2010 (UTC)
Okay I'll revert this for now. (Or add an option and make the default on both sides.) — Martin (MSGJ · talk) 09:08, 19 May 2010 (UTC)
Thanks guys. Regards, SunCreator (talk) 13:53, 19 May 2010 (UTC)
Please don't add the option. It'll only encourage style forks, and we don't need that. The only option we need is whether labels should be present or not (Template:Chess diagram 4x5 doesn't use them, but Template:Chess diagram 6x6 does). Headbomb {talk / contribs / physics / books} 15:14, 19 May 2010 (UTC)
I agree that it should not be an option. I don't see any point in doing it one way on some diagrams and another way on others. Bubba73 (You talkin' to me?), 15:43, 19 May 2010 (UTC)

An argument's been made that notation on top and right is good for beginners who aren't experienced players yet. But did you ever think, that notation all the way around the board, like bees buzzing around a hive, looks complicated and could *intimidate* a beginner player? (Who many feel as a result, the game is probably "too complex" for them to understand, because all that notation gives an overall impression the game is probably too "technical" and "difficult" for them?)

If there's a cosmetic/esthetic argument that two-sided notation is "out of balance", there is also a counter-argument that four-sided notation destroys the beauty of the board (alternating-color squares), and destroys the visual simplicy of the board (which should be just squares as much as possible) by surrounding the board with unneeded orbiting letters & numbers - as though escaped from a can of Campbell's Alphabet Soup! (I think the counter-argument trumps the first.)

Chess is hard enough. Excess border notation = additional distraction. (When you try solving a chess problem from a diagram, or any other kind of analysis from it, the less visual distraction, the better. The greater simplicity, the better. I would venture to even say that is *always* true, for *everyone*. Because the mind never profits from distraction.) Ihardlythinkso (talk) 07:24, 5 July 2011 (UTC)

Size of fonts[edit]

[The] "small" version ... still has the problem with the squares not being squares in Firefox. Bubba73 (You talkin' to me?), 16:35, 18 May 2010 (UTC)
The squares are square with default settings. You use bigger fonts and that screw things up. Doesn't mean we should stop looking for a solution however. Headbomb {talk / contribs / physics / books} 22:35, 18 May 2010 (UTC)
No matter what I size I set the Firefox fonts, the squares of the small diagrams are not square. Bubba73 (You talkin' to me?), 01:06, 19 May 2010 (UTC)
I'm using Firefox 3.6.3 they look square to me. Regards, SunCreator (talk) 01:18, 19 May 2010 (UTC)
The problem with the squares on Firefox just started yesterday, and another computer with Firefox doesn't have the problem. Changing font sizes doesn't affect. IE and Chrome on this computer don't have the problem - only Firefox (3.6.3). I still have the problem if I'm not logged in. Bubba73 (You talkin' to me?), 01:22, 19 May 2010 (UTC)
Even after rebooting and starting Firefox in safe mode (no add-ons, etc), I still have the problem with small diagrams (this computer but not the other one). Bubba73 (You talkin' to me?), 01:51, 19 May 2010 (UTC)
Is it the size of the font I have set that is displaying the ranks (1-8) that is forcing the square to be taller than it should? Bubba73 (You talkin' to me?), 04:52, 19 May 2010 (UTC)

screenshot: File:Screenshot castling.jpg

On Firefox on this computer I have a minimum size font set so I can read text. Is this what is happening: that minimum size font is forcing the "small" squares to be that tall? Bubba73 (You talkin' to me?), 16:37, 19 May 2010 (UTC)
I doubt if font can make any difference at all. What screen resolution are you on? Try setting to 1280x800 and see if the board is square. Regards, SunCreator (talk) 16:45, 19 May 2010 (UTC)
I'm using the screen's native resolution of 1280x1024. If I change that and it makes the squares of the small diagrams square, wouldn't that make the regular squares not square? Bubba73 (You talkin' to me?), 18:20, 20 May 2010 (UTC)
The font size is the problem, not the resolution. Use the default option (16pt) and it should be fine. Headbomb {talk / contribs / physics / books} 18:45, 20 May 2010 (UTC)
In Firefox I have the default as 16-point Times New Roman. Bubba73 (You talkin' to me?), 18:51, 20 May 2010 (UTC)
Under Advanced, I had the minimum font size set to 18. Setting it to 16 and the small diagrams are square. Thanks all. Bubba73 (You talkin' to me?), 18:53, 20 May 2010 (UTC)

Divs[edit]

We seem to have some unnecessary formatting here. For example why is it necessary to have two boxes around the chess board? — Martin (MSGJ · talk) 10:50, 18 May 2010 (UTC)

I think the two boxes are good - the caption is between them. It helps separate the caption from the a-h. Bubba73 (You talkin' to me?), 16:37, 18 May 2010 (UTC)
I think it would probably be better if the header was inside the outer box. Bubba73 (You talkin' to me?), 04:02, 19 May 2010 (UTC)

Unnamed parameters[edit]

Currently all parameters are unnamed. This makes sense for the 64 chess pieces, but there are a few which would be better named I think:

  • The CSS class of the first div, currently {{{1}}}
  • The optional title, currently {{{2}}}
  • The caption underneath, currently {{{67}}}

Naming these {{{class}}}, {{{title}}} and {{{caption}}} respectively would make the syntax clearer and avoid complications where removing a parameter could potentially shift the position of the chess pieces. — Martin (MSGJ · talk) 10:55, 18 May 2010 (UTC)

All chess templates follow the same convention by starting piece placement at {{{3}}}. If you rename {{{1}}} and {{{2}}}, you effectively shift the assignments by two, breaking all templates. Headbomb {talk / contribs / physics / books} 01:39, 19 May 2010 (UTC)
Well yes, obviously we would have to update them if we were to make this change. — Martin (MSGJ · talk) 09:04, 19 May 2010 (UTC)
But what would be the point of that, and how would it prevent "pieces shifting"?? This is a family of roughly 20 templates, who all have this behaviour (in every language of Wikipedia), used on thousands of pages. Changing things would only confuse/annoy people, break interwiki compatibility, and some Chess template-writing software would become broken. Headbomb {talk / contribs / physics / books} 15:09, 19 May 2010 (UTC)

PNG -> SVG[edit]

I posted an RFC at meta:Talk:WikiProject Chess and Wikipedia talk:WikiProject Chess. Please feel free to comment. Cburnett 04:05, 2 January 2007 (UTC)

the white horse is missing... --Lazer erazer 11:51, 4 February 2007 (UTC)
Got a version on the /sandbox using these pieces. Any comments? — Martin (MSGJ · talk) 22:17, 17 May 2010 (UTC)

Conversion to SVG[edit]

Main: Finish {{chess diagram}} pieces SVG-ification; Create {{chess diagram svg}} pieces for the remaining colors

I've made a request at the graphic labs so we get all pieces in all colors in SVG. Once it's done, which may take a while considering the scope of the request, this would allow us to make a switch from the PNGs to SVGs. Headbomb {talk / contribs / physics / books} 03:35, 19 May 2010 (UTC)

There's a version sitting in the sandbox actually. (I didn't know we were missing some.) See the section above which I retrieved from the archive. By the way, there is no point making separate pieces with the different coloured backgrounds. Just make them transparent and we can use a background colour in the table. — Martin (MSGJ · talk) 09:03, 19 May 2010 (UTC)
Bumping this topic, as no-one responded on MetaWiki. I've finished all the requested pieces in SVG form, and am in the process of creating more gap-fills. Is it worth continuing this process? Equally, some standardisation on non-standard piece lettering is needed, as, for example, the unicorn/inverted knight piece shares its letter with the ship, so could (and, arguably, should) be moved to U, for unicorn, where it belongs. Anyway, there's a page on my userspace with the table as it stands here. NikNaks talk - gallery - commons 10:48, 3 June 2010 (UTC)
Just a fair waring, there might be a reason to create each piece with a colored background. The SVG images rendered in IE6 might not be transparent and could have a white background. Before deploying any template I suggest you test with IE6 first.--Svgalbertian (talk) 17:29, 11 June 2010 (UTC)
I just tried Template:Chess_diagram/testcases, and yeap everything is white. Until bugzilla:2074 is fixed, I recommend creating tiles for each color.--Svgalbertian (talk) 17:34, 11 June 2010 (UTC)
I don't think it falls under our responsibility to do that, as it is an issue with the WikiMedia software as a whole. If anything, forcing users who can to upgrade is no bad thing, but is there any chance that there could be a line in the template to use the PNGs if the browser appears as IE6? Or is that too complex for the markup to deal with? NikNaks talk - gallery - commons 12:08, 12 June 2010 (UTC)

Header inside outer box?[edit]

How about putting the header inside the outer box (like the caption)? I think it would be a good idea. Bubba73 (You talkin' to me?), 18:57, 23 May 2010 (UTC)

an "=" in the caption causes error[edit]

EXAMPLE OF EQUALS SIGN IN CAPTION CAUSING ERROR
a b c d e f g h
8
Chessboard480.svg
g8 white queen
h8 white queen
b6 black king
c6 black pawn
d6 black queen
e5 black pawn
c4 white pawn
d4 black pawn
e4 white pawn
c3 black knight
d3 white pawn
g3 white pawn
a1 black queen
f1 white bishop
g1 white king
8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h

An "=" in the caption causes the whole caption to not be displayed. It has been this way for a long time. Bubba73 (You talkin' to me?), 20:32, 28 May 2010 (UTC)

You need to use {{=}} when writing = in templates. This is a limitation of all templates. Headbomb {talk / contribs / physics / books} 04:54, 29 May 2010 (UTC)
Thanks, are there any others like that? Bubba73 (You talkin' to me?), 05:03, 29 May 2010 (UTC)
Any other what? Headbomb {talk / contribs / physics / books} 05:06, 29 May 2010 (UTC)
Any other characters that you have to put in the double braces to use correctly in a caption. Bubba73 (You talkin' to me?), 05:08, 29 May 2010 (UTC)
Yes, the pipe character "|", which you input with ({{!}}) (for technical reasons {{|}} wouldn't work. Headbomb {talk / contribs / physics / books} 05:35, 29 May 2010 (UTC)

problem with white dots[edit]

Today white dots are not showing up correctly on SMALL chess diagrams. They are OK on regular diagrams. Bubba73 (You talkin' to me?), 14:44, 5 June 2010 (UTC)

Nunn, 2007, p. 152
a b c d e f g h
8
Chessboard480.svg
e8 white circle
f8 black circle
g8 black circle
h8 black circle
e7 white circle
f7 black circle
g7 black circle
h7 black circle
e6 black circle
f6 black circle
g6 black circle
h6 black circle
a5 white circle
c5 white pawn
e5 black circle
f5 black circle
g5 black circle
h5 black circle
a4 white circle
c4 white king
e4 black circle
f4 black circle
g4 black circle
h4 black circle
a3 black circle
d3 white queen
e3 black circle
f3 black circle
g3 black circle
h3 black circle
a2 black circle
b2 black circle
c2 black circle
d2 black circle
e2 black circle
f2 black circle
g2 black circle
h2 black circle
a1 black circle
b1 black circle
c1 black circle
d1 black circle
e1 black queen
f1 black circle
g1 black circle
h1 black circle
8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
Nunn, 2007, p. 152
a b c d e f g h
8
Chessboard480.svg
e8 white circle
f8 black circle
g8 black circle
h8 black circle
e7 white circle
f7 black circle
g7 black circle
h7 black circle
e6 black circle
f6 black circle
g6 black circle
h6 black circle
a5 white circle
c5 white pawn
e5 black circle
f5 black circle
g5 black circle
h5 black circle
a4 white circle
c4 white king
e4 black circle
f4 black circle
g4 black circle
h4 black circle
a3 black circle
d3 white queen
e3 black circle
f3 black circle
g3 black circle
h3 black circle
a2 black circle
b2 black circle
c2 black circle
d2 black circle
e2 black circle
f2 black circle
g2 black circle
h2 black circle
a1 black circle
b1 black circle
c1 black circle
d1 black circle
e1 black queen
f1 black circle
g1 black circle
h1 black circle
8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
It appears someone has made the transition to SVG without telling anyone! I've uploaded a replacement file, so all should be well. I'll also revert my change earlier if it hasn't already been done. NikNaks talk - gallery - commons 16:09, 5 June 2010 (UTC)
Thanks, that fixed it! Bubba73 (You talkin' to me?), 16:12, 5 June 2010 (UTC)

Alt text is wrong[edit]

Looks like the template is emitting alt="{{{square}}} black king" as the alt text for blank squares. This is evidently nonsense. Can someone who knows the code have a look? Chris Cunningham (not at work) - talk 16:46, 18 July 2010 (UTC)

An old simplification edit of Template:Chess diagram alt text broke this. I fixed it on August 8 after it was mentioned at WT:CHESS. I hadn't seen this much earlier report before today. Quale (talk) 08:40, 18 August 2012 (UTC)

border[edit]

The border of the diagram encloses the footer caption, but not the header. I think it would be much better if the border enclosed the header too. Can this be changed? Bubba73 (You talkin' to me?), 22:42, 1 September 2010 (UTC)

Printing of chess diagrams[edit]

Printing of chess diagrams, either from the PDF or the printable version of the page, does not work properly. On PDF, white squares are superimposed within each empty square on the board resulting in what looks like tan and brown outlines instead of tan and brown squares. On the printable page, the tan and brown are missing completely, and all you see is the chess pieces on a single large undivided white box. I am using IE8 on WIN7 and Adobe Reader 10. —Preceding unsigned comment added by 24.229.98.8 (talk) 16:47, 19 March 2011 (UTC)

I just printed Fool's mate on a color printer, and the three diagrams all printed properly. Bubba73 You talkin' to me? 16:52, 19 March 2011 (UTC)
It's a known issue. See PediaPress Ticket #937. Headbomb {talk / contribs / physics / books} 13:57, 20 March 2011 (UTC)

size parameter[edit]

According to the documentation, the size parameter should be just a number, as required by Template:Chess diagram/square (wich have the parameter {{{size|26}}}px ). So, can someone remove the "px" from "{{{size|26px}}}" in this template? This will avoid the "26pxpx" as image size (in the pdf output, the diagram rendering is broken and this may be the reason). Giro720 (talk) 05:40, 1 July 2011 (UTC)

Might this affect some existing uses? — Martin (MSGJ · talk) 08:56, 1 July 2011 (UTC)
No. An alternative solution (and more elegant) would be replace {{{size|26}}}px by {{{size|26px}}} in Template:Chess diagram/square, but this would break the pages wich set the size manually (with a number only, without the "px") in {{Chess diagram}} template (I'm not sure if there is any). Giro720 (talk) 19:38, 2 July 2011 (UTC)

All available geometries[edit]

Could someone update the Doc to reflect all available board geomety templates? (For e.g. I see a 8x10 template exists, used in Courier chess.) Ihardlythinkso (talk) 15:49, 8 January 2012 (UTC)

Performance[edit]

This is a hideously expensive template. Normally, the rule says "don't think about performance - the developers will take care of this". However, in this case I believe we *should* take notice: for example, I created a testpage (IOW, my sandbox) that contains 36 instances of the template. You are welcome to press "edit" and then "save" on this page, and note that saving it takes 40-55 seconds (if you feel queasy about "saving" a page in someone else's userspace, you can try "purge": significantly quicker than "save", but even purging the page with 36 instances cost some 20-25 seconds).

You might also want to try and create a page with 80 instances of the template: so far I have not succeeded in creating such a page, and the server always quit with "timeout" message. even opening the page, never mind saving, takes way too long.

One can argue that pages with this many instances of the template are never needed, and one may even be right making this argument, but it still isn't desirable to have a template that forces this limitation, and it can be argued that in some pages (possibly pages in Category:Chess games), it makes sense to display every single board of a whole game (possibly 2-or-4 in a row).

The template is also not very easy to create, and requires a lot of manual work. (I believe people created tools, including a website or two, that accepts a FEN string and squirts out a {{Chess diagram}} template ready to use)

proposed alternative[edit]

According to wikimedia roadmap, the "Scribunto" extension will be installed in enwiki sometime during first quarter (i.e., February-March of 2013). In light of these two facts, I created a template/module combo that creates chess diagram from a FEN string. My experiment shows it's significantly more efficient than this template: Specifically, it's possible to save a page with 160 boards (the "save" did take a while).

The sample page is here (this page is on wikimedia-labs site - they have the Scribunto/LUA extension already installed). Please note the instructions at the top of the page: you will need to add 2 lines to your personal CSS in order to see the page correctly. There are also instruction how to run a single javascript line from the browser's console in order to inject the CSS into the page (this will allow you to view the page correctly without having to create an account in wikimedia-labs, and without having to edit your personal CSS there. This javascript line creates a transient effect, so you'll need to run it every time you visit the page and after refresh. it won't have any effect outside this page).

The LUA script that drives this page is here, and the template is here.

So I propose that anyone interested in this template, will take a look at the script and the template on wikimedia-labs site, and will suggest changes and improvements. Feel free to edit either, but please leave a comment in the talkpage of the template or module if you make any changes. You can also copy them to a separate module/template and do the experimentation there.

In the medium range (i.e., as soon as LUA is intalled on enwiki) I propose to use this, or something similar here, and recommend editors to use it instead of this template. In the long range, I propose to run a bot and convert uses of this "chess diagram" template to the LUA-based one.

Please note that this is more "proof of concept" than the real deal: as of now, it does not have row and file legends, and there may be some features of "chess diagram" which are not supported. currently it supports only 3 parameters: the FEN string, an optional "size" (defaults to 30), and an optional "reverse" (to display the board from black POV). Anyone interested in augmenting either the script or the template to add the missing features is welcome (you *will* need an account - wikimedia-labs does not allow anon edits)

for reference, here is some performance data (to see performance data on pages generated by mediawiki, you can hit Ctrl+u on any page, and search for "NewPP")

This is the wikimedia-lab page, with 160 boards, using the LUA-driven, FEN-based template:

NewPP limit report
Preprocessor visited node count: 7167/1000000
Preprocessor generated node count: 12834/1000000
Post-expand include size: 695740/2097152 bytes
Template argument size: 7852/2097152 bytes
Highest expansion depth: 3/40
Expensive parser function count: 0/100
Lua time usage: 0.230s
Lua virtual size: 9.79 MB / 50 MB
Lua estimated memory usage: 0 B

And this is the enwiki page, with 36 boards, using {{Chess diagram}}

NewPP limit report
Preprocessor visited node count: 102674/1000000
Preprocessor generated node count: 37980/1500000
Post-expand include size: 1223352/2048000 bytes
Template argument size: 59796/2048000 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/500

peace - קיפודנחש (aka kipod) (talk) 19:24, 29 January 2013 (UTC)

Is it slow just when saving after editing, or is it slow each time someone views it? Bubba73 You talkin' to me? 20:11, 29 January 2013 (UTC)
experiment results are inconsistent, and probably depend on some setting of the cache. sometime it's costly to open the page (for reading), and other times less so. It's very slow on "purge", and very very very slow on "save", costing a little north of one second per instance of the template (granted, this depends on server power - if we do nothing it will probably be cut in half within 3-5 years, when hardware speed will double...). you can test this yourself - see link to the testpage in the first paragraph. קיפודנחש (aka kipod) (talk) 21:01, 29 January 2013 (UTC)
If you can make it more efficient, please do. I've just experienced the slowness you talk about when saving an edit. Bubba73 You talkin' to me? 00:30, 10 February 2013 (UTC)
If you can make it more efficient, please do. I've just experienced the slowness you talk about when saving an edit. Bubba73 You talkin' to me? 00:30, 10 February 2013 (UTC)
according to the roadmap Lua should be activated here in the January-March timeframe. however, i do not see much enthusiasm (or response of any kind) to the proposal, so i am not sure what gives.
i think that once Lua will be activated, i'll just make an alternative template (say, "{{fen chess diagram}}" or somesuch), so editord will be able to choose which template they want to use for new articles, and maybe even port (manually) some of the existing "chess diagrams" templates to the fen variety. however, i do not see in the cards automatic conversion. for more complex cases, i.e., when the board contains X's and/or O's, the FEN thing won't do. if it's interesting enough, i might be able to convince it to display boards which are not 8x8. קיפודנחש (aka kipod) (talk) 02:55, 11 February 2013 (UTC)
I wrote a program that generates the current format of chess diagrams visually (8x8 only, no fairy pieces). I could probably modify it so the user can paste in a diagram in the current format and output the new format. Bubba73 You talkin' to me? 04:38, 11 February 2013 (UTC)
It takes quite a while to save an edit to Rook and pawn versus rook endgame - it has 45 diagrams. Bubba73 You talkin' to me? 04:40, 11 February 2013 (UTC)
i dug a little more, and i think the problem is that the template produces 30,000 bytes of HTML. (not counting the size of the images - just html code). this means that 50 instances of the template will create a 1.5MB page, even if there isn't anything else (such as text) on the page.
there are two issues: one of them is the template itself: in current template, each square, whether it contains a piece or empty, uses an image. i do not think this is necessary. we could just use the background property. the only little caveat is that we would need to use "min-height" and "min-width" in the style, to prevent files or rows with no pieces on them from collapsing. this would cut the size of produced html significantly: a board in opening position has 32 empty squares, and saving the "img" tag on those will cut the html size by *almost* 50%. in the "rook and pawn(s) vs. rook", only 5 or 6 out of the 64 squares are populated, so almost 90% of the html size can be cut.
the 2nd issue is a recent development: in order to better support retina and other hires displays on tablets and smartphones, a new feature was introduced: see mw:HiDPI display support. this new feature practically doubled the weight of an "img" tag in the html (it has nothing to do with the weight of the image itself - i'm talking about the text that is sent with the "img" tag in the page html). so, this template used to weigh about 15K before - pretty hefty, mabe even obese, but the new change made it 30K. we have a 2MB limit on page size, which means, if we do nothing to cut the weight of this template, there is a hard-limit of 60 or so instances of this template in a page (adding some text to the page will make it smaller, of course).
we really do not need Lua to do this. i hope i'll find some time and present an alternative template that will behave more or less the same as this one, but will not weigh as much.
the proposed template is also good, i think: IMO it is much more friendly to have a templates with 3 or 4 named parameters (one of which is the FEN), than it is to deal with the current template with 65 position-based params, *plus* these 3 or 4 named ones.
peace - קיפודנחש (aka kipod) (talk) 18:00, 12 February 2013 (UTC)
You understand this a lot better than I do, but I get the gist of what you are saying. If you can improve it, it will be appreciated. Bubba73 You talkin' to me? 00:39, 13 February 2013 (UTC)
I strongly concur that the empty cells should not have images in them, as that's wasteful for no reason. Not only does it increase the HTML size, it requires the wiki parser to process dozens/hundreds of extra images. The srcset attributes on the remaining pieces shouldn't really be too bad. Note that pages being transferred to a browser are compressed, and the srcset entries are highly redundant so there's limited effect on actual download speed. --brion (talk) 19:58, 14 February 2013 (UTC)

diagram from FEN[edit]

so "they" enabled scribunto, and i brought in the module/template combo to display a chess diagram using the FEN string. will be happy to get feedback. the template is Template:Chess diagram-fen, and the LUA module to support it is Module:Chess from fen. in order to use this template, two lines are needed in the CSS. the template page has instructions on how to add those lines to your personal CSS, or a single JS line you can run from the console to add them temporarily, without having to meddle with your personal CSS. of course, if we decide to use this template, these 2 lines will have to be added to the global CSS page (Mediawiki:Common.css). peace - קיפודנחש (aka kipod) (talk) 06:16, 19 February 2013 (UTC)

so i removed the need to use special CSS, though if we do use this template all over the place, i still think it would be better to add those to common.css, so we can streamline the html code the template squirts out.
either way, i would love to hear what people think about this "chess diagram from FEN". IMO, it makes more sense than this template, though i would not suggest to eliminate this one - just use it less.
peace - קיפודנחש (aka kipod) (talk) 23:24, 23 February 2013 (UTC)
I saw this because I watch this page. Probably not many people do, so a good place to ask people about it is the chess project talk page. Bubba73 You talkin' to me? 00:03, 24 February 2013 (UTC)

This sounds like a great idea. Pending conversion to the new template (or perhaps to ease said conversion) perhaps somebody could hack this template to output the equivalent FEN as part as part of the caption (maybe with a show/hide button). Automatic arrow placement based on the comparison of two FENs (or one FEN plus a move) would be cool too. ―cobaltcigs 03:00, 27 March 2013 (UTC)

both these ideas are attractive, but both are pretty tricky. an arrow will require 64 different images (28 diagonal, 14 vertical, 14 horizontal, and 8 knight moves). most modern browsers support image rotation, which would make it possible to use much smaller number of images, but i don't think it's considered to be "kosher" to build something that breaks on older browsers. so if someone will volunteer to create all those images, it would be a breeze to add it to the module/template... as to conversion: i'm not sure it's needed, but if so, i would not try to write it in lua. javascript to be run from the edit box is much more appropriate, i think. i have no plans to write such a conversion, but it sounds like an interesting exercise. peace - קיפודנחש (aka kipod) (talk) 07:04, 27 March 2013 (UTC)
I just noticed wikibooks' copy of this template has already solved the ascii2fen exercise without even using lua, but rather some pathologically nested parserfunctions (see template and example output). I'll see if I can learn enough lua to contribute a useful feature. ―cobaltcigs 02:42, 1 April 2013 (UTC)

New version of this template[edit]

I extended the functionality of the LUA module to make it work for both FEN and the ascii-style notation. the results can be viewed in Template:Chess diagram/testcases and Template:Chess diagram-fen/testcases. as you can see, this also fixes some minor bugs from lesser used features. in particular it fixes the bugs demonstrated in tests 5a, 5b, 5c, and 6b. it also adds the ability to use |reverse=true and adjusts the image borders (tests 5x, and the tests in Template:Chess diagram-fen/testcases). I have also tested to make sure it can display all the pieces listed in the documentation (test 10). I checked it in both Firefox and IE 9. it should render the board faster, since it overlays the pieces on the board, rather than rendering all 64 individual squares. let me know if you see any problems. if not, I will ask to have the sandbox synced in about a few days. Frietjes (talk) 19:14, 15 May 2013 (UTC)

and the revised module also exposes the fen to ascii conversion to allow it to be used to automatically convert between fen and ascii (assuming the input is sane). for example, try typing the following
{{subst:#invoke:Chessboard|ascii2fen|offset=0

|rd|  |  |qd|  |rd|kd|  
|pd|pd|  |  |pd|pd|bd|pd
|  |nd|pd|  |  |nd|pd|  
|  |  |ql|  |  |  |bl|  
|  |  |  |pl|pl|  |bd|  
|  |  |nl|  |  |nl|  |  
|pl|pl|  |  |  |pl|pl|pl
|  |  |  |rl|kl|bl|  |rl
}}
or try this
{{subst:#invoke:Chessboard|fen2ascii|fen=r2q1rk1/pp2ppbp/1np2np1/2Q3B1/3PP1b1/2N2N2/PP3PPP/3RKB1R19}}
Frietjes (talk) 19:25, 15 May 2013 (UTC)
Thanks. i have one question, though: did you test to see how many times the template can be used on a single page? the old template (the one that rendered every square regardless of whether it was occupied or not) would time out after little more than 40 boards, while the "old" chess-from-fen could display some 150 or more. it's not necessarily about displaying hundreds of boards - if it breaks at 50, it means it's painful to save a page with 30... peace - קיפודנחש (aka kipod) (talk) 20:00, 15 May 2013 (UTC)
no, measuring the speed was the next on my list. it uses the code that you developed almost verbatim, with the minor change that it translates the FEN internally to an arg array to reduce the code duplication when handling both cases. thank you. Frietjes (talk) 20:07, 15 May 2013 (UTC)
here are the unscientific performance results
Rendering 40 boards
Current New version
NewPP limit report
Preprocessor visited node count: 112889/1000000
Preprocessor generated node count: 41551/1500000
Post‐expand include size: 1356213/2048000 bytes
Template argument size: 65280/2048000 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/500
NewPP limit report
Preprocessor visited node count: 12850/1000000
Preprocessor generated node count: 35679/1500000
Post‐expand include size: 599343/2048000 bytes
Template argument size: 170390/2048000 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/500
Lua time usage: 0.428s
Lua memory usage: 1.06 MB
since the Lua time is less than 0.5 seconds, and the visited node count is almost an order of magnitude less, it seems like its better. I will see if I can get a better idea on the limit on the number of boards, but it certainly feels like it saves faster. clearly by using fen input you are going to cut down on the number of input arguments, and I don't think I slowed that down by any measurable amount. if I did, we can always keep the older version and the older chess diagram-fen. Frietjes (talk) 20:35, 15 May 2013 (UTC)
I just did some more testing, and I was able to save a page with 100 boards using the new template, but received a template size error for any more than about 60 boards with the current template. even without the template size error, I got a timeout when I saved the page with 60 boards, although my edit did go through. here are the performance results for 60 boards
Rendering 60 boards
Current New version
NewPP limit report
Preprocessor visited node count: 169345/1000000
Preprocessor generated node count: 60939/1500000
Post‐expand include size: 2034335/2048000 bytes
Template argument size: 97920/2048000 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/500
NewPP limit report
Preprocessor visited node count: 19286/1000000
Preprocessor generated node count: 52547/1500000
Post‐expand include size: 899045/2048000 bytes
Template argument size: 255590/2048000 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/500
Lua time usage: 0.614s
Lua memory usage: 1.14 MB
the key line here is the Post‐expand include size, which you can see is right at the limit for the current version, which is why it won't work for more than around 60 boards on a page. if you add a heading and caption to the boards, this could be triggered even sooner. the new template has a much lower Post‐expand include size, so it should be able to scale up to much higher. extrapolating, it looks like I could get about 135 boards on a page before hitting the Post‐expand include size limit, and probably more using fen input. Frietjes (talk) 20:54, 15 May 2013 (UTC)
i think this is nice. if we decide to use the "chess from pgn" script (discussed here and elsewhere), i can teach the script to squirt out a series of "fen" templates - basically one for each move in the game. editors can then select the boards they want to display in the article (we use this on hewiki). peace - קיפודנחש (aka kipod) (talk) 21:16, 15 May 2013 (UTC)
Is "Lua time usage: 0.614s" the time per board, or for 60 boards? I think it needs to work on at least 60 boards - I converted some articles to the fEN format, and some of them had almost 50 board diagrams. Bubba73 You talkin' to me? 23:23, 15 May 2013 (UTC)
if you compare the results for 40 boards and 60 boards you see its about 0.01s per board. note that that is the time spent in the lua processor, but there is certainly even more time spent outside the processor. Frietjes (talk) 23:43, 15 May 2013 (UTC)

Performance testing[edit]

I did some more experimenting with Lua versions of this template, and it looks like the best option is probably to move the entire code into a module. to illustrate this point, consider the following three versions

Version 1 
The current non-lua version of the template, which renders the board as 64 individual squares glued together as a table
Version 2 
An entirely lua version of the template, which renders the board as 64 individual squares glued together as a table
Version 3 
A partially lua version of the template, which renders the board by overlaying the pieces on a single board image
Version 4 
An entirely lua version of the template, which renders the board by overlaying the pieces on a single board image

Note that the generated output for versions 1 and 2 are the same, and the generated output for versions 3 and 4 are the same. none of these have undergone any extensive optimization, so further improvements could change the performance of all of them. with that said, here are the unscientific speed tests for rendering 60 boards:

Version 1 Version 2
Preprocessor visited node count: 169345/1000000
Preprocessor generated node count: 60939/1500000
Post‐expand include size: 2034335/2048000 bytes
Template argument size: 97920/2048000 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/500
Preprocessor visited node count: 6744/1000000
Preprocessor generated node count: 50382/1500000
Post‐expand include size: 645515/2048000 bytes
Template argument size: 0/2048000 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/500
Lua time usage: 0.897s
Lua memory usage: 868 KB
Version 3 Version 4
Preprocessor visited node count: 19286/1000000
Preprocessor generated node count: 52547/1500000
Post‐expand include size: 899045/2048000 bytes
Template argument size: 255590/2048000 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/500
Lua time usage: 0.667s
Lua memory usage: 1.11 MB
Preprocessor visited node count: 7824/1000000
Preprocessor generated node count: 52542/1500000
Post‐expand include size: 630035/2048000 bytes
Template argument size: 0/2048000 bytes
Highest expansion depth: 2/40
Expensive parser function count: 0/500
Lua time usage: 0.538s
Lua memory usage: 886 KB

the first key number to compare is the post-expand include size, which is what is currently imposing the limit of the number of boards on one page, which is why version 1 is not viable for more than 60 boards. no other numbers are anywhere close to the limit. the memory usage and lua time is about the same for all three lua versions. it looks like I made some improvements going from version 3 to version 4, most likely due to the elimination of some memory copying. it is interesting that we can get pretty good performance with the same html output as the current version, just by switching to lua. however, versions 3 and 4 should perform better when there are fewer pieces on the board, since they use overlays rather than rendering all of the pieces. the code for the various lua versions can be found in Module:chessboard/Template:Chess diagram/sandbox (version 3), Module:chessdiagram/Template:Chess diagram/sandbox2 (version 2), and Module:chessdiagram/sandbox/Template:Chess diagram/sandbox3 (version 4). once this is settled, I will have the old code either deleted, or archived somewhere.

Unless there is some reason why we can't use overlays (e.g., very old browser support), I suggest we go with a full-lua overlay version (i.e., version 4). you can see the output of the full-lua overlay version in Template:Chess diagram/testcases3. Frietjes (talk) 23:59, 20 May 2013 (UTC)

by the way, extrapolating, it looks like version 4 could scale up to about 195 boards per page. Frietjes (talk) 00:11, 21 May 2013 (UTC)
i know of only one reaosn not to use position:absolute, or as you call it, "overlays": the pdf maker (aka book maker) does not handle it correctly. this is a deficiency of the pdf renderer used by wikipedia, of course, and not an inherent limitation of pdf itself. the same problem pagues other parts, such as maps pushpins. i do not suggest to avoid using absolute position - the people who make the pdf handler extension will fix it to handle absolute position too, but until they do, pages who use this template will not be rendered correctly as pdf, so they can't be used in books. קיפודנחש (aka kipod) (talk) 02:24, 21 May 2013 (UTC)
I know I have seen things like {{hide in print}} and {{only in print}}, but if doing this means generating both versions, wrapped in css classes, then the page loading speed would suffer, so that would be a bad idea. unless there is some simple solution, I say we go with version 4 as suggested. Frietjes (talk) 22:33, 21 May 2013 (UTC)

Edit request[edit]

please replace the code with the version in the sandbox, per the discussion above. this will dramatically reduce the post-expand include size, improving the overall performance, allowing it to scale past 60 boards per page. the new code uses lua to generate everything, which is why the template code is so sort. comparisons can be seen in the Template:Chess diagram/testcases, including demonstration that the new code fixes several bugs, and adds the reverse and fen features from template:chess diagram-fen, which can be redirected here after this update. thank you. Frietjes (talk) 15:44, 25 May 2013 (UTC)

one more motivation for replacing the template is the addition of some capabilities, and specifically the "fen" and "reverse" parameters. the first allows displaying a board using Forsyth–Edwards Notation, and the second allows the editor to show the board from black's point of view. once this is done, documentation page has to be edited to explain these extra capabilities. peace - קיפודנחש (aka kipod) (talk) 18:20, 25 May 2013 (UTC)
Done! Please update the documentation when you have a chance. Thanks! Plastikspork ―Œ(talk) 23:20, 27 May 2013 (UTC)
I had to tweak the LUA module a bit to explicitly specify the height of the border labels, which were not evenly spaced in Chrome for some odd reason. Hopefully I did it correctly :) Thanks! Plastikspork ―Œ(talk) 23:33, 27 May 2013 (UTC)

Odd changes and undocumented features[edit]

It appears that File:Chess edt45.svg and File:Chess elt45.svg, which were inverted bishops, have been replaced with elephants (for Shatranj and Chaturanga), so now "e" gives an elephant and "j", for some reason, gives an inverted bishop. Since the documentation says that "e" should produce an inverted bishop, this is a problem. I would change the documentation but the corresponding dark and light square images (File:Chess ell45.svg File:Chess eld45.svg File:Chess edl45.svg File:Chess edd45.svg) still show inverted bishops, so I don't know what to do here. Something similar has happened for "s", which now gives a ship (for Chaturaji) even though the dark and light square equivalents are turned knights. — Gwalla | Talk 22:48, 8 May 2014 (UTC)

not sure about the best solution. you can at least track the global usage by checking commons:File:Chess_edt45.svg and commons:File:Chess_edd45.svg. if this didn't cause any problems in articles, then we can probably just change the documentation, and change the other files as well. otherwise, I'm not sure what to do, since reverting the changes on commons probably wouldn't solve the problem either? Frietjes (talk) 17:02, 9 May 2014 (UTC)
I think I can say this is partially my fault. This is an artifact of a graphics lab request and an overhaul of the template that I never got around to finishing. However, I did check the inverted bishops. Not so sure about the inverted knights.
I tried suggesting some changes here as well, but there didn't seem to be much impetus behind it so nothing got changed. If either of you have any interest in helping me out, I'd be more than welcome to finish off the overhaul. NikNaks talk - gallery 21:12, 9 May 2014 (UTC)
Well, I just changed the docs to use "j" for inverted bishops. The docs already said "N" should be used for inverted knights (I guess "s" was deprecated?). For the time being I guess ships and elephants will remain undocumented. — Gwalla | Talk 21:21, 9 May 2014 (UTC)

Problem with my CSS[edit]

I use User:Wareh/monobook.css (it's a standard stylesheet I got from somewhere).

Screenshot

It suits most of my needs well, except that chess diagrams are a mess: each square with a piece (or mark) is padded with a gray background instead of appearing neatly against a light or dark colored square. Can anyone propose (or even carry out) an edit to my stylesheet that will make chess diagrams work properly?

From this discussion, I think it's something that used to afflict all monobook users, and I will just need the same update everyone else got. Wareh (talk) 23:45, 18 February 2017 (UTC)

@Wareh: - i think it's coming from the following section in your css:

div.thumb div {
	border: 1px solid #ccc;
	padding: 3px !important;
	background-color: #f9f9f9;
	font-size: 94%;
	text-align: center;
	overflow: hidden;
}

it's definitely related to background-color and border. please try to remove this and see if the situation improves. peace - קיפודנחש (aka kipod) (talk) 18:05, 10 April 2017 (UTC)

Thank you so much - that solved my problem! I no longer have to log out to see correct chess positions. Cheers, Wareh (talk) 16:53, 15 April 2017 (UTC)

One other icon available for a chess piece[edit]

Does anyone know how (or will other editors be able) to add one other available icon for chess diagrams? It's the mann (a non-royal king), also called a guard. The four icons are below. The best letter code to use I think is either "m" (mann), or "g" (guard). Thanks to anyone who is able to help.

  • Mann white on light (an icon of the chess piece).png Mann white on dark (an icon of the chess piece).png Mann black on light (an icon of the chess piece).png Mann black on dark (an icon of the chess piece).png (m = mann)

LithiumFlash (talk) 14:43, 14 March 2017 (UTC)

a b c d e f g h
8
Chessboard480.svg
a8 black rook
b8 black knight
c8 black bishop
d8 black queen
e8 black mann
f8 black bishop
g8 black knight
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
f7 black pawn
g7 black pawn
h7 black pawn
e5 black pawn
e4 white pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
d1 white queen
e1 white mann
f1 white bishop
g1 white knight
h1 white rook
8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
Testing some new pieces
Thanks Frietjes. I uploaded two new images with transparent backgrounds:
"Mann" (white, transparent background): Mann (white). (black, transparent background): Mann (black).
I don't need them right away, but I just wanted to make them available if anyone else would like to use them in a diagram. I may use them in future work. Btw, I overlooked that you are recommending a special format for the filenames. Let me know if you would like me to upload any of the images again with the special filename. I can do the two transparent images, or all six (whatever is best). Thanks again.LithiumFlash (talk) 21:33, 14 March 2017 (UTC)
LithiumFlash, unfortunately the rotated rook (m) and queen already exist (g). so, we have two options, (1) would be to find a new letter (or pair of letters) to use as the abbreviation. for example, for capital M the image should be 45x45 pixels and svg, you would need to upload it as c:File:Chess Mdt45.svg (dark) and c:File:Chess Mlt45.svg (light). unfortunately, the number of open letters is very small right now. another option (2) would be to extend the template to allow the user to override the default images. for example, we could allow one to write |md=Mann_(black_on_transparent).png and |ml=Mann_(white_on_transparent).png or something like that. I don't know what the best choice is. Frietjes (talk) 22:30, 14 March 2017 (UTC)
I think uppercase "M" is fine as you suggest. However, the software I use cannot make .svg files. (But I can reduce images to 45 x 45). Will the template work with .png images? If not, then I think I'll just skip this effort for now, unless there is someone else who can convert the images to .svg. I did create the Mann images for another Wikipedia article (Uploaded 4 images but only used 2, thinking the whole set might be useful later).
Allowing an override to use custom images would be a good idea too (from the editing side, but I don't know about modifying code that converts diagram text into the image). Thanks for your support. Let me know if reducing the images to 45x45, and uploading as .png is useful. If not, I'll put this on hold. Thanks.LithiumFlash (talk) 02:26, 15 March 2017 (UTC)
LithiumFlash, the pattern used by the module requires svg images right now. the best program for creating SVGs is probably Inkscape, which is free. or, you can try asking at Wikipedia:Graphics Lab, which has some Inkscape power users. Frietjes (talk) 13:04, 15 March 2017 (UTC)
Thank you Frietjes. I'll ask the Graphics lab if they can convert the images. I already reduced them to 45x45, and touched them up a little. They have the filenames as the required by the module, but just not the correct the filetype yet. I'll notify you (or this talk page) once svg files are created.Thanks again.LithiumFlash (talk) 20:01, 15 March 2017 (UTC)
Frietjes, graphic artist ♫CheChe♫ made the following icons which I think are perfect. So I believe they can now be added to the chess diagram module. I really appreciate it (to you or any other editor who can help).
Chess Mdt45.svgChess Mlt45.svg
Once I know they work for sure, I can also add them to c:Template:SVG_chess_pieces. Thank you,LithiumFlash (talk) 19:08, 16 March 2017 (UTC)
LithiumFlash, looks like they are working, see the diagram posted above. I will add the 'alt text' for these in the module. feel free to add them to the table at commons, and to the documentation for this template. I would add them, but you would probably do a better job explaining the pieces. Frietjes (talk) 19:22, 16 March 2017 (UTC)
Thanks Frietjes, I added the new icons on the template (SVG chess pieces), and the chess diagram page (Chess diagram). I believe everything is in good order, and this gives me and other editors more capability when writing articles about chess variants and the pieces. Thank you.LithiumFlash (talk) 22:36, 16 March 2017 (UTC)

Need help to add Centaur piece[edit]

a b c d e f g h
8
Chessboard480.svg
a8 black rook
b8 black knight
c8 black bishop
d8 black queen
e8 C e
f8 black bishop
g8 black knight
h8 black rook
a7 black pawn
b7 black pawn
c7 black pawn
d7 black pawn
e7 black pawn
f7 black pawn
g7 black pawn
h7 black pawn
a2 white pawn
b2 white pawn
c2 white pawn
d2 white pawn
e2 white pawn
f2 white pawn
g2 white pawn
h2 white pawn
a1 white rook
b1 white knight
c1 white bishop
d1 white queen
e1 C e
f1 white bishop
g1 white knight
h1 white rook
8
7 7
6 6
5 5
4 4
3 3
2 2
1 1
a b c d e f g h
Testing some new pieces

I've tried adusting the template here -> https://commons.wikimedia.org/wiki/Template:SVG_chess_pieces

But without success. Any help will be appreciated.

https://commons.wikimedia.org/wiki/File:Chess_Clt45.png

https://en.wikipedia.org/wiki/File:KnightKing.png

Sunny3113 (talk) 12:10, 29 March 2017 (UTC)

Sunny3113, read the thread directly above. it must be SVG (not PNG) and 45x45, as described above. Frietjes (talk) 13:53, 29 March 2017 (UTC)
Frietjes Maybe you know how to convert it properly, i've never done any vector scaling before. Sunny3113 (talk) 14:08, 29 March 2017 (UTC)
Sunny3113, read the thread directly above, it has instructions about converting it to SVG. Frietjes (talk) 14:10, 29 March 2017 (UTC)
I managed to convert .PNG to .SVG finally. What is the next step now? https://en.wikipedia.org/wiki/File:Chess_Cet45.svg Sunny3113 (talk) 14:53, 31 March 2017 (UTC)
Sunny3113, you will probably want to fix them so that they have the correct transparency, and so there is a light/dark version (see the tests posted above). also, if you want a single letter, it looks like capital "C" is open (so upload as c:File:Chess_Clt45.svg light and c:File:Chess_Cdt45.svg dark). someone like User:CheChe could help. Frietjes (talk) 23:06, 31 March 2017 (UTC)

Adding centaur piece[edit]

Rquesting merging "Centaur" piece Sunny3113 (talk) 15:42, 31 March 2017 (UTC) Sunny3113 (talk) 15:42, 31 March 2017 (UTC)

Not done: please make your requested changes to the template's sandbox first; see WP:TESTCASES. — JJMC89(T·C) 16:08, 31 March 2017 (UTC)

New fairy chess pieces on chess diagram.[edit]

Hello eęverybody. I am not familiar with IT and ask help. Could you help make chess diagram template which can use more fairy chess pieces than now; For example Amazone; A. Locust;LO, Lion; LI Rook-Lion;TL; Bishop-Lion Zebra; Z; Rose and a lot others. In internet (not in wikipedia), they all are on chess diagrams. If somebody of IT specialists could make such chess diagram many chess problemists will thankfull to You.--AndriejūnasK (talk) 08:21, 19 October 2017 (UTC)