I need to create an image containing a convex polygon, given only the vertices of the polygon. Therefore, I need to find which of the pixels in the image would lie inside the polygon, and colour them differently.
I thought about casting rays from each pixel to count the line intersections and deduce whether the pixel is inside a polygon or not, but this would take a long time to run for hundreds of pixels.
How can I do this more efficiently? I am using Python, with PIL to create the image.