Skip to content
hiroki-abe-58Public

About

AI-powered image processing CLI tool - Resize, optimize, and analyze images with AI capabilities

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

43 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 imgai

AI-powered image processing CLI tool for modern workflows.

License: MIT Go Version

English | ζ—₯本θͺž

A fast, efficient, and user-friendly command-line tool for image processing, built with Go and optimized for Apple Silicon.

✨ Features

πŸ–ΌοΈ Image Processing

  • Resize - Maintain aspect ratio or specify exact dimensions
  • Convert - Transform between JPEG, PNG, and WebP formats
  • Quality Control - Adjust compression for optimal file size

πŸ“Š Batch Operations

  • Parallel Processing - Leverage goroutines for maximum performance
  • Progress Bar - Visual feedback for batch operations
  • Glob Patterns - Process multiple files with *.jpg patterns

πŸ”’ Privacy & Metadata

  • EXIF Reading - View camera settings, GPS, and metadata
  • EXIF Removal - Strip all metadata for privacy protection

πŸ›‘οΈ Safety Features

  • Dry-Run Mode - Preview operations before execution
  • Error Handling - Detailed error messages and recovery
  • Automatic Naming - Smart output filename generation

πŸš€ Installation

Prerequisites

  • Go 1.21 or higher
  • macOS (Apple Silicon optimized) / Linux / Windows

From Source

git clone https://github.com/hiroki-abe-58/imgai.git
cd imgai
go build -o imgai

Quick Start

# Make it executable and move to PATH
chmod +x imgai
sudo mv imgai /usr/local/bin/

# Verify installation
imgai --version

🌐 Language Settings

# Use in Japanese
export IMGAI_LANG=ja
imgai resize photo.jpg --width 800

# Use in English (default)
export IMGAI_LANG=en
imgai resize photo.jpg --width 800

πŸ“– Usage

Resize Images

# Resize to 800px width (maintain aspect ratio)
imgai resize photo.jpg --width 800

# Resize to 600px height
imgai resize photo.jpg --height 600

# Resize to exact dimensions
imgai resize photo.jpg --width 1920 --height 1080

# Batch resize with progress bar
imgai resize *.jpg --width 800

# Preview before resizing
imgai resize *.jpg --width 800 --dry-run

# Use 8 parallel workers for faster processing
imgai resize *.jpg --width 800 --workers 8

Convert Formats

# Convert to PNG
imgai convert photo.jpg --format png

# Convert to JPEG with custom quality
imgai convert image.png --format jpg --quality 85

# Convert to WebP (modern format)
imgai convert photo.jpg --format webp

# Batch convert all PNGs to JPEGs
imgai convert *.png --format jpg --quality 90

# Preview before converting
imgai convert *.png --format jpg --dry-run

Manage Metadata

# View EXIF data
imgai exif photo.jpg

# Remove all metadata (privacy mode)
imgai strip photo.jpg

# Strip metadata and save to new file
imgai strip photo.jpg --output clean.jpg

# Batch strip metadata
imgai strip *.jpg --workers 8

# Preview metadata removal
imgai strip *.jpg --dry-run

πŸ—οΈ Architecture

imgai/
β”œβ”€β”€ cmd/              # CLI commands
β”‚   β”œβ”€β”€ root.go       # Root command with Cobra
β”‚   β”œβ”€β”€ resize.go     # Resize command
β”‚   β”œβ”€β”€ convert.go    # Format conversion
β”‚   β”œβ”€β”€ exif.go       # EXIF reading
β”‚   └── strip.go      # EXIF removal
β”œβ”€β”€ pkg/              # Core packages
β”‚   β”œβ”€β”€ image/        # Image processing logic
β”‚   β”œβ”€β”€ batch/        # Batch processing with goroutines
β”‚   β”œβ”€β”€ metadata/     # EXIF handling
β”‚   └── i18n/         # Internationalization
└── main.go           # Entry point

🎯 Key Design Principles

  • DRY - Don't Repeat Yourself
  • SOLID - Object-oriented design principles
  • Separation of Concerns - Clear module boundaries
  • Error Handling - Comprehensive error messages
  • Cross-Platform - Works on macOS, Linux, and Windows

πŸ”§ Development

Building

go build -o imgai

Testing

go test ./...

Adding New Features

# Create feature branch
git checkout -b feature/new-feature

# Make changes and commit
git add .
git commit -m "feat: add new feature"

# Push and create PR
git push origin feature/new-feature

πŸ“Š Performance

  • Parallel Processing - Up to 8x faster with multiple workers
  • Memory Efficient - Streaming image processing
  • Apple Silicon Optimized - Native ARM64 support
  • Goroutines - Concurrent processing for batch operations

πŸ—ΊοΈ Roadmap

  • Project initialization
  • CLI framework (Cobra)
  • Image resize functionality
  • Format conversion (JPEG/PNG/WebP)
  • Batch processing with goroutines
  • EXIF metadata reading
  • Progress bar for batch operations
  • Dry-run mode
  • EXIF metadata removal
  • Japanese language support (i18n)
  • AI-powered features (future)
  • Cross-platform binaries (releases)

πŸ“ License

MIT License - see LICENSE for details

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ‘€ Author

Hiroki Abe

πŸ™ Acknowledgments

Built with:


⭐ If you find this project useful, please consider giving it a star!

About

AI-powered image processing CLI tool - Resize, optimize, and analyze images with AI capabilities

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages