Find a file
2026-01-11 14:07:02 -05:00
comparators switch forge 2026-01-11 14:05:54 -05:00
examples add seam examples 2025-02-27 16:16:43 -05:00
intervals tidy: idr why this is named mathRand 2026-01-11 14:07:02 -05:00
patterns switch forge 2026-01-11 14:05:54 -05:00
shared switch forge 2026-01-11 14:05:54 -05:00
types godoc 2025-04-05 15:26:33 -04:00
.gitignore pixelsort_go -> pixorder 2025-04-05 15:35:01 -04:00
go.mod switch forge 2026-01-11 14:05:54 -05:00
go.sum urfave/cli/v3 2025-04-08 00:05:30 -04:00
LICENSE initial commit 2023-11-21 15:04:42 -05:00
pixelsort.go switch forge 2026-01-11 14:05:54 -05:00
README.MD i should tag this (0.10.0) 2025-06-06 12:33:25 -04:00

pixorder

masked row sort

pixelsorter cli written in golang

rewritten from my nodejs implementation, which used satyarth/pixelsort as reference

furst time using go, might be cursed

features

  • row, spiral, and seam carving patterns
  • shuffle pixels, sort in waves, random lengths, or smear instead
  • sort by lightness, hue, saturation, and r/g/b
  • sort with a mask
  • sort multiple images in parallel
  • sort in reverse
  • rotation

wanted features

install

from source

git clone https://github.com/0xf0xx0/pixorder.git
cd pixorder
go build
# now `mv pixorder`, or
go install

examples/usage

Original webb picture-of-the-month 2023/10 - src: ESA/Webb, NASA & CSA, A. Adamo (Stockholm University) and the FEAST JWST team

Mask b&w mask

Row sort w/ default options pixorder --input ~/Downloads/potm2310a.jpg --output ./examples/webb-row.jpg row sort

Row sort w/ threshold pixorder --input ~/Downloads/potm2310a.jpg --lower_threshold 0.3 --upper_threshold 0.6 --output ./examples/webb-row-thresh.jpg row sort w/ threshold

Row sort w/ default options & mask pixorder --input ~/Downloads/potm2310a.jpg --mask ./examples/webb-mask.jpg --output ./examples/webb-row-masked.jpg masked row sort

Spiral sort w/ default options pixorder --input ~/Downloads/potm2310a.jpg --pattern spiral --output ./examples/webb-spiral.jpg spiral sort

Spiral sort using most options & mask pixorder --input ~/Downloads/potm2310a.jpg --mask ./examples/webb-mask.jpg --pattern spiral --interval wave --randomness 0.4 --comparator saturation --section_length 400 --output ./examples/webb-spiral-masked.jpg masked spiral sort

Seam sort w/ default options pixorder --input ~/Downloads/potm2310a.jpg --pattern seam --output ./examples/webb-seam.jpg seam sort

Seam sort w/ default options & mask pixorder --input ~/Downloads/potm2310a.jpg --mask ./examples/webb-mask.jpg --pattern seam --output ./examples/webb-seam-masked.jpg masked seam sort

did you know webb and hubble pics are cc4?

"benchmark"

done with hyperfine, so it's super legit now right?
src img is the "large jpg" dl from esawebb.org
hyperfine -w 3 -c "rm -v ./benchmark" "pixorder -i ~/Downloads/potm2310a.jpg -o ./benchmark" "pixorder -i ~/Downloads/potm2310a.jpg -m ./examples/webb-mask.jpg -o ./benchmark" --export-markdown -

Command Mean [s] Min [s] Max [s] Relative
pixorder -i ~/Downloads/potm2310a.jpg -o ./benchmark 2.716 ± 0.013 2.690 2.734 1.31 ± 0.02
pixorder -i ~/Downloads/potm2310a.jpg -m ./examples/webb-mask.jpg -o ./benchmark 2.074 ± 0.032 2.032 2.126 1.00