This content originally appeared on DEV Community and was authored by Abdellah Hallou
Or: “The time I convinced an AI to make my vacation photos look like I actually know how to use a camera”
Hey there, fellow code warriors and photography disasters!
Remember the last time you took a “perfect” photo, only to check it later and wonder why your smile looked awkward and your pose was just… off? Yeah, me too. That’s exactly why I built PhotoPro.
The Problem:
Here’s the thing: I’m not a professional photographer. And photo editing? Even worse. Because to “properly” edit photos you apparently need to know:
- What filters and sliders actually do
- When to use brightness vs. exposure vs. gamma (yes, that’s a thing)
- Color theory (whatever that is)
Guess what? I know none of that. And to make things worse, I’m lazy and I don’t want to spend 45 minutes sliding things left and right like I’m on Tinder.
Traditional photo editing software isn’t trivial. Plus, who has time to learn 47 different metrics and filters when you could be doing literally anything else?
So I asked myself:
What if I just told an AI what I want, and let it figure out the math?
Solution: Let AI Do the Heavy Lifting
Instead of learning how to edit, I built an app that lets you upload a photo and describe what you want in plain English (or, y’know, chaotic keyboard smashes), and Google Gemini AI handles the rest.
- Want it cinematic? Just say so.
- Want it to look like Wes Anderson shot it? Easy.
- “Fix my face. Please. I beg you.” ? Done.
But — and this is important — I didn’t want to alienate actual photo editors. So PhotoPro also supports good ol’ fashioned filters, grouped in categories for the pros who still like their sliders.
Why Gemini?
Now, here’s the deal:
- When we say prompts, we say LLMs.
- When we say open source project, we say open source VLMs.
BUT… running open source image models locally requires GPUs that cost more than my monthly rent. So, as a poor engineer working nights and weekends, I took the practical route: use the free Google Gemini Flash API and build the app around it.
No infra headaches, no cloud bills, just free AI sauce on my images.
The Three Enhancement Modes
1. Prompt-only (The Lazy Mode)
Upload your tragic photo → write something like:
“Make this look like it was shot on film in the 80s with moody vibes”
…and boom. Enhanced.
(But you’ll need some prompt-engineering magic — yes, being vague like “make me hotter” doesn’t always work ).
2. Filter-only
Here’s where I let the pros flex their muscles.
I created categories of filters like:
self.basic_filters = ['brightness', 'contrast', 'saturation', 'exposure', 'sharpness']
self.color_filters = ['temperature_tint', 'hsl', 'split_toning', 'curves']
self.artistic_filters = ['vintage', 'cinematic', 'black_white', 'mood_based', 'instagram_presets']
self.effects_filters = ['vignette', 'grain_noise', 'blur', 'light_leaks_flares', 'glitch_pixelate_sketch']
self.ai_filters = ['auto_enhance', 'sky_replacement', 'background_removal_blur', 'face_retouch', 'object_removal', 'style_transfer']
self.editing_filters = ['crop_rotate', 'flip_mirror']
self.overlay_filters = ['add_text', 'stickers_emojis', 'brush_draw', 'frames_borders']
self.filter_categories = {
"📊 Basic Adjustments": self.basic_filters,
"🎨 Color & Tone": self.color_filters,
"🎭 Artistic Styles": self.artistic_filters,
"✨ Visual Effects": self.effects_filters,
"🤖 AI-Powered": self.ai_filters,
"📐 Transform & Edit": self.editing_filters,
"📝 Overlays & Text": self.overlay_filters
}
Full honesty here: I didn’t invent these categories myself.
I literally asked ChatGPT to generate them for me, because — as I said — I suck at photo editing.
If I had to come up with this list, I’d have stopped at “brightness” and “make me look cool.”
The app flow is:
- Choose filters from categories (checkboxes).
- Configure them with sliders/inputs.
- Get a structured prompt + apply.
3. Prompt + Filters
The best of both worlds.
- A text prompt (“Make me look like a cyberpunk protagonist”).
- Manual filters (“cinematic”)
PhotoPro eats the combo prompt + filters, and outputs something magical.
Under the Hood
- Frontend: Streamlit (fast prototyping, zero effort UI)
- Backend: Google Gemini Flash API (free tier = lifesaver)
- Image Processing: PIL + NumPy (still useful for prep & save)
- Logic: Python
Try It Yourself!
Want to see the magic?
For Users
- Live Demo (requires a Gemini API key: https://aistudio.google.com/app/apikey)
For Developers
Clone the Repo
git clone https://github.com/ABDELLAH-Hallou/gemini-photo-filters
cd gemini-photo-filters
Set Up Your Environment
# Create a virtual environment (because dependency hell is real)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install the magic
pip install -r requirements.txt
Get Your API Key
- Go to Google AI Studio
- Create an API key (it’s free-ish)
- Add it to
.streamlit/secrets.toml
:
GEMINI_API_KEY = "your-actual-api-key-here"
Run the Thing
streamlit run app.py
Then navigate to localhost:8501
and start making your photos less tragic!
You can always customize filters in utils/filters.py
What’s Next? (The Roadmap of Dreams)
Here’s what I’m planning to add when I’m not busy procrastinating:
- Style Transfer: Train the AI on your preferred aesthetic.
- Social Media Integration: Auto-post your enhanced photos (with your permission, obviously).
- Mobile App: Because who enhances photos on desktop anymore?
- Collaborative Features: Share your enhancement settings with friends.
- AI Roast Mode: Let the AI critique your photos (for the masochists).
Final Thoughts
Building PhotoPro taught me that sometimes the best solutions come from solving your own problems. I needed better photos, AI existed, and Python made it possible to connect the two.
This content originally appeared on DEV Community and was authored by Abdellah Hallou