Jump to content

File:Aronian vs. Anand, Wijk aan Zee 2013.gif

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (800 × 800 pixels, file size: 2.25 MB, MIME type: image/gif, looped, 49 frames, 1 min 14 s)

Summary

Description
English: Animation of the Aronian vs. Anand chess game
Date
Source Own work
Author Morn

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Python code

#!/usr/bin/env python3

# Plot a PGN game using python-chess and ImageMagick

import os
import chess.pgn
import chess.svg

pgn = open('aronian_anand_2013.pgn')
game = chess.pgn.read_game(pgn)
board = game.board()

def svg(i):
    lm = board.peek()
    a = [(lm.from_square, lm.to_square)]
    s = chess.svg.board(board, arrows = a, size = 800)

    f1 = "g_%04u.svg" % i
    f2 = "g_%04u.png" % i

    with open(f1, 'w') as f:
        f.write(s)
    os.system("convert %s %s" % (f1, f2))
    os.system("rm %s" % f1)

i = 1

for m in game.mainline_moves():
    board.push(m)
    svg(i)
    i += 1

# pause animation at the end:
for j in range(3):
    svg(i)
    i += 1

# create animation with
# convert -delay 150 g_*.png -loop 0 g.gif

PGN

[Event "Tata Steel Group A"]
[Site "Wijk aan Zee NED"]
[Date "2013.01.15"]
[EventDate "2013.01.12"]
[Round "4"]
[Result "0-1"]
[White "Levon Aronian"]
[Black "Viswanathan Anand"]
[ECO "D47"]
[PlyCount "46"]

1. d4 d5 2. c4 c6 3. Nf3 Nf6 4. Nc3 e6 5. e3 Nbd7 6. Bd3 dxc4
7. Bxc4 b5 8. Bd3 Bd6 9. O-O O-O 10. Qc2 Bb7 11. a3 Rc8
12. Ng5 c5 13. Nxh7 Ng4 14. f4 cxd4 15. exd4 Bc5 16. Be2 Nde5
17. Bxg4 Bxd4+ 18. Kh1 Nxg4 19. Nxf8 f5 20. Ng6 Qf6 21. h3
Qxg6 22. Qe2 Qh5 23. Qd3 Be3 0-1

Captions

Add a one-line explanation of what this file represents

20 July 2023

image/gif

9d5581446e9f3e8c68122bd002e77b01be2dd636

2,358,110 byte

73.5 second

800 pixel

800 pixel

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current09:40, 20 July 2023Thumbnail for version as of 09:40, 20 July 2023800 × 800 (2.25 MB)MornUploaded own work with UploadWizard

The following page uses this file: