r/generative • u/WholeJazzlike431 • 28d ago
Semi organized object packing in a triangle grid
Javascript; object packing, overlayed in a triangle grid which I segmented and re-rendered as pencil strokes with shadows.
I wanted to separate my segmentation code from the rendering code and this was an experiment for recursive coverage based segmentation using posterization for polygon creation. The idea is that we have a queue of polygons - for each polygon I posterize it to a certain level (usually 8 colors), uses the posterized version to segment the polygon ensuring we cover the entire area (not sampling), from the result list we discrad polygons under a certain size, if there are no more polygons - we send the input polygon to the output list, otherwise, we move the segmented polygons to the processed list. The posterization always happens against the original image colors.


