Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/loiccoyle/phomo-rs
📷 Rust library, binary and wasm package to create photo mosaics
https://github.com/loiccoyle/phomo-rs
image-processing mosaic photomosaic rust wasm
Last synced: 2 months ago
JSON representation
📷 Rust library, binary and wasm package to create photo mosaics
- Host: GitHub
- URL: https://github.com/loiccoyle/phomo-rs
- Owner: loiccoyle
- License: mit
- Created: 2024-10-11T20:50:16.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-10-24T02:17:09.000Z (2 months ago)
- Last Synced: 2024-10-24T13:22:55.690Z (2 months ago)
- Topics: image-processing, mosaic, photomosaic, rust, wasm
- Language: Rust
- Homepage: http://loiccoyle.com/phomo-rs/
- Size: 5.11 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Easy photo mosaics
Make your own photo mosaics here!
> Prefer python? Check out [`loiccoyle/phomo`](https://github.com/loiccoyle/phomo)!
This repo contains two crates:
- `phomo` crate contains the photo mosaic generation library.
- `phomo-cli` crate provides the command line interface to the `phomo` crate.And one `npm` package:
- `phomo-wasm` provides the `wasm` bindings and allows `phomo` to be used in the browser.
## 📦 Installation
## Command line
### Cargo
To use the `phomo` binary to build photo mosaics, install the `phomo-cli` crate:
```sh
cargo install phomo-cli
```### Arch linux (AUR)
Using your favourite AUR helper, install the `phomo-git` package:
```sh
paru -S phomo-git
```### Usage
Once installed, you can use the `phomo` binary.
Something like:
```sh
phomo master_image.png tile_directory/ output_mosaic.png
```If doubt see the help:
```console
$ phomo -h
Usage: phomo [OPTIONS]Arguments:
Master image
Tile directory
Output mosaic fileOptions:
-g, --grid-size Grid size, the number of tiles along the width and height
--crop-tiles Crop tiles to grid cell size
--resize-tiles Resize tiles to grid cell size
--equalize Equalize the master and tile image color distributions
--transfer-master-to-tiles Transfer the color palette of the master image to the tile images
--transfer-tiles-to-master Transfer the color palette of the tile images to the master image
--metric The distance metric to use [default: norm-l1] [possible values: norm-l1, norm-l2]
-v, --verbose... Increase logging verbosity
-q, --quiet... Decrease logging verbosity
-h, --help Print help (see more with '--help')
-V, --version Print version
```## Library
To use the library as a dependency in your projects, add the `phomo` crate:
```sh
cargo add phomo
```See the [docs](https://docs.rs/phomo) for usage.
## Wasm
To use the `wasm` bindings in your project, add the `phomo-wasm` `npm` package:
```sh
npm add phomo-wasm
```I would recommend taking a look at the [demo page's source code](https://github.com/loiccoyle/phomo-rs/tree/gh-pages).