A powerful desktop image processing application built with PyQt5 and OpenCV that provides a range of photo editing tools in a user-friendly interface.
- Grayscale Conversion: Convert images to grayscale using different methods (Luminance, Lightness, Average)
- Brightness & Contrast: Fine-tune image brightness and contrast with real-time preview
- Color Inversion: Invert all image colors
- Binarization: Convert images to binary (black and white) with adjustable threshold
- Sharpness: Enhance image details with adjustable strength
- Mean Filter (Box Blur): Apply simple box blur with variable kernel size
- Gaussian Blur: Apply weighted blur with adjustable kernel size and sigma
- Median Filter: Remove noise while preserving edges
- Edge Detection: Multiple algorithms for edge detection:
- Roberts Cross
- Prewitt (8 directional options)
- Prewitt (All Directions)
- Prewitt (Gradient Magnitude)
- Sobel (8 angular directions: 0°, 45°, 90°, 135°, 180°, 225°, 270°, 315°)
- Sobel (Gradient Magnitude)
- Custom Kernel: Apply your own convolution kernels with predefined templates
- Histogram: View image histograms (RGB or grayscale)
- Projections: Analyze horizontal and vertical image projections
- Side-by-side Comparison: Compare edited image with original
- Undo/Reverse: Go back to previous editing steps
- Zoom Controls: Zoom in/out and center the image
- Touch & Gesture Support: Pinch to zoom, pan with touch or mouse
- Dark Theme: Easy on the eyes for extended editing sessions
- Python 3.6 or higher
- pip (Python package installer)
- Clone the repository:
git clone https://github.com/yourusername/photo-editor.git
cd photo-editor- Create a virtual environment (recommended):
python -m venv venv
# Activate on Windows
venv\Scripts\activate
# Activate on macOS/Linux
source venv/bin/activate- Install dependencies:
pip install -r requirements.txtpython photo_editor1.py- Open an Image: File → Open or use the toolbar button
- Apply Adjustments: Use the tabs on the right panel to adjust your image
- Save Results: File → Save or Save As
- Undo Mistakes: Use the Reverse button if you need to go back
- Ctrl+O: Open Image
- Ctrl+S: Save Image
- Ctrl+Shift+S: Save As
- Ctrl+Z: Reverse Last Change
- Ctrl+R: Reset to Original
- Ctrl+=: Zoom In
- Ctrl+-: Zoom Out
- Ctrl+0: Center/Reset Zoom
- Ctrl+D: Toggle Side-by-side Comparison
- Ctrl+Q: Exit Application
- Ctrl+Mouse Wheel: Zoom in/out
- Middle-click drag or Ctrl+Left-click drag: Pan image
- Touchpad pinch: Zoom in/out (on supported systems)
- photo_editor1.py: Main application file with UI and functionality
- functions.py: Core image processing functions
- requirements.txt: Project dependencies
- PyQt5: GUI framework
- OpenCV (cv2): Core image processing library
- NumPy: Array manipulation for image data
- Matplotlib: For histogram and projection visualization
The application leverages several key image processing techniques:
- Convolution Operations: Used for filters, edge detection, and custom kernels
- Morphological Operations: For advanced image manipulation
- Color Space Transformations: For grayscale conversion and other adjustments
- PhotoEditor: Main application window with all UI components
- CustomScrollArea: Enhanced scroll area with zoom and pan capabilities
- CustomImageLabel: Image display with touch gesture support
To add a new filter:
- Add the filter algorithm to
functions.py - Create UI controls in the
create_filters_tab()method - Add an application method in the
PhotoEditorclass
Custom kernels can be defined in the application or added to the predefined list in the apply_predefined_kernel() method.
- Michał Pytel @Michael-Pytel
- Jakub Półtorak @JakubPoltorak147
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
