In a Inside APIC: The Full Engineering Teardown of a Free Photo Editor & Background Remover That Runs 100% On Your Device, Akhouri Anmol Kumar describes how APIC runs photo editing and background removal in a browser. The background remover is a useful example of how a browser application can divide the work between model inference and conventional image processing.
The mask is an intermediate result
Kumar describes a general-purpose segmentation model that estimates which parts of the input belong to the foreground. The application then cleans the mask and uses a guided filter near its boundary to refine the transition against the original photo. It also estimates foreground colors near the boundary to reduce traces of the original background when the cutout is placed on a new one.
These stages solve different problems. Imagine cutting out a dark jacket photographed against a bright studio wall. A mask can correctly identify the shape of the jacket while the boundary pixels still carry some of the wall color. The edge can then look pale on a dark replacement background. The refinement and foreground estimation described in the article address different parts of that example. Kumar says the final cutout retains the original image resolution, so the size of the model input and the size of the exported image serve separate purposes.
Model downloads are part of the first run
The teardown describes moving inference into a worker and running models through ONNX Runtime Web. It describes several model tiers and a cached download, so the first run can include work that later runs avoid. The article also describes a fallback based on person segmentation when the main model cannot load. That specialization matters when the subject is a product or a pet.
For a browser editor with this architecture, a useful comparison would record how long it takes to get the first cutout in a fresh session and how long a repeat edit takes after the model is cached. An edge-quality check could export the same image and place it on light and dark backgrounds. Those two checks would answer separate questions about the experience of waiting for a result and the appearance of the exported edge.