https://github.com/kuy/asdf-pixel-sort
Rust implementation of pixel sorting algorithm "ASDF" by Kim Asendorf
https://github.com/kuy/asdf-pixel-sort
asdf pixel-sorting rust
Last synced: 5 months ago
JSON representation
Rust implementation of pixel sorting algorithm "ASDF" by Kim Asendorf
- Host: GitHub
- URL: https://github.com/kuy/asdf-pixel-sort
- Owner: kuy
- License: mit
- Created: 2021-09-04T08:05:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-05-05T10:40:01.000Z (almost 2 years ago)
- Last Synced: 2025-06-02T00:25:08.610Z (9 months ago)
- Topics: asdf, pixel-sorting, rust
- Language: Rust
- Homepage:
- Size: 7.21 MB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# asdf-pixel-sort
[](https://crates.io/crates/asdf-pixel-sort)
[](https://docs.rs/asdf-pixel-sort)
[](https://github.com/kuy/asdf-pixel-sort/actions/workflows/ci.yml)
Rust implementation of pixel sorting algorithm "ASDF" by [Kim Asendorf](http://kimasendorf.com/).

## Usage
```toml
asdf-pixel-sort = "0.2.0"
```
## Example
```rust
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`](https://crates.io/crates/image) crate to run above code.
Use `sort_with_options()` function to configure with options.
```rust
let color = PColor::new(0, 62, 214);
let options = Options {
mode: Mode::Black(color),
};
sort_with_options(&mut buf, &options);
```
## Documentation
See [documentation](https://docs.rs/asdf-pixel-sort) on docs.rs.
## Changelogs
See [releases](https://github.com/kuy/asdf-pixel-sort/releases) page on GitHub.
## License
MIT
## Author
Yuki Kodama / [@kuy](https://twitter.com/kuy)