new README and examples

with caveats about blanks & square pictures
This commit is contained in:
Jack Wines 2024-02-05 02:58:07 -08:00
parent 67c7962634
commit 8ad7407935
No known key found for this signature in database
GPG key ID: 25B20640600571E6
7 changed files with 22 additions and 8 deletions

View file

@ -1,15 +1,29 @@
# image-triangles
Makes a [voroni diagram](https://en.wikipedia.org/wiki/Voronoi_diagram) and fills each cell with the average color the image below in. Please note, there's currently a bug, only square images will work. Additionally, some cells will be blank.
### examples
![Sierra mountains original](examples/sierra.jpg)
![Sierra mountains post-filter](examples/sierra-result.svg)
![Dog original](examples/luna.jpeg)
![Dog post-filter](examples/luna-result.svg)
<!-- ![Sierra mountains original](examples/sierra.jpg) -->
<!-- ![Sierra mountains post-filter](examples/sierra-result.svg) -->
![Hawaii original](examples/birds-eye-view.png)
![Hawaii post-filter](examples/birds-eye-view.svg)
![Dog original](examples/luna-but-square.jpeg)
![Dog post-filter](examples/luna-but-square.svg)
### to run:
#### with nix
```
nix run --experimental-features 'nix-command flakes' -- --cornerCount 800 --input examples/birds-eye-view.png --output output.svg
```
#### with cabal
Install [cabal & ghc](https://www.haskell.org/ghcup/) if you don't have them.
```
cabal update
cabal run image-triangles -- --cornerCount 800 --input examples/sierra.jpg --output output.svg
cabal run image-triangles -- --cornerCount 800 --input examples/birds-eye-view --output output.svg
```