Update README and dependencies

This commit is contained in:
2023-10-19 22:46:19 +02:00
parent ec9476b205
commit 4789c04b3d
3 changed files with 118 additions and 84 deletions

View File

@@ -2,6 +2,33 @@
Create a photo mosaic out of any tileset and source image!
## Build
1. Use [rustup](https://rustup.rs/) to install the rust compiler.
2. Compile the project with `cargo build -r`. The resulting binary is located in `./target/release/themis`
3. Run the binary either from the `./target` directory or with `cargo run -r -- -h`
## Usage
Clone the repo and run `cargo run --release -- -h`, everything will be explained
### Flags
- `-h`, `--help`: Prints the help dialog
- `-k`, `--keep-aspect-ratio`: Keep the aspect ratio of the original image
- `-V`, `--version`: Print the current version of this program
### Options
- `-i`, `--input-dir <input-dir>`: Specify the path to the cover images.
These images are used to compile a mosaic image from the tiles.
- `-m`, `--mosaic-size <mosaic-size`: Specify the side length of tiles in the target image.
A mosaic therefore consists of `mosaic-size x mosaic-size` tiles. The default value is 128.
- `-o`, `--output-dir <output-dir`: The output directory where all finished mosaic images will be saved.
The default directory is `output`.
- `--tile-size <tile-size`: The side length of each tile (in pixel). This influences the image resolution inside a tile.
The default value is `26`.
- `-t`, `--tiles-dir <tiles-dir`: The directory which contains the tiles to utilize for the mosaic.
### Examples
```sh
cargo run -r -- -t ./mosaic_tiles -o ./mosaic_output -i ./cover_images -m 100 --tile-size 200
```
This example will take one or multiple cover images (sequentially) out of the `./cover_images` directory.
Themis then scales down the tiles out of `./mosaic_tiles` to `200 x 200` pixels and arranges
the tiles. The result will be a mosaic consisting of `100 x 100` tiles stored in `./mosaic_output`.