tiler
tiler copied to clipboard
Parallelize and parameterize tile creation
I put gen_tiles.py
behind a CLI interface using click
, and parameterized the depth
and rotation
options such that you can supply them via the command line.
I parallelized tile creation with a thread pool, since numpy
releases the GIL. Also did some refactoring.
Here's the CLI interface:
alex@node:~/tiler$ python3 gen_tiles.py --help
Usage: gen_tiles.py [OPTIONS] IMG
Options:
-d, --depth INTEGER Color depth. [default: 4]
-r, --rotations INTEGER Rotations. [default: 0]
--help Show this message and exit.
alex@node:~/tiler$ python3 gen_tiles.py -r 0 -r 90 -r 180 ~/example.png
2%|â–ˆ | 6/375 00:05<07:24, 1.20s/i]
Fixed the progress bar in 9bba73d to account for multiple rotations