Transform your photos with the power of AI - Edit, analyze, and reimagine your images using cutting-edge artificial intelligence.
Image Magic is a modern web application that harnesses Google's Gemini AI to provide four powerful image manipulation and analysis tools. Whether you want to edit photos with natural language prompts, get detailed image analysis, travel through time, or receive personalized style advice, Image Magic has you covered.
Transform your photos using natural language descriptions. Simply upload an image and describe what you want to change - add filters, modify backgrounds, change colors, or apply artistic effects.
Example prompts:
- "Add a retro filter"
- "Make it look like a watercolor painting"
- "Remove the person in the background"
- "Change the sky to a sunset"
Get detailed AI-powered analysis of your images. Upload any photo and ask specific questions about its content, composition, or elements.
Example questions:
- "What is happening in this image?"
- "Identify the main subject and describe the scene"
- "What emotions are conveyed in this photo?"
- "Analyze the composition and lighting"
Transport yourself or your photos to different historical eras. Choose from various time periods and watch as AI recreates your image with period-appropriate clothing, styling, and atmosphere.
Available eras:
- Ancient Rome
- Feudal Japan
- Victorian England
- Roaring Twenties
- 1950s Retro
- 1980s Cyberpunk
- Wild West
- Age of Piracy
- Time of Mahabharat
- Time of Ramayan
- Kingdom of Chandragupta Maurya
Get personalized style recommendations for your photos. Choose specific features to modify (hairstyle, clothing, facial hair, etc.) or make custom requests for style improvements.
Style categories:
- Hairstyle recommendations
- Shirt/clothing suggestions
- Beard and facial hair styles
- Jeans and pants options
- Custom style requests
Before running Image Magic, make sure you have the following installed:
- Node.js (version 18 or higher)
- npm or yarn package manager
- A Google AI API key for Gemini AI services
-
Clone the repository
git clone <repository-url> cd magic
-
Install dependencies
npm install
-
Set up environment variables
Create a
.envfile in the root directory and add your Google AI API key:VITE_GOOGLE_AI_API_KEY=your_gemini_api_key_here
To get a Google AI API key:
- Visit Google AI Studio
- Sign in with your Google account
- Create a new API key
- Copy the key to your
.envfile
-
Start the development server
npm run dev
-
Open your browser
Navigate to
http://localhost:5173to start using Image Magic!
To create a production build:
npm run buildTo preview the production build locally:
npm run preview- Frontend Framework: React 19 with TypeScript
- Styling: Tailwind CSS 4.1
- Build Tool: Vite 6.2
- AI Service: Google Gemini AI (@google/genai)
- Image Processing: Canvas API with base64 encoding
- Icons: Custom SVG icons
- Responsive Design: Mobile-first approach with CSS Grid and Flexbox
magic/
βββ components/ # React components
β βββ ImageAnalyzer.tsx # AI image analysis interface
β βββ ImageEditor.tsx # AI image editing interface
β βββ ImageUploader.tsx # File upload component
β βββ Spinner.tsx # Loading spinner component
β βββ StyleAdvisor.tsx # Style recommendation interface
β βββ TabButton.tsx # Navigation tab component
β βββ TimeTraveler.tsx # Historical era transformation
βββ services/ # External service integrations
β βββ geminiService.ts # Google Gemini AI API client
βββ App.tsx # Main application component
βββ constants.ts # Application constants
βββ types.ts # TypeScript type definitions
βββ index.tsx # Application entry point
βββ package.json # Project dependencies and scripts
- Image Quality: For best results, use high-quality images with good lighting
- Prompt Clarity: Be specific and descriptive in your editing prompts
- Processing Time: AI operations may take 10-30 seconds depending on complexity
- File Formats: Supports common image formats (JPEG, PNG, WebP, GIF)
- File Size: Larger images may take longer to process
The application uses Vite for development and building. Key configuration files:
vite.config.ts- Vite configurationtsconfig.json- TypeScript configurationtailwind.css- Tailwind CSS configurationpackage.json- Dependencies and scripts
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Common Issues:
- API Key Error: Ensure your Google AI API key is correctly set in the
.envfile - Build Errors: Try deleting
node_modulesand runningnpm installagain - Slow Processing: Large images or complex prompts may take longer to process
- CORS Issues: Make sure you're running the development server on the correct port
Need Help?
If you encounter any issues or have questions, please open an issue on the GitHub repository.
Made with β€οΈ using React, TypeScript, and Google Gemini AI