A sleek, modern photo editing application built using Python, CustomTkinter, and Pillow (PIL). This tool allows users to enhance and filter images with real-time adjustments including brightness, color, sharpness, blur, and various advanced filters like edge detection, emboss, and more.
- Open & Edit Images: Load any image from your system.
- Enhancement Tools:
- Brightness adjustment
- Color saturation
- Sharpness control
- Filter Effects:
- Blur, Smooth, Smooth More
- Sharpen, Contour, Detail, Edge Enhance, Edge Enhance More
- Find Edges, Emboss
- Advanced Filters:
- Min, Median, Max, Mode Filters
- Box Blur, Gaussian Blur, Unsharp Mask
- Real-Time Preview: See changes instantly applied to your image.
- Modern UI: Built with
customtkinterfor a clean, responsive interface.
- Python 3.7 or higher
- Basic knowledge of running Python scripts.
-
Clone the repository:
git clone https://github.com/Poyamohamadi/photo_editor.git cd photo_editor -
Install required dependencies:
pip install customtkinter pillow
-
Ensure you have a starting image named
picture.jpgin the project directory (or use the "Open Picture" button to load any image). -
Run the application:
python main.py
-
Launch the app:
python main.py
-
Click "Open Picture" to load an image from your device.
-
Choose editing mode:
- Enhance: Adjust brightness, color, and sharpness using sliders.
- Filter: Apply visual effects via toggle switches and sliders.
-
Toggle filters on/off:
- Simple filters (e.g., Blur, Sharpen) activate instantly.
- Advanced filters (e.g., Median, Gaussian Blur) show a slider when enabled.
-
View results in real time — no manual "Apply" button needed!
-
Close the app when done.
Note: Edited images are temporarily saved as
new_picture.pngduring runtime.
The project is contained in a single script (main.py) with a class-based structure for modularity and readability.
Main class inheriting from customtkinter.CTk. Manages the entire UI and image processing logic.
__init__(): Initializes variables, window settings, and starts the app loop.run(): Sets up the main UI layout — button and image display frame.open_image(): Opens a file dialog to load an image.show_edit(value): Displays the editing panel with mode selector.set_edit(value): Switches between "Enhance" and "Filter" modes.enhance(): Adds sliders for brightness, color, and sharpness.filter(): Builds a scrollable panel with toggleable filters and dynamic sliders.edit_img(): Applies all selected enhancements and filters in sequence and updates the preview.
DoubleVar,IntVar,BooleanVar: Track slider values and toggle states.picture: Original image loaded from file.new_picture: Working copy used for edits.
Uses Pillow modules:
ImageEnhance.Brightness,Color,SharpnessImageFilter.BLUR,SHARPEN,EMBOSS,FIND_EDGES, etc.
This project uses the following libraries:
| Library | Purpose |
|---|---|
customtkinter |
Modern GUI framework with dark/light themes |
Pillow (PIL) |
Image loading, manipulation, and filtering |
tkinter |
File dialog integration (via filedialog) |
Install them using:
pip install customtkinter pillow
We welcome contributions! To help improve this project:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/new-filter - Commit your changes:
git commit -m "Add brightness reset button" - Push to the branch:
git push origin feature/new-filter - Open a pull request.
Please ensure your code matches the existing style and includes comments where necessary.
This project is licensed under the MIT License.
See LICENSE for more details.
- Thanks to the CustomTkinter team for a beautiful and easy-to-use GUI library.
- Pillow developers for powerful image processing in Python.
- The Python community for continuous innovation and support.
Have questions or suggestions? Reach out:
- GitHub: @Poyamohamadi
Thank you for using Photo Editor! Let your creativity shine, one filter at a time.
