It is currently Sat May 03, 2025 6:26 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
Offline
 Post subject: Batch export SGFs
Post #1 Posted: Tue Nov 19, 2013 2:56 pm 
Lives in gote
User avatar

Posts: 614
Liked others: 28
Was liked: 65
Rank: 1 Kyu KGS
KGS: 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 :)

_________________
1k KGS

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #2 Posted: Tue Nov 19, 2013 3:20 pm 
Lives in gote
User avatar

Posts: 314
Location: Germany
Liked others: 10
Was liked: 128
Rank: KGS 4k
Why not do it yourself in python?

Check out http://senseis.xmp.net/?GoTypesetting
Also, 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.

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #3 Posted: Tue Nov 19, 2013 4:08 pm 
Lives in gote
User avatar

Posts: 614
Liked others: 28
Was liked: 65
Rank: 1 Kyu KGS
KGS: 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.

_________________
1k KGS

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #4 Posted: Tue Nov 19, 2013 5:20 pm 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
KGS: RBerenguel
Tygem: rberenguel
Wbaduk: JohnKeats
Kaya handle: RBerenguel
Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
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

_________________
Geek of all trades, master of none: the motto for my blog mostlymaths.net

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #5 Posted: Tue Nov 19, 2013 10:59 pm 
Gosei
User avatar

Posts: 1582
Location: Hong Kong
Liked others: 54
Was liked: 544
GD Posts: 1292
http://www.u-go.net/classic/

_________________
http://tchan001.wordpress.com
A blog on Asian go books, go sightings, and interesting tidbits
Go is such a beautiful game.

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #6 Posted: Wed Nov 20, 2013 12:03 am 
Judan

Posts: 6269
Liked others: 0
Was liked: 796
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

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #7 Posted: Mon Nov 25, 2013 8:32 pm 
Beginner

Posts: 15
Liked others: 0
Was liked: 3
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?

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #8 Posted: Tue Jun 10, 2014 4:41 am 
Dies in gote

Posts: 23
Liked others: 28
Was liked: 1
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

Top
 Profile  
 
Offline
 Post subject: Re: Batch export SGFs
Post #9 Posted: Tue Jun 10, 2014 12:32 pm 
Dies with sente
User avatar

Posts: 71
Liked others: 10
Was liked: 19
Rank: 20 kyu
If you haven't already translated all the problems to sgf you may have a look at :
https://github.com/MonsieurCactus/scrapeGo

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group