Question: 8 . 1 8 . 5 : Create and save a 2 0 0 2 0 0 pixel image containing two triangles. Complete the following

8.18.5: Create and save a 200200 pixel image containing two triangles.
Complete the following program that creates and saves a 5050 pixel image containing two triangles. The triangle on the top
right half of the image contains pure green pixels. The triangle on the bottom left half of the image contains pure red pixels. A
single diagonal line of pixels that separates the two triangles contains pure white pixels. Note: pixels that have not been assigned
a color are are white by default.
In the output produced, R represents a red pixel, G represents a green pixel, W represents a white pixel, and A represents a pixel of
any other color.
from ezgraphics import GraphicsImage
image = GraphicsImage (50,50)
4 # Your code goes here
5
6 image.save("triangles.gif")|
 8.18.5: Create and save a 200200 pixel image containing two triangles.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!