Implement generate triangles from images