Similar to Kim Asendorf's pixels sorting but in racket.
Use:
(glitch y-pred x-pred img)
Where:
y-pred
is a function which takes two pixels(color r g b a)
and compares them for sorting on columns.x-pred
is a function which takes two pixels(color r g b a)
and compares them for sorting on rows.img
is animage?
Examples:
(glitch (white? 140) (white? 140)
(bitmap/url "http://mysticmesseneger.webs.com/Rocky%20Mountains.jpg"))
(glitch (black? 110) (white? 100)
(bitmap/url "http://mysticmesseneger.webs.com/Rocky%20Mountains.jpg"))
(glitch (black? 60) (black? 60)
(bitmap/url "http://www.artrenewal.org/artwork/186/186/1971/mona_lisa-large.jpg"))