Page 1 of 1
Batch export SGFs
Posted: Tue Nov 19, 2013 2:56 pm
by Numsgil
I'm translating problems in the Gokyo Shumyo to SGF format, as I haven't been able to find these anywhere in that format with a permissive license (unless anyone knows of a source?). My goal is to process each problem's SGFs in to 8 different PNGs, for each orientation and color combination. Maybe even add some 'noise' stones to vary the positions a little. And also include a solution PNG for each one (with solutions pulled from Sensei's library, probably). SGF format is nice since it's just plain text and I can goof around with it in Python.
Drago can export positions in to PNGs, but I need some way to automate the process. Is there a way to either batch process SGFs through Drago on the command line or through the GUI or some other SGF to PNG converter that people would recommend? I like the diagrams Drago is spitting out but no way I'm going to go through each generated SGF and export them manually

Re: Batch export SGFs
Posted: Tue Nov 19, 2013 3:20 pm
by leichtloeslich
Why not do it yourself in python?
Check out
http://senseis.xmp.net/?GoTypesettingAlso,
tikz pgf is nice for graphics in LaTeX.
You might also consider drawing the diagrams in SVG, which can easily be batch-converted to PNG.
Re: Batch export SGFs
Posted: Tue Nov 19, 2013 4:08 pm
by Numsgil
Basically I want to do as little effort on this as possible

Transcribing all the problems in to SGF format is already exhausting, and fiddling around with typesetting to build a SGF-to-something converter isn't my idea of a good time.
So far I've found
sgfutils, which is GPL, which is nice. It's aimed at linux, and I'm a windows man, but I was able to get it to compile for windows with some fiddling. It uses the imagemagick command 'convert', and pipes everything to the command line, so I had to install imagemagick for windows and add it to the path. It's managed to blow the command line limit in windows for a few test games I tried doing, but it might do okay with smaller diagrams for problems. It's a passable but not great solution. I'm still looking for something better if anyone finds something.
Re: Batch export SGFs
Posted: Tue Nov 19, 2013 5:20 pm
by RBerenguel
I've made animated gifs from SGF with sgftools. Essentially it does what you want (I've also done some animated tsumegos heh) I'll dig the command if you want, but for the png part it's just sgftools, barebones with imagemagick
Re: Batch export SGFs
Posted: Tue Nov 19, 2013 10:59 pm
by tchan001
Re: Batch export SGFs
Posted: Wed Nov 20, 2013 12:03 am
by RobertJasiek
Try GoWrite, which offers some batch functionality. I have not needed batches, but maybe it has the kind you need.
http://gowrite.net/GOWrite2.html
Re: Batch export SGFs
Posted: Mon Nov 25, 2013 8:32 pm
by zorq
Numsgil wrote:So far I've found
sgfutils. It's aimed at linux, and I'm a windows man, but I was able to get it to compile for windows with some fiddling. ... It's managed to blow the command line limit in windows for a few test games I tried doing...
Does the -maxcommandsz option help?
Re: Batch export SGFs
Posted: Tue Jun 10, 2014 4:41 am
by Jaafar
To convert a large number of sgf files to png with Drago:
- Put all the sgf files in a folder
- File > Open folder
- File > Export
- In the Games tab choose All or select the sgfs you want to convert
- Choose in Formats tab: HTML & PNG
- Change the size of the generated images in layout tab by changing figure ratio an figures per line
- Click the Goban button and select Zoom on corner
- Hit Export figures
- You can rename the 001 part in the first field
- Enjoy
Re: Batch export SGFs
Posted: Tue Jun 10, 2014 12:32 pm
by pleiade67
If you haven't already translated all the problems to sgf you may have a look at :
https://github.com/MonsieurCactus/scrapeGo