https://github.com/vimichael/print-image
https://github.com/vimichael/print-image
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vimichael/print-image
- Owner: vimichael
- License: mit
- Created: 2024-04-07T00:09:56.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-07T05:16:38.000Z (almost 2 years ago)
- Last Synced: 2025-03-28T10:15:45.795Z (10 months ago)
- Language: Rust
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT.txt
Awesome Lists containing this project
README
# Print Image
A super simple solution to printing images in the terminal
# Features
- Printing images
- Resizing output
- Custom pixel handling
# Usage
```rust
use print_image;
use std::path::Path;
fn main() -> Result<(), print_image::PrintImageError> {
print_img(
Path::new("path/to/file.png"),
Some((12, 12)),
print_image::handle_pixel_rgb
)
}
```
# Custom Pixel Handler
```rust
use print_image;
use std::path::Path;
fn main() -> Result<(), print_image::PrintImageError> {
print_img(
Path::new("path/to/file.png"),
Some((12, 12)),
|pixel| {
match pixel[0] {
0..=128 => "+".to_string(),
129..=255 => "-".to_string()
}
}
)
}
```
# Dependencies
- [image](https://github.com/image-rs/image) - Licensed under MIT or Apache 2.0
- [colored](https://docs.rs/colored/latest/colored/) - Licensed under Mozilla Public License Version 2.0
99.99% of the legwork was done by the dependencies for this project. Print Image only provides an easy to use wrapper over them.
# License
Code is licensed under MIT. Click [here](LICENSE-MIT.txt) for more information.