A simple desktop application that analyzes photos using AI and generates detailed descriptions. Built with Python and Tkinter.
- Easy Photo Import: Import photos from your computer with a simple file dialog
- AI-Powered Analysis: Uses OpenAI's GPT-4 Vision API for detailed image analysis
- Fallback Analysis: Basic image analysis when API key is not available
- User-Friendly GUI: Clean and intuitive interface built with Tkinter
- Multiple Image Formats: Supports JPG, PNG, BMP, GIF, TIFF, and more

The application provides:
- Image preview with automatic resizing
- Detailed AI-generated descriptions
- Status updates and error handling
- Clear and analyze buttons for easy workflow
- Python 3.7 or higher
- OpenAI API key (optional, for full AI analysis)
-
Clone or download the project files
# If you have git git clone <your-repo-url> cd ai-photo-analyzer
-
Install dependencies
pip install -r requirements.txt
-
Set up API key (Optional)
- Copy
.env.example
to.env
- Add your OpenAI API key to the
.env
file:OPENAI_API_KEY=your_openai_api_key_here
- Copy
python simple_photo_analyzer.py
- Launch the application by running the Python script
- Import a photo by clicking the "Import Photo" button
- Select an image file from your computer
- Click "Analyze Photo" to generate a detailed description
- View the results in the analysis results area
If you don't have an OpenAI API key, the application will still work but provide basic image information instead of detailed AI analysis:
- Image dimensions
- Color mode
- File format
- File size
With a valid OpenAI API key, you'll get:
- Detailed object recognition
- Scene description
- Color and mood analysis
- Context and setting information
- Comprehensive image understanding
ai-photo-analyzer/
├── simple_photo_analyzer.py # Main GUI application (all-in-one)
├── requirements.txt # Python dependencies
├── .env # Environment variables (your API key)
└── README.md # This file
- tkinter: GUI framework (included with Python)
- Pillow: Image processing and display
- requests: HTTP requests for API calls
- python-dotenv: Environment variable management
The application uses OpenAI's GPT-4 Vision API for image analysis. You'll need:
- An OpenAI account
- API access to GPT-4 Vision
- Credits in your OpenAI account
- Visit OpenAI's website
- Create an account or sign in
- Go to the API section
- Generate a new API key
- Add it to your
.env
file
-
"API key not found" error
- Make sure you've created a
.env
file - Verify your API key is correct
- Check that the
.env
file is in the same directory as the script
- Make sure you've created a
-
Image won't load
- Check that the image file exists
- Verify the image format is supported
- Try with a different image file
-
Analysis fails
- Check your internet connection (for API analysis)
- Verify your OpenAI API key is valid
- Check your OpenAI account has sufficient credits
- File not found: The selected image file doesn't exist
- Failed to load image: The image file is corrupted or in an unsupported format
- API Error: There's an issue with the OpenAI API (check your key and credits)
You can modify config.py
to add more image formats:
SUPPORTED_FORMATS = ['.jpg', '.jpeg', '.png', '.bmp', '.gif', '.tiff', '.webp']
You can customize the AI analysis prompt in ai_analyzer.py
:
"text": "Your custom analysis prompt here..."
Adjust the application window size in config.py
:
APP_SIZE = "1000x700" # Width x Height
This project is open source and available under the MIT License.
Feel free to contribute to this project by:
- Reporting bugs
- Suggesting new features
- Submitting pull requests
- Improving documentation
If you encounter any issues or have questions, please:
- Check the troubleshooting section
- Review the error messages
- Create an issue in the project repository