FlowCells
Segments any image on the CPU: few cells, high fidelity, no training.
Segmentation
FlowCells segments images. Given any picture, it divides it into connected cells that follow its shapes and texture, crowding where detail is dense and stretching along edges. It runs on the CPU, needs no training, and takes a couple of seconds. The cells prove themselves by rebuilding the picture: on the standard rocket photograph, 6,374 of them, each with its own small color model, reproduce the frame at 30 dB. Few segments, high fidelity and no GPU make it competitive with the state of the art, and there is little else like it.
The rocket
Method

FlowCells begins from one cartoon and texture decomposition of the image, computed once with BFFT's Meyer model and then held fixed. The cartoon carries region-scale structure and the texture carries fine directional detail. Together with the defect between the cartoon and its smoothed projection, they define a support tensor at every pixel, which says how large a cell may be there and in which direction it may stretch. The tensor's area form is a density: cells crowd where it is high and spread out where it is low.
A long, straight edge can hold one long cell. Along a curve the same cell would leave the feature, so a curvature correction adds population only where a straight support no longer fits. A deterministic low-discrepancy sequence then turns the density into the complete set of sites in one pass, with no requested count, no ranking, and no spawning or deletion.

Each site claims ground by anisotropic first arrival through the same geometry, which makes every region connected without a repair pass. One reverse pass through that front returns each site's support to it and lets the site move without changing the topology. Each cell then fits an affine color model in OKLab and, where the residual justifies it, one nonlinear ridge. A final soft step relaxes internal boundaries the image does not support, while the cells still form a partition of unity.
Across five 256-pixel test images, the curvature correction alone improves the reconstruction by 0.43 to 2.68 dB.
Cells
- Owner
- The site whose support reaches the pixel first.
- Runner-up
- The neighboring claimant, which makes every interface explicit.
- Parent
- In the hierarchy, the cartoon cell that contains a texture microcell.
- Chart
- Normal, tangent and scale coordinates relative to the owner, for local fitting.
- Model
- The affine fit, with at most one ridge, chosen for the support the cell actually owns.
- Residual
- The error that remains, attached to its place, where any further refinement begins.
Hierarchy
FlowCells also has a two-level form. Cells are first placed on the cartoon alone at half scale, then their boundaries are refined at full resolution without creating or deleting any. The texture, defined exactly as the image minus that refined cartoon, receives its own microcells. Each belongs to one cartoon parent, competes only with its siblings and never crosses its parent's boundary. Under-resolved microcells split locally and compatible flat ones merge, so the partition never restarts.

On the rocket, the two levels together rebuild the frame at 34.46 dB in a quarter of a second. The saving grows with the image: on a 1440 × 1799 photograph the hierarchy reaches 34.07 dB in 3.36 seconds with 12,093 cartoon cells, where the single-level method took about 7 seconds and 32,854 cells to reach 35.82 dB.
Uses
Two tools in the BFFT repository build on this structure. A PNG-to-SVG vectorizer organizes an image as coarse owners, full-resolution interfaces and residual children, following the hierarchy above. An experimental JPEG optimizer separates a cartoon from its exact residual texture and grows connected regions of compatible blocks, then smooths color only where the encoded bytes and decoded error show the image can afford it, while still writing ordinary JPEG files.