sgftopng

SGF is a format that describes go games or go positions.
The utility sgftopng converts SGF files to diagrams. For example,
% cat stelling.sgf
(;GM[1]FF[4]
SZ[19]VW[an:ms]
GN[Een stelling]
PC[Amsterdam]
DT[1976-11-19]
C[http://www.win.tue.nl/~aeb/games/stelling3.png]
PL[B]
AB[ds][dr][er][es][fq][gq][hq][iq][jr][kr][js][ks]
AW[cs][cr][cq][dq][eq][ep][fp][go][hp][ip][jp][jq][kq][lq][lr][ls];
B[gs];W[fr];B[is];W[gr];B[hr];W[fs];B[er];W[hs];B[es];W[ir];B[gs];
LB[jr:a])

% ./sgftopng diag0.png -0 < stelling.sgf
% ./sgftopng diag1.png 1-6 < stelling.sgf
% ./sgftopng diag2.png 7-11 < stelling.sgf
% ./sgftopng diag3.png 12- < stelling.sgf
produces the diagram of a problem

and its solution:

The format of the outputfile is determined by its extension, and can be, e.g., .png, .jpg or .gif, or anything else understood by the convert utility from ImageMagick (which is used to draw the diagrams).

One can select variations in a game:

% ./sgftopng -info < ChoHunhyun-LeeChangho37443.sgf
Game #1
var 1: (1-8 (9-15 (16-165)
var 2:            (16-20 (21-24)
var 3:                   (21-26)))
var 4:      (9-18))

% ./sgftopng -var 2 -from 1 diagvar2.png 16-24 < ChoHunhyun-LeeChangho37443.sgf
yields