Upload any image to see it stylized using triangles.
We create a random set of points on top of the image, and compute a constrained Delaunay triangulation using the poly2tri library. The borders are set as constraints for the triangulization algorithm in order to make sure that the triangles completely cover the image. For each triangle, we calculate the centroid point, read the color from the original image at that point, and fill the triangle with that color.