Color quantization
The image is reduced to a limited palette: pixels close in color are grouped, and each group gets one representative color and one number. That grouping is what turns a photograph or illustration into flat, fillable shapes. The palette's size determines how aggressively colors merge - fewer colors means larger regions and a simpler puzzle, with more detail lost. Fine lines and small text disappear first.