A responsive, AI-powered photo editing application built with Fullstack JavaScript. Supports both client-side image processing for speed and Gemini AI integration for advanced AI features.
- React 18 + TypeScript
- Tailwind CSS with shadcn/ui components
- Wouter for routing
- TanStack Query v5 for data fetching
- Canvas API for image processing
- localStorage for settings persistence
- Express.js
- Node.js
- Zod for validation
- Gemini AI integration (multimodal gemini-1.5-flash)
- Local model support infrastructure (REMBG, GFPGAN, etc.)
- PhotoEditor (main page) - Orchestrates all editor functionality
- ImageCanvas - High-performance image rendering and interaction
- ToolsSidebar - Tool selection and quick actions
- ToolSettings - Parameter adjustment with sliders
- ChatPanel - AI assistant interface with vision capabilities
- SettingsDialog - Model configuration
- ExportDialog - Multi-format export options
- User uploads image → Stored in state + history
- Selects tool → Opens ToolSettings panel
- Adjusts parameters → Real-time preview via Canvas API
- Applies effect → Processed client-side, added to history
- AI Features → Request sent to backend with image data and prompt
- Exports → Downloads file in selected format
- 7 client-side image processing tools (sharpen, denoise, contrast, exposure, color correction, red eye removal, enhance)
- Full undo/redo history system
- Before/after comparison view
- Settings dialog for local model configuration
- Dark mode theme
- Responsive UI with collapsible chat panel
- Export with multiple formats (PNG, JPEG, WebP)
- Image upload with drag-and-drop support
- Processing status indicators
- Gemini AI integration for image analysis and chat
- Natural language command processing via chat
- Backend infrastructure for local model support (REMBG placeholder)
- Full local model execution (GFPGAN, Real-ESRGAN, ONNX)
- Specialized image editing endpoints
- Database persistence for editing history
- User authentication
- Batch processing
- Cloud storage integration
- Real-time collaboration
Decision: Use Canvas API (Filters) for all basic operations Rationale: Immediate feedback, no server latency, works offline, resolves greenish rectangle bug by using source-to-canvas rendering with filters.
Decision: Use localStorage for model config Rationale: Convenient for single-user app, settings persist across sessions Note: AI features use Replit AI Integrations (no API key required)
Decision: Store edited image DataURLs in memory Rationale: Simple implementation, works well for session-based editing Limitation: Not persisted, limited by browser memory
Decision: Use JPEG as default for processing/export (0.95 quality) Rationale: Better performance and smaller file sizes compared to PNG while maintaining high visual quality.
- TypeScript for type safety
- Functional React components with hooks
- Descriptive naming (tool names match UI labels)
- Separation of concerns (components, utilities, types)
- Dark theme optimized for photo editing (reduces eye strain)
- CSS variables for theming
- Accessible color contrasts
- Props-based configuration
- Callback functions for parent communication
- data-testid attributes for testing
- Error handling with toast notifications
- REPLIT_AI_API_KEY (Managed by Replit AI Integrations)
- Initial load: ~2s (includes React, TailwindCSS, components)
- Image processing: 50-200ms for client-side filters
- AI operations: 2-5s depending on network and model response
- Memory usage: ~50-100MB per edited image in history
- Canvas Context Loss: If browser memory runs low, processing may fail
- Large Image Handling: Very large images (>4K) may be slow to process
- Mobile Responsiveness: Chat panel may not be ideal on very small screens
- Local Model Execution: Currently requires external model setup and environment configuration
- Image upload (drag-drop and click)
- Tool application (each of 7 tools)
- Parameter adjustment (sliders)
- Undo/redo functionality
- Before/after comparison toggle
- Export in different formats
- Settings configuration (models)
- Chat panel open/close
- AI chat interaction (Gemini)
- Dark mode toggle
- Theme persistence
-
High Priority
- Full integration of specialized local models
- Database for history persistence
- User authentication
-
Medium Priority
- Batch processing
- Advanced filters library
- Cloud storage integration
-
Low Priority
- Real-time collaboration
- Mobile app
- Settings are stored in localStorage as JSON
- History is stored in state array with current index
- Client-side processing uses standard Canvas filters for stability
- Backend integrates with Gemini using Replit AI Integrations
- Frontend builds to static files with Vite
- Backend runs on same port as frontend (5000)
- No database required for MVP