Rust implementation of pixel sorting algorithm "ASDF" by Kim Asendorf.
asdf-pixel-sort = "0.2.0"
use asdf_pixel_sort::sort;
fn main() {
let img = image::open("pic.jpg").unwrap();
let mut buf = img.to_rgb8();
sort(&mut buf);
buf.save("sorted.jpg").unwrap();
}
You may also need image
crate to run above code.
Use sort_with_options()
function to configure with options.
let color = PColor::new(0, 62, 214);
let options = Options {
mode: Mode::Black(color),
};
sort_with_options(&mut buf, &options);
See documentation on docs.rs.
See releases page on GitHub.
MIT
Yuki Kodama / @kuy