
Traditional web-based photo editors lack the intuitive control of desktop software and require manual tool selection. The goal was to create an interface where users could simply describe edits ("remove the background," "make the sky sunnier") and have them applied instantly.
We built a high-performance WebGL canvas engine integrated with a custom AI orchestration layer. User prompts are processed by Gemini Pro to generate mask data and editing instructions, which are then executed in real-time on the client side using GPU acceleration.
The core challenge was translating vague human intent ("make it pop") into precise matrix operations on pixel data. We solved this using a three-stage pipeline:
Semantic Analysis (Gemini Pro Vision):
The user's prompt and current canvas state are sent to Gemini. The model returns structured JSON describing the intended operation (e.g., { "action": "background_removal", "target": "person", "confidence": 0.95 }).
Mask Generation (Client-Side WebGL): Based on the semantic output, we generate pixel-perfect masks using a combination of edge detection, color segmentation, and ML-based object detection (running locally via TensorFlow.js for privacy).
Real-Time Rendering (GPU Acceleration): All transformations are applied as WebGL shaders, ensuring 60fps performance even on 4K images. The canvas state is never sent to a server—everything happens in the browser.
This architecture proves that multimodal AI doesn't need to be a black box—it can be a precise, controllable tool when paired with the right engineering.