Page 1 of 1
A command line tool to make a picture of a chess position
Posted: Fri Jan 31, 2020 9:29 pm
by Roland Chastain
Hello!
I would like to present a very simple command line tool, that makes a picture of a chess position.
https://github.com/rchastain/chess-image
For now it accepts three arguments: an EPD string, the desired size of the picture, and the name of the file to create.
Code: Select all
chess-image -p "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -" -s 320 -o position.png
chess-image --position="rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -" --size=320 --output=position.png
Maybe I will add more options if someone is interested.
Regards.
Roland
Re: A command line tool to make a picture of a chess position
Posted: Sat Feb 01, 2020 12:06 am
by JohnW
Is there an advantage to using the command line instead of using something like Fritz 17 or Arena?
Re: A command line tool to make a picture of a chess position
Posted: Sat Feb 01, 2020 12:48 am
by Ovyron
One advantage would be not needing to use a GUI like Fritz 17 or Arena.
Re: A command line tool to make a picture of a chess position
Posted: Sat Feb 01, 2020 5:08 am
by Dann Corbit
JohnW wrote: ↑Sat Feb 01, 2020 12:06 am
Is there an advantage to using the command line instead of using something like Fritz 17 or Arena?
Imagine if you wanted to do 15,000 images.
Re: A command line tool to make a picture of a chess position
Posted: Sat Feb 01, 2020 8:48 am
by Guenther
This thread links to two similar tools with batch capability.
http://talkchess.com/forum3/viewtopic.p ... vg#p785948
Re: A command line tool to make a picture of a chess position
Posted: Sat Feb 01, 2020 10:00 am
by Roland Chastain
Thank you for your comments.
Dear Guenther, thank you for the link. I didn't know that Python had a standard chess library. Very interesting.
I could easily add HTML output. I have some code ready for that. If I understand you correctly, by batch capability you mean that the tool accepts as argument an EPD file and generates an HTML document with all positions?
Re: A command line tool to make a picture of a chess position
Posted: Sat Feb 01, 2020 2:21 pm
by JohnW
Dann Corbit wrote: ↑Sat Feb 01, 2020 5:08 am
JohnW wrote: ↑Sat Feb 01, 2020 12:06 am
Is there an advantage to using the command line instead of using something like Fritz 17 or Arena?
Imagine if you wanted to do 15,000 images.
That's a good point, though I can't imagine ever wanting to do that I am sure somebody would.
chess-image 0.2
Posted: Sun Feb 02, 2020 12:39 pm
by Roland Chastain
Hello!
A new version is available.
https://github.com/rchastain/chess-image/releases
Two options have been added:
- -f <font> or --font=<font>
- -c or --coordinates
The possible values for the
font parameter are:
adventurer, montreal.
The borders with coordinates aren't available for the Chess Montreal font. If you ask the coordinates with that font, the option is ignored without warning.
Regards.
Roland