Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CLI options to documentation, fix CLI example #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,13 @@ You can use the following task to create a mosaic via the CLI with files on your

```sh
$ npm install -s photosaic
$ node ./node_modules/photosaic/dist/tasks/createMosaic.js -i ./pathToMosaicFile.js --dir ./path/to/sub/images -g 40 -w 1000
$ node ./node_modules/photosaic/dist/tasks/createMosaic.js -i ./pathToMosaicFile.png --dir ./path/to/sub/images -g 40 -w 1000
```
There are several options for the CLI which correspond to the constructor options:
- input:`-i | --input` The image of the final mosaic that will be created.
- single sub image: `-s | --sub` Path of a single sub image.
- sub image directory: `--dir` The small, sub images that will be used to build the mosaic.
- grid number: `-g | --grid` The final mosaic will be made up of a `gridNum x gridNum` grid of subImages.
- intensity: `--intensity` Number between 0-1 indicating the opacity of the shading on the subImages to help make the output image clearer. 0 is fully transparent shading (main image will be impossible to see), 1 is fully opaque (subImages will be impossible to make out). The default of 0.5 should be fine in most cases.
- output width: `-w | --width` Number of pixels the output mosaic's width will be (height will auto scale).
- algorithm to use: `-a | --algo` Choose between `closestColor` (default) and `random`. See examples above.