Skip to content

Latest commit

ย 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

MJW Estate Web Image Optimizer

A comprehensive, user-friendly solution for automated image processing with watermarking and web optimization. Built for Windows 11 with powerful hardware and Azure integration capabilities.

Optimized for Michael J Wright Estate artwork processing:

  • ๐Ÿ“ 1200px long edge - Perfect for web gallery display
  • ๐ŸŽจ sRGB color space - Consistent color across devices
  • ๐Ÿ“ฑ 72 DPI - Web standard resolution
  • ๐Ÿ“ฆ JPEG < 300KB - Fast loading, great quality
  • ยฉ Text watermark - "ยฉ Michael J Wright Estate - Property of"

๐Ÿš€ Features

Core Functionality

  • Multi-format Support: PDF, JPG, JPEG, PNG, BMP, TIFF files
  • Text Watermarking: Repeating diagonal text watermark with adjustable transparency
  • Image Watermarking: Transparent PNG watermarks with customizable opacity, position, and scaling
  • Web Optimization: Automatic resizing to 1200px long edge, sRGB conversion, 72 DPI
  • Smart Compression: Targets < 300KB file size with quality optimization
  • Batch Processing: Process entire folders with progress tracking
  • High Performance: Multi-processing support optimized for powerful hardware

User Interfaces

  • Modern GUI: Clean, intuitive interface built with CustomTkinter
  • Command Line: Powerful CLI for automation and scripting
  • HTTP API: RESTful API for Power Platform and cloud integration

Cloud Integration

  • Azure Blob Storage: Cloud-based image processing and storage
  • Azure Computer Vision: AI-powered image analysis and text detection
  • Power Platform: Ready-to-use Power Automate workflows and Power Apps integration

Enterprise Features

  • Configuration Management: YAML-based settings with presets
  • Comprehensive Logging: Detailed logs with rotation and retention
  • Error Handling: Robust error recovery and reporting
  • Performance Monitoring: Progress tracking and statistics

๐Ÿ“‹ Requirements

System Requirements

  • OS: Windows 11 Pro/Business (recommended)
  • Hardware: Multi-core processor, 8GB+ RAM
  • Python: 3.8 or higher

Python Dependencies

pip install -r requirements.txt

Key packages:

  • Pillow: Image processing
  • OpenCV: Advanced image operations
  • PyMuPDF: PDF handling
  • CustomTkinter: Modern GUI
  • Azure SDK: Cloud integration (optional)
  • Flask: HTTP API (optional)

๐ŸŽฏ Quick Start

1. Setup

# Clone or download the project
cd ImageProcessorPro

# Install dependencies
pip install -r requirements.txt

2. Choose Your Interface

GUI Application (Recommended for most users)

python gui_app.py

Simply select your folder with paintings/images and click "Start Processing". Output will be saved to a web_optimized subfolder.

Command Line (For automation)

# Quick web optimization (uses MJW Estate defaults)
python cli.py -i "paintings_folder"

# Custom watermark text
python cli.py -i "photos" --watermark-text "ยฉ My Custom Text"

# Advanced options
python cli.py -i "photos" --long-edge 1500 --quality 85 --text-opacity 30

HTTP API (For Power Platform integration)

# Start the API server
python power_platform/power_platform_integration.py

๐Ÿ”ง Configuration

Using Configuration Files

The system supports YAML configuration files for easy preset management:

# Use a specific config file
python cli.py --config config/web_optimization_config.yaml

# Generate a new config template
python cli.py --generate-config my_settings.yaml

Available Presets

  • default_config.yaml: Balanced quality and performance
  • high_quality_config.yaml: Maximum quality for important images
  • web_optimized_config.yaml: Fast processing for web use

Key Settings

# Image Quality
jpeg_quality: 85          # 1-100 (higher = better quality, larger files)
output_format: "JPEG"     # JPEG, PNG, WEBP

# Watermark
watermark_opacity: 0.3    # 0.1-1.0 (transparency level)
watermark_position: "bottom-right"  # Placement on image
watermark_scale: 0.2      # Size relative to image (0.05-0.5)

# Dimensions
max_width: 1920           # Maximum output width
max_height: 1080          # Maximum output height

๐ŸŒ Power Platform Integration

Power Automate Workflows

Pre-built templates for:

  • Email Processing: Process attachments from emails
  • SharePoint Integration: Automatic folder monitoring
  • OneDrive Batch: Scheduled bulk processing

Templates available in power_platform/templates/

Power Apps Integration

  • Custom connector setup
  • Mobile-friendly image capture
  • Batch processing interface
  • Integration formulas provided

API Endpoints

  • POST /api/process-image: Upload and process files
  • POST /api/process-base64: Process base64 images (Power Apps)
  • POST /api/process-batch: Batch processing
  • GET /api/health: Health check

โ˜๏ธ Azure Integration

Setup Azure Services

  1. Blob Storage: For cloud image storage
  2. Computer Vision: For AI analysis (optional)

Configuration

# Copy template and add your credentials
cp azure/azure_config_template.json azure/azure_config.json

Features

  • Cloud-based batch processing
  • Automatic image analysis and tagging
  • OCR text detection
  • Scalable storage solutions

๐Ÿ–ฅ๏ธ GUI Usage

Basic Workflow

  1. Launch: Run python gui_app.py
  2. Configure: Set input/output folders and watermark
  3. Adjust Settings: Quality, opacity, dimensions
  4. Scan: Check how many files will be processed
  5. Process: Start the batch operation
  6. Monitor: Watch progress and results

Advanced Features

  • Presets: Save and load common configurations
  • Preview: Scan folders before processing
  • Progress Tracking: Real-time processing updates
  • Error Reporting: Detailed failure information

๐Ÿ’ป Command Line Usage

Basic Examples

# Simple processing
python cli.py -i "C:\Photos" -o "C:\WebPhotos" -w "logo.png"

# Custom quality and format
python cli.py -i input -o output -w watermark.png --quality 90 --format WEBP

# Use configuration file
python cli.py --config config/high_quality_config.yaml

# Dry run (see what would be processed)
python cli.py -i input -o output --dry-run

Advanced Options

# Custom dimensions
python cli.py -i input -o output --max-width 2560 --max-height 1440

# Watermark customization
python cli.py -i input -o output --opacity 0.5 --position center --scale 0.3

# Performance tuning
python cli.py -i input -o output --max-workers 8 --no-multiprocessing

๐Ÿ” Troubleshooting

Common Issues

"No files found"

  • Check input folder path
  • Verify supported formats: PDF, JPG, PNG, BMP, TIFF
  • Ensure files aren't corrupted

"Watermark not applied"

  • Verify watermark file exists and is PNG format
  • Check watermark path in configuration
  • Ensure watermark has transparency

"Processing failed"

  • Check available disk space
  • Verify write permissions to output folder
  • Review logs in logs/ folder

Performance Issues

  • Reduce max_workers if system becomes unresponsive
  • Use SSD storage for better I/O performance
  • Increase available RAM

Log Files

Detailed logs are stored in logs/image_processor_{timestamp}.log

๐Ÿš€ Deployment Options

Local Development

  • Run directly with Python
  • Use virtual environments for isolation

Windows Service

Convert to a Windows service for background processing:

# Install service dependencies
pip install pywin32

# Create service wrapper (example in deployment/)

Docker Container

# See deployment/Dockerfile for complete setup
FROM python:3.11-slim
COPY requirements.txt .
RUN pip install -r requirements.txt

Azure Functions

Deploy API endpoints as serverless functions for scalable cloud processing.

๐Ÿ” Security Considerations

File Handling

  • Input validation for all file types
  • Size limits to prevent memory issues
  • Sandboxed processing environment

API Security

  • Authentication headers
  • Rate limiting
  • Input sanitization
  • HTTPS enforcement

Azure Integration

  • Managed identities for authentication
  • Private endpoints for storage
  • Key Vault for secret management

๐Ÿ“ˆ Performance Optimization

Hardware Optimization

  • CPU: Utilizes all available cores with multiprocessing
  • Memory: Efficient image handling with streaming
  • Storage: SSD recommended for faster I/O

Processing Tips

  • Use WEBP format for best compression
  • Batch similar-sized images together
  • Consider GPU acceleration for large volumes

Scaling

  • Azure cloud processing for unlimited scale
  • Load balancing for API endpoints
  • Distributed storage for large datasets

๐Ÿ› ๏ธ Development

Project Structure

ImageProcessorMJWProject/
โ”œโ”€โ”€ src/                    # Core processing logic
โ”œโ”€โ”€ gui_app.py             # GUI application
โ”œโ”€โ”€ cli.py                 # Command line interface
โ”œโ”€โ”€ config/                # Configuration presets
โ”œโ”€โ”€ azure/                 # Azure integration
โ”œโ”€โ”€ power_platform/        # Power Platform templates
โ”œโ”€โ”€ watermarks/           # Watermark images
โ”œโ”€โ”€ logs/                 # Application logs
โ””โ”€โ”€ requirements.txt      # Dependencies

Adding Features

  • Extend ImageProcessor class for new functionality
  • Add new configuration options to ProcessingConfig
  • Create custom GUI tabs for advanced features

Testing

# Run with test images
python cli.py -i test_images -o test_output --dry-run

# Check processing quality
python -c "from src.image_processor import ImageProcessor; ..."

๐ŸŽฎ Use Cases

Photography Studios

  • Batch watermarking for client galleries
  • Web optimization for online portfolios
  • Automated copyright protection

E-commerce

  • Product image standardization
  • Watermarking for brand protection
  • Multi-format output for different platforms

Marketing Agencies

  • Social media image preparation
  • Client asset management
  • Brand compliance automation

Enterprise Content

  • Document processing workflows
  • SharePoint integration
  • Automated archival systems

๐Ÿ“š API Reference

ProcessingConfig Class

config = ProcessingConfig(
    input_folder="input",
    output_folder="output", 
    watermark_path="logo.png",
    jpeg_quality=85,
    watermark_opacity=0.3,
    max_width=1920,
    max_height=1080,
    output_format="JPEG"
)

ImageProcessor Class

processor = ImageProcessor(config)
results = processor.process_folder()

HTTP API Endpoints

  • POST /api/process-image: Multipart file upload
  • POST /api/process-base64: JSON with base64 image
  • GET /api/config: Get current configuration
  • POST /api/config: Update configuration

๐Ÿค Contributing

Development Setup

  1. Fork the repository
  2. Create feature branch
  3. Install development dependencies
  4. Run tests before submitting

Code Style

  • Follow PEP 8 conventions
  • Add type hints for all functions
  • Include comprehensive docstrings
  • Write unit tests for new features

๐Ÿ“„ License

This project is provided as-is for educational and commercial use. Please ensure you have proper rights to any watermark images used.

๐Ÿ“ž Support

Documentation

  • Check this README for common solutions
  • Review configuration examples
  • Examine log files for error details

Community

  • Report issues with detailed error information
  • Include system specifications and log excerpts
  • Provide sample images (without sensitive content)

Built with โค๏ธ for automated image processing workflows

About

Automated image processing with watermarking and web optimization - GUI, CLI, API, Azure integration

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages