From cf000407b8d2d4e75a6f56b5d111f3e55e7400e5 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 22 May 2023 12:53:03 +0100 Subject: Added rotate tiles tool --- tools/rotate.md | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tools/rotate.md (limited to 'tools/rotate.md') diff --git a/tools/rotate.md b/tools/rotate.md new file mode 100644 index 0000000..ab95c07 --- /dev/null +++ b/tools/rotate.md @@ -0,0 +1,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 +``` + -- cgit v1.2.3