From 798a7a6193cb0dda18788034941275bb9f75ec56 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Mon, 1 Nov 2021 23:09:48 -0400 Subject: Add a README --- README.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d819024 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +k-d forests +=========== + +An implementation of [k-d forests](https://tavianator.com/2020/porting_kd_forests.html). + +This code generates images containing every possible color, in the style of [this Code Golf answer](http://codegolf.stackexchange.com/a/22326) by József Fejes. +Colors are placed on the image one by one, next to the closest pixel already filled in. + +Images +------ + +The full 24-bit, 4096×4096 image is generated by default, which takes a while: + + $ cargo run --release + Generating a 4096x4096 image (16777216 pixels) + 100.00% | 159 kpx/s | max frontier size: 267592 + +To try it out quickly, generate an image with reduced bit depth: + + $ cargo run --release -- -b19 + Generating a 1024x512 image (524288 pixels) + 100.00% | 285 kpx/s | max frontier size: 18719 + +There are many flags that control the order colors are placed, and how the location for each color is selected. +Pass `--help` to see the available options. + +Video +----- + +To make a video of the generation process, pass the `-a`/`--animate` flag, and pipe the output into `ffmpeg`. +For example: + + $ cargo run --release -- -b23 -w3840 -h2160 -a | ffmpeg -f image2pipe -r 60 -i - -c:v libx265 -x265-params lossless=1 kd-forest.mkv -- cgit v1.2.3