Skip to content

🖼️ High-performance Rust CLI for image editing and fractal generation — supports blur, crop, grayscale, rotate, and more

License

Notifications You must be signed in to change notification settings

JohnBasrai/mirage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mirage 🌟

A fast and simple command-line image processing tool written in Rust. Mirage provides essential image manipulation operations with an intuitive interface.

Features

Feature Description
Blur Apply gaussian blur with configurable intensity (0-100%)
Brighten Adjust image brightness with positive or negative values
Crop Extract rectangular regions from images
Rotate Rotate images by 90°, 180°, or 270°
Invert Create negative images by inverting colors
Grayscale Convert color images to grayscale
Fractal Generate beautiful fractal images
Generate Create solid color images (coming soon)

Installation

From Source

git clone https://github.com/yourusername/mirage.git
cd mirage
cargo build --release

The binary will be available at target/release/mirage.

Prerequisites

  • Rust 1.70+ (2021 edition)
  • Cargo package manager

Usage

mirage <COMMAND> [OPTIONS]

Examples

# Blur the image
cargo run -- blur Test_Image.PNG blurred.png 10

# Convert to grayscale  
cargo run -- grayscale Test_Image.PNG gray.png

# Generate a fractal
cargo run -- fractal my_fractal.png 400 400

Available Commands

Command Description Arguments
blur Apply gaussian blur <infile> <outfile> <percent>
brighten Adjust brightness <infile> <outfile> <amount>
crop Extract image region <infile> <outfile> <x> <y> <width> <height>
rotate Rotate image <infile> <outfile> <degrees>
invert Invert colors <infile> <outfile>
grayscale Convert to grayscale <infile> <outfile>
fractal Generate fractal <outfile> <width> <height>
generate Create solid color image <outfile> <value> (coming soon)

Help

# General help
mirage --help

# Command-specific help
mirage blur --help

Supported Image Formats

Mirage supports common image formats including:

  • JPEG/JPG
  • PNG
  • BMP
  • TIFF
  • WebP
  • And more via the image crate

Development

Tips

  • Generated images can be viewed in any web browser or image viewer
  • Use different file extensions (.png, .jpg, .bmp) as needed for output
  • The tool automatically detects input format and can convert between formats

Building

cargo build

Running Tests

cargo test

Running in Development

cargo run -- <command> [args]

Example:

cargo run -- blur test.jpg blurred.jpg 25

Dependencies

  • image - Image processing library
  • clap - Command line argument parsing
  • anyhow - Error handling
  • num-complex - Complex number support for fractals

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

TODO

  • Implement the generate command
  • Add more image filters (sharpen, contrast, etc.)
  • Support for batch processing
  • Add configuration file support
  • Implement additional fractal types

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

🖼️ High-performance Rust CLI for image editing and fractal generation — supports blur, crop, grayscale, rotate, and more

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages