Svg diagrams backend to jpeg was to make it easier to render & share. The existing method stressed firefox if too many shapes were there. The new voronoi diagram method is much faster. Examples now take approximately 40 seconds to render as opposed to the 5-10 minutes previously. In short, it no longer makes the Delunay triangulation. It feeds the 20 closest points to the candidate midpoint. Those points turn out to be enough, no need to construct the planar graph. Additionally, dependencies were bumped.
29 lines
868 B
Markdown
29 lines
868 B
Markdown
# 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.
|
|
|
|
### examples
|
|

|
|

|
|

|
|

|
|

|
|

|
|
|
|
|
|
### to run:
|
|
|
|
#### with nix
|
|
|
|
```
|
|
nix run --experimental-features "nix-command flakes" ".#" -- --minDistance 0.02 --input examples/birds-eye-view.png --output output.jpeg
|
|
```
|
|
|
|
#### with cabal
|
|
Install [cabal & ghc](https://www.haskell.org/ghcup/) if you don't have them.
|
|
|
|
```
|
|
cabal update
|
|
cabal run image-triangles -- --minDistance 0.02 --input examples/birds-eye-view.png --output output.jpeg
|
|
```
|
|
|