Greedy Rectangle Merging: Turning Binary Grids into Simple Geometry – JavaScript example

Greedy rectangle merging is a practical way to simplify dense binary grids into a small set of axis-aligned rectangles. By making local decisions and never backtracking, the same area can be represented with far fewer geometric primitives, revealing how different expansion orders lead to different results. JavaScript source code available.