Website founded by
Milan Velimirović
in 2006

4:56 UTC
ISC 2023



Remember me

Forgot your
Click here!
to create your account if you don't already have one.

Rating lists


MatPlus.Net Forum General Getting the FEN string from a diagram in this forum.
You can only view this page!
(1) Posted by Rosie Fay [Thursday, Jul 15, 2021 15:20]

Getting the FEN string from a diagram in this forum.

Given a diagram in a message in a topic in this forum, how do I obtain the corresponding FEN string in plain text?

You can do this in Chess Stack Exchange ( because this allows any user (with enough reputation points) to edit any message -- this gives the code from which a diagram was produced, and this code includes the FEN. Not that I intend to go around editing anybody else's messages, but how do I obtain the FEN for a diagram in MAT Plus?
(Read Only)pid=21364
(2) Posted by Dmitri Turevski [Thursday, Jul 15, 2021 16:55]

This works in Chrome: right-click the diagram and select "Copy image address". The copied address includes something very similar to the FEN string (only position part w/o slashes, also it apparently does some aritmetics: 88 becomes 16):
Not sure if it's really useable, though.
(Read Only)pid=21365
(3) Posted by Rosie Fay [Thursday, Jul 15, 2021 17:49]

Thank you! That really has helped. I already have a program which takes plain text input, including FEN strings, and turns it into Tex which, with the help of Ulrike Fischer's package "chessboard", produces a PDF with lovely diagrams which I can view using SumatraPDF. My program doesn't understand MAT Plus fen, but it must be possible to do that. So, usable after a bit of work.
(Read Only)pid=21366
(4) Posted by Hauke Reddmann [Thursday, Jul 15, 2021 20:55]

Firefox can do the same. My suggestion, since you have to
convert it anyway: A mini python proggie which grabs the
URL*, reads its source, scans for FEN images and
converts it to standard FEN. Would cost me half an hour
maximum to write working Python code for that...

* e.g.
("requests" is no standard package and must be pip-installed!
Windows-R, execute "pip install requests")

import requests

url = "";
#URL example - kill the semicolon, system inserted it!
html_output_name = "out.txt"

req = requests.get(url, "html.parser")

with open(html_output_name, "w", encoding="utf-8") as f:
piccode = "src='i.php?f=" # all FEN pics start thus
with open(html_output_name, "r", encoding="utf-8") as f:
lines = f.readlines()
for line in lines:
if piccode in line:

Output - all FENs of the images in the URL

Untested if all images work this way!
(Read Only)pid=21367
(5) Posted by Hauke Reddmann [Friday, Apr 15, 2022 10:40]

EDIT: No, they don't - any pic generated by algebraic instead of forsyth
notation will also have its URL coded in algebraic notation.
Should be fairly simple to patch, but I'm too lazy at the moment
to write it :-)
(Read Only)pid=23039
(6) Posted by Hannu Harkola [Friday, Apr 15, 2022 20:09]

Helpmate Analyzer of Viktoras Paliulionis ( has the OCR - optical character recognition feature. Upload a chessboard image or paste it from the clipboard. The resulting diagram may be corrected if necessary (very often it is). Then copy the FEN below the diagram.
(Read Only)pid=23042
(7) Posted by Siegfried Hornecker [Saturday, Apr 16, 2022 07:42]

The chess composer edderiofer who also is well-versed in chess problem technology has sent me this link and allowed to post it in the forum also:

(Sorry for the two notes then, Hauke! I sent them prior.)

EDIT: It does not handle fairy pieces usually, I was told.
(Read Only)pid=23044
(8) Posted by [Monday, Jun 20, 2022 12:39]

It is possible to do a gradient on borders but it takes a little bit of trickery. For example:
(Read Only)pid=23375

No more posts

MatPlus.Net Forum General Getting the FEN string from a diagram in this forum.