Step-by-Step Workflow
Upload an Image ️
Select any photo from your device. For the best results, pick an image where the subject has decent contrast against the background.
Choose Your Engine ⚙️
If you selected the Algorithmic (OpenCV) engine, hover over the original image canvas. Click and drag to draw a green box that perfectly encapsulates your subject. This tells the algorithm exactly where to look.
Extract & Download ✨
Click "Remove Background". Once processing is complete, you'll see your isolated subject over a transparent checkerboard. Click "Download Transparent PNG" to save the result with full alpha-channel transparency!
Technical Specs & FAQs
AI Engine: U^2-Net Neural Network
The "AI Mode" utilizes the @imgly/background-removal library. It loads a pre-trained U^2-Net Machine Learning model directly into the browser. By leveraging WebGL and WebAssembly, it pushes the heavy tensor calculations to your device's GPU, generating a highly accurate alpha matte for the foreground.
Algorithmic Engine: OpenCV GrabCut
The classic mode uses a WebAssembly port of OpenCV to run the GrabCut algorithm. It uses iterative Graph Cuts and Gaussian Mixture Models (GMMs). When you draw the bounding box, the algorithm assumes everything outside the box is the "background" GMM, and uses that data to statistically guess the foreground pixels inside the box.
Dynamic Memory & Scaling
Running C++ algorithms in a browser tab requires careful memory management. Before running GrabCut, the service checks the image dimensions. If it exceeds 800px, it mathematically calculates a scale factor and resizes the OpenCV Matrix (cv.Mat) using cv.INTER_AREA interpolation to prevent the browser tab from crashing while maintaining edge fidelity.
Pointer Manipulation
Once OpenCV generates a mask, the service iterates through the image array pointer by pointer (ucharPtr). It checks if OpenCV marked the pixel as "definite background" or "probable background" (values 0 or 2), and aggressively strips the Alpha channel (sets opacity to 0) before painting it back to an HTML5 Canvas.