Crates.io | asdf-pixel-sort |
lib.rs | asdf-pixel-sort |
version | 0.2.0 |
source | src |
created_at | 2021-09-04 08:14:18.567559 |
updated_at | 2021-09-10 15:13:30.902753 |
description | ASDF pixel sorting |
homepage | https://crates.io/crates/asdf-pixel-sort |
repository | https://github.com/kuy/asdf-pixel-sort |
max_upload_size | |
id | 446748 |
size | 35,067 |
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