Transform your images with this simple yet powerful Python image processing toolkit!
Turn your ordinary images into extraordinary ones with these magical transformations:
-
🌟 Brightness Control
- Brighten up those dark corners
- Tone down overexposed areas
-
🔄 Image Negatives
- Instant photo negatives
- Perfect for film-like effects
-
📊 Advanced Transformations
- Power Law (Gamma) Transform: Fine-tune image contrast
- Logarithmic Transform: Enhance details in dark regions
-
🎯 Filters
- Average Filter: Smooth out noise
- Median Filter: Remove pesky outliers
- Max Filter: Enhance bright details
- Min Filter: Enhance dark details
- Python 3.x
- OpenCV (cv2)
- NumPy
- Clone this repository:
git clone https://github.com/AhmedReda85/ImageOps.git
cd ImageOps- Install required packages:
pip install opencv-python
pip install numpy- Place your image file (named "image.jpg") in the project directory (feel free to change the names but don't forget to edit the code)
- Run the script:
python main.py- Choose from the menu options (0-9):
Image Processing Menu:
1. Brighten Image
2. Darken Image
3. Negative
4. Power Law
5. Log Transformation
6. Average Filter
7. Median Filter
8. Max Filter
9. Min Filter
0. Exit
- Values > 1: Increases brightness
- Values < 1: Decreases brightness
- Try values between 0.5 and 2 for nice changes
- γ < 1: Brightens darker regions
- γ > 1: Enhances contrast in bright regions
- Recommended range: 0.3 to 3.0
- Great for enhancing detail in dark areas
- Try scaling factors between 1 and 30
- Higher values = stronger enhancement
- Average Filter: Best for general noise reduction
- Median Filter: Perfect for removing salt-and-pepper noise
- Max Filter: Highlights bright details
- Min Filter: Highlights dark details
# Load and process an image
img = cv2.imread("your_image.jpg", 0) # Load in grayscale
img = cv2.resize(img, (500, 500)) # Resize to 500x500
img = img / 255 # Normalize pixel values
# Apply transformations
brightened = more_bright() # Enter value when prompted
filtered = median_filter() # No input needed
negative = negative() # Instant negative| Brightened Image | Darkened Image |
|---|---|
![]() |
![]() |
| Filter Type | Result |
|---|---|
| Average Filter | ![]() |
| Median Filter | ![]() |
| Max Filter | ![]() |
| Min Filter | ![]() |









