chess2png 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/README.md +55 -0
- data/assets/background.png +0 -0
- data/lib/chess2png/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c21078845d9d63a9c88e9568d767d0827ce4c99e
|
4
|
+
data.tar.gz: bd8e89c0e39c2750fc0492e3b124b0d978cc3b9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3151170270bd6a148b7a896df5445a509f04e40ea87da20730bfdedd1296388d0f5950f78a0c3ccd5711fb759b04c0dedbee6af2c835f94501e32e49c1770318
|
7
|
+
data.tar.gz: ebb36b21266446fbb9c7da23d5c6417ae4e8a3e70aca8374b0f34f2cbfa8257bd8eca90e81bf0b267b2b174e724371b4e7a5922c6bee902fdf3c1dd1d16f117c
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
# Chess2PNG
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
You know the drill.
|
6
|
+
|
7
|
+
```
|
8
|
+
gem install chess2png
|
9
|
+
```
|
10
|
+
|
11
|
+
Or, in your Gemfile:
|
12
|
+
|
13
|
+
```
|
14
|
+
gem "chess2png"
|
15
|
+
```
|
16
|
+
|
17
|
+
## Command usage
|
18
|
+
|
19
|
+
The `chess2png` command is pretty simple, more options will come:
|
20
|
+
|
21
|
+
```
|
22
|
+
Usage: chess2png -i input -o output
|
23
|
+
-i, --input PATH Path to a PGN file
|
24
|
+
-o, --output PATH Path where the resulting PNG file will be saved
|
25
|
+
```
|
26
|
+
|
27
|
+
With an example PGN file:
|
28
|
+
|
29
|
+
```
|
30
|
+
cat <<EOM >test.pgn
|
31
|
+
[Event "chp"]
|
32
|
+
[Site "USA"]
|
33
|
+
[Date "1956.??.??"]
|
34
|
+
[Round "?"]
|
35
|
+
[White "Byrne, D."]
|
36
|
+
[Black "Fischer, R."]
|
37
|
+
[Result "0-1"]
|
38
|
+
1.Nf3 Nf6 2.c4 g6 3.Nc3 Bg7 4.d4 O-O 5.Bf4 d5 6.Qb3 dxc4 7.Qxc4 c6 8.e4 Nbd7 9.Rd1 Nb6 10.Qc5 Bg4 11.Bg5 Na4 12.Qa3 Nxc3 13.bxc3 Nxe4 14.Bxe7 Qb6 15.Bc4 Nxc3 16.Bc5 Rfe8+ 17.Kf1 Be6 18.Bxb6 Bxc4+ 19.Kg1 Ne2+ 20.Kf1 Nxd4+ 21.Kg1 Ne2+ 22.Kf1 Nc3+ 23.Kg1 axb6 24.Qb4 Ra4 25.Qxb6 Nxd1 26.h3 Rxa2 27.Kh2 Nxf2 28.Re1 Rxe1 29.Qd8+ Bf8 30.Nxe1 Bd5 31.Nf3 Ne4 32.Qb8 b5 33.h4 h5 34.Ne5 Kg7 35.Kg1 Bc5+ 36.Kf1 Ng3+ 37.Ke1 Bb4+ 38.Kd1 Bb3+ 39.Kc1 Ne2+ 40.Kb1 Nc3+ 41.Kc1 Rc2+ 0-1
|
39
|
+
EOM
|
40
|
+
|
41
|
+
chess2png -i test.pgn -o out.png
|
42
|
+
```
|
43
|
+
|
44
|
+
![Output](https://i.imgur.com/T3BvYeJ.png)
|
45
|
+
|
46
|
+
## Library usage
|
47
|
+
|
48
|
+
`chess2png` is heavily based on [Chess](https://github.com/pioz/chess) and [chunky_png](https://github.com/wvanbergen/chunky_png) and it dont really
|
49
|
+
try to hide them away. It takes a `Chess::Board` instance and output a `ChunkyPNG::Image`.
|
50
|
+
|
51
|
+
```
|
52
|
+
board = Chess::Game.load_pgn(options[:input]).current
|
53
|
+
image = Chess2PNG.new.encode(board)
|
54
|
+
image.save(options[:output])
|
55
|
+
```
|
data/assets/background.png
CHANGED
Binary file
|
data/lib/chess2png/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chess2png
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Goya
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chess
|
@@ -63,6 +63,7 @@ files:
|
|
63
63
|
- ".gitignore"
|
64
64
|
- Gemfile
|
65
65
|
- Gemfile.lock
|
66
|
+
- README.md
|
66
67
|
- assets/Chess_bdt60.png
|
67
68
|
- assets/Chess_blt60.png
|
68
69
|
- assets/Chess_kdt60.png
|