# 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. Some cells will be blank.

### examples
![Sierra mountains original](examples/sierra.jpg)
![Sierra mountains post-filter](examples/sierra-result.svg)
![Hawaii original](examples/birds-eye-view.webp)
![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.webp --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/birds-eye-view.webp --output output.svg
```

