def makeImage(triangle, largura, altura):
    """
    triangle: receives a tuple in the form: x1, y1, x2, y2, x3, y3, R, G, B, A
    largura: image weight
    altura: image height
    returns: numPy array of the triangle composed final image
    """
back = Image.new('RGBA', (largura, altura), (0, 0, 0, 0))
poly = Image.new('RGBA', (largura, altura))
pdraw = ImageDraw.Draw(poly)
pdraw.polygon([1, 2, 3, 4, 5, 6], fill=(255, 0, 0, 127))
back.paste(poly, mask=poly)
back = back.convert('RGB')
backArr = asarray(back)
Convert Matplotlib figure to NumPy array without any borders/frame or axis