aboutsummaryrefslogtreecommitdiff
path: root/tools/rotate.md
blob: ab95c0731f1d444b74be6e8ff275ab65477ed4f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Rotate tiles

This tool can be used to transform an image containing a tileset into a new
one with a single column of tiles, so can be loaded with ".incpng" and the
result is easy to index.

For example, given 6 tiles of 8x8 pixels in `origin.ong`:

```
012345
```

The command `./rotate.py origin.png 8 8 dest.png` will generate an image with
the tiles rearranged like this:

```
0
1
2
3
4
5
```

In this way tile 0 is in `addr`, tile 1 in `addr + 64`, tile 2 in `addr + 128`, etc.

## Requirements

The tool requires:

- Python 3
- PIL (or Pillow)

For example, you can install Pillow with:

```
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade Pillow
```