A blazing-fast CLI tool to calculate the percentage of black pixels in images.
- 🚀 Lightning Fast: Uses Rayon for parallel processing
- 📁 Batch Processing: Process entire directories at once
- 🎨 Beautiful Output: Color-coded results with filename highlighting
- 🔍 Smart Detection: Automatically detects image files
- 💪 Robust: Handles various image formats (PNG, JPG, JPEG, GIF, BMP, TIFF, WEBP)
# Clone the repository
git clone https://github.com/luhann/black.git
cd black
# Build and install
cargo install --path .black image.jpgOutput:
image.jpg: 23.45%
black --directory /path/to/images/Output:
photo1.jpg: 12.34%
nature.png: 45.67%
artwork.jpeg: 78.90%
black [OPTIONS] <PATH>
Arguments:
<PATH> File path of the image or directory
Options:
-d, --directory Process a whole directory
-h, --help Print help
-V, --version Print version information# Analyze a single image
black sunset.jpg
# Output: sunset.jpg: 15.42%
# Process all images in a directory
black --directory ./photos
# Output:
# beach.jpg: 8.23%
# mountain.png: 34.56%
# city.jpeg: 67.89%
# Process current directory
black --directory .Black analyzes each pixel in an image and determines what percentage are "black" pixels. The tool:
- 🔍 Loads the image using efficient image processing libraries
- ⚡ Processes pixels in parallel for maximum speed
- 🧮 Calculates the percentage of black pixels
- 🎨 Displays results with beautiful formatting
Black is optimized for speed:
- ⚡ Parallel pixel processing for single images
- 🔄 Concurrent processing of multiple files in directories
- 🎯 Efficient memory usage
- 📈 Scales with available CPU cores
Contributions are welcome! Here's how you can help:
- 🍴 Fork the repository
- 🌿 Create a feature branch
- ✨ Make your changes
- 🧪 Add tests if applicable
- 📝 Update documentation
- 🚀 Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with ❤️ using Rust
- Powered by the amazing Rust ecosystem
- Thanks to the Rayon team for excellent parallel processing
Made with 🖤 by luhann