A high-performance web application for enhancing image contrast using adaptive algorithms with an emphasis on speed, usability, and mobile responsiveness.
- Upload and process images with intelligent compression
- Apply adaptive contrast enhancement with real-time feedback
- Fine-tune enhancement parameters with intuitive controls
- View before/after comparison in real-time
- Save and download enhanced images
- Track processing history with parameter reuse
- Intelligent image compression to reduce processing time
- Asynchronous processing with background tasks
- Real-time progress tracking with estimated completion time
- Smart caching system to avoid redundant processing
- Memory management to prevent leaks during processing
- Adaptive algorithm selection based on image characteristics
- Modern, intuitive interface with responsive design
- Mobile-friendly layout that works on all device sizes
- Real-time loading indicators with progress tracking
- Preset system for quick enhancement application
- Detailed history tracking with parameter reuse
- Performance insights for problematic images
- Modular Architecture: Well-structured codebase with separate modules for different functionalities
- Clone this repository:
git clone https://github.com/yourusername/imageprocessing.git
cd imageprocessing
- Install the required dependencies:
pip install -r requirements.txt
- Run the application in development mode:
python main.py
-
The web interface will automatically open in your default browser at
http://localhost:5000 -
Upload an image, adjust parameters, and apply the enhancement
-
Download the enhanced image
For production deployment, use the included production server (Waitress):
python production.py
This will start a production-ready WSGI server. You can specify host and port:
python production.py --host 0.0.0.0 --port 8080
imageprocessing/
├── filters/ # Filter implementations
│ ├── adaptive_enhancement.py # Core adaptive enhancement algorithm
│ ├── advanced_filters.py # Advanced filter implementations
│ └── basic_filters.py # Basic filter implementations
├── static/ # Static web assets
│ ├── css/ # CSS styles
│ ├── js/ # JavaScript files
│ ├── img/ # Static images
│ ├── uploads/ # User uploaded images
│ └── results/ # Enhanced images
├── templates/ # HTML templates
│ └── index.html # Main page template
├── utils/ # Utility functions
│ └── image_utils.py # Image processing utilities
├── app.py # Flask application
├── main.py # Main entry point
└── requirements.txt # Project dependencies
- Window Size: Size of the local window for calculating statistics (larger values = smoother results)
- Use Entropy: Whether to use local entropy for enhancement (helps preserve details in complex regions)
- Apply Noise Reduction: Enable/disable noise reduction
- Bilateral Strength: Strength of the bilateral filter (higher = more smoothing)
- Bilateral Diameter: Diameter of each pixel neighborhood for bilateral filter
- Denoise Blend Factor: How much of the denoised image to blend with the original
- Gamma Min: Minimum gamma value for adaptive gamma correction
- Gamma Max: Maximum gamma value for adaptive gamma correction
- Contrast Strength: Strength of local contrast enhancement
- Entropy Factor: How much local entropy influences enhancement
- Enhance Details: Enable/disable detail enhancement
- Unsharp Kernel Size: Size of the kernel for unsharp masking
- Unsharp Sigma: Standard deviation of the Gaussian kernel for unsharp masking
- Unsharp Amount: Strength of the sharpening effect
- Apply CLAHE: Enable/disable Contrast Limited Adaptive Histogram Equalization
- CLAHE Clip Limit: Threshold for contrast limiting in CLAHE
- CLAHE Blend: How much of the CLAHE result to blend with the enhanced image
- Apply High Boost: Enable/disable high-boost filtering
- High Boost Factor: Factor to boost high frequencies
- High Boost Blend: How much of the high-boost result to blend with the enhanced image
- Dark Image: Optimized for very dark images, increases brightness and contrast
- Bright Image: Optimized for very bright images, reduces highlights and improves details
- Sharp Edges: Enhances edges while preserving details
- Blurry Image: Increases sharpness and detail for blurry images
- High Detail: Optimized for images with strong visible detail
- Low Contrast: Enhances contrast in flat, low-contrast images
-
Local Statistics Calculation:
- Calculate local mean, standard deviation, and entropy for each pixel
- These statistics guide the adaptive enhancement process
-
Noise Reduction:
- Apply bilateral filtering with adaptive parameters
- Smooth flat regions more aggressively while preserving edges
-
Adaptive Enhancement:
- Apply adaptive gamma correction based on local brightness
- Enhance contrast based on local standard deviation
- Use entropy to further adjust enhancement in complex regions
-
Detail Enhancement:
- Apply unsharp masking with adaptive amount
- Enhance details more in high-contrast regions
-
Final Adjustments:
- Apply CLAHE for additional contrast enhancement
- Use high-boost filtering to enhance high-frequency details
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCV for image processing functions
- Flask for the web framework
- Scikit-image for additional image processing algorithms