Hi!
I saw that Drago could export go games using gif format. Is it possible to export an animated gif displaying the game from the beginning to the end of the game? If not, does anyone know how to do this?
Anyway, thanks for this wonderful software!
Cheers, Johan
Assuming you have created your images, named game001.png to game100.png (for each board position from move 1 to move 100), then with imagemagick installed, the command
convert -delay 50 -loop 0 game*.png animate.gif
will create an animated gif from these images.
One way to automate the creation of these pngs is to use this Sgf thumbnailer and the following perl script with the name of the sgf file and the desired number of moves supplied as arguments. Example output.
Using Windows, you would need to install perl, imagemagick and then copy the script below into the thumbnailer directory.
use sgfThumbnailer;
my ($in, $movenumber) = @ARGV;
my $writer = new sgfThumbnailer();
$writer->scale(256);
$writer->realboard(1);
for (1..$movenumber) {
$writer->maxmoves($_); $writer->makeimage($in, join '', 'game', sprintf("%03d", $_), '.png');
}
A video format can result in a file 5-10 times smaller than an animated gif. On a linux box the command
avconv -r 2 -i game%03d.jpg video.avi
would create such a thing (I found i had to convert the images to jpgs first (mogrify -format jpg *.png))
Thanks for your replies, I will try your suggestions. I think that embedding such a gif on a webpage is easier and simplier than putting the SGF file or an online SGF editor.
I use sgfutils (see here for example: http://homepages.cwi.nl/~aeb/go/sgfutils/html/) within a bash script to generate an image per move and then gifsicle (it's faster and more polished for this job, it's a great tool for any other animated gif use case) to generate the final animated gif.