From 7edac8e1796e9f021c7a990e8efdfe233a8eec69 Mon Sep 17 00:00:00 2001 From: y-jan137 Date: Wed, 29 Apr 2026 10:55:08 +0300 Subject: README --- README.md | 27 ++++++++++++++++++++------- examples/input-1920x1080.jpg | Bin 294494 -> 0 bytes examples/input-1920x1080.png | Bin 0 -> 294494 bytes examples/input-735x554.png | Bin 0 -> 92463 bytes examples/input-736x736.png | Bin 0 -> 159870 bytes examples/output-1920-1080.jpg | Bin 438790 -> 0 bytes examples/output-1920-1080.png | Bin 0 -> 438790 bytes examples/output-735x554.png | Bin 0 -> 685666 bytes examples/output-736x736.png | Bin 0 -> 1404255 bytes 9 files changed, 20 insertions(+), 7 deletions(-) delete mode 100644 examples/input-1920x1080.jpg create mode 100644 examples/input-1920x1080.png create mode 100644 examples/input-735x554.png create mode 100644 examples/input-736x736.png delete mode 100644 examples/output-1920-1080.jpg create mode 100644 examples/output-1920-1080.png create mode 100644 examples/output-735x554.png create mode 100644 examples/output-736x736.png diff --git a/README.md b/README.md index ef7e82e..b2d2fb8 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,25 @@ +# GPU Pixel Sort + +Inspired by this video + + +## Run ```bash swift build -c release -./.build/release/pixel-sort input.png output2.png --lower 0.2 --upper 0.8 --key brightness +./.build/release/pixel-sort input_img.png output_img.png [options] ``` -Performance target: 2ms max for 1080p +
+ + +
+ +
+ + +
-Shader optimization bottlenecks: -- VRAM -- Shader code itself - - Texture sampling (memory bandwidth): precalculate sorting value (SortKey) - - +
+ + +
diff --git a/examples/input-1920x1080.jpg b/examples/input-1920x1080.jpg deleted file mode 100644 index 98091b0..0000000 Binary files a/examples/input-1920x1080.jpg and /dev/null differ diff --git a/examples/input-1920x1080.png b/examples/input-1920x1080.png new file mode 100644 index 0000000..98091b0 Binary files /dev/null and b/examples/input-1920x1080.png differ diff --git a/examples/input-735x554.png b/examples/input-735x554.png new file mode 100644 index 0000000..2398384 Binary files /dev/null and b/examples/input-735x554.png differ diff --git a/examples/input-736x736.png b/examples/input-736x736.png new file mode 100644 index 0000000..1a43128 Binary files /dev/null and b/examples/input-736x736.png differ diff --git a/examples/output-1920-1080.jpg b/examples/output-1920-1080.jpg deleted file mode 100644 index c0b4f07..0000000 Binary files a/examples/output-1920-1080.jpg and /dev/null differ diff --git a/examples/output-1920-1080.png b/examples/output-1920-1080.png new file mode 100644 index 0000000..c0b4f07 Binary files /dev/null and b/examples/output-1920-1080.png differ diff --git a/examples/output-735x554.png b/examples/output-735x554.png new file mode 100644 index 0000000..90cea92 Binary files /dev/null and b/examples/output-735x554.png differ diff --git a/examples/output-736x736.png b/examples/output-736x736.png new file mode 100644 index 0000000..e2043a7 Binary files /dev/null and b/examples/output-736x736.png differ -- cgit v1.2.3