commit e2817f03e2fcb1ea2c67171af8285682218bc120
parent b612ef736b986ac1918ae580b5b422ac64c206de
Author: Robert Russell <robert@rr3.xyz>
Date: Mon, 26 Aug 2024 04:42:19 -0700
Add README
Diffstat:
| A | README | | | 22 | ++++++++++++++++++++++ |
1 file changed, 22 insertions(+), 0 deletions(-)
diff --git a/README b/README
@@ -0,0 +1,22 @@
+Tools for creating sandpile [1] art in farbfeld [2] format
+
+Example:
+ spgen 64 64 \ # Create a 64x64 sandpile
+ 00,00:16,16:256 \ # Place 256 sand on each cell in the upper left 16x16 block
+ 48,00:16,16:256 \ # Same, for the lower left 16x16 block
+ 48,48:16,16:256 \ # Same, for the lower right 16x16 block
+ 00,48:16,16:256 \ # Same, for the upper right 16x16 block
+ | spstabilize4 # Topple the sandpile until it's stable
+ | sp2ff # Convert to farbfeld by assigning colors to sand amounts
+ | ff2png > out.png # Convert to PNG for real use
+
+Additional notes:
+ - There is also spstabilize8, which topples sand into the surrounding 8
+ neighbours instead of the adjacent 4 with spstabilize4.
+ - sp2ff accepts arguments to control the output colours. See `sp2ff -h`.
+ - There is also ff2sp, which converts a grayscale farbfeld image to a
+ sandpile by placing a given amount of sand on each pixel that is whiter
+ than a threshold (which is 0x8888 by default).
+
+[1] https://en.wikipedia.org/wiki/Abelian_sandpile_model
+[2] https://tools.suckless.org/farbfeld