6. Assume an image named image is all green

6. Assume an image named image is all green

and we execute the following code segment.

1
2
3
4
5
6
7
8
w = image.getWidth();
for (var pixel of image.values()) {
x = pixel.getX();
y = pixel.getY();
if (x + y < w) {
pixel.setRed(255);
}
}

Which one of the following is the image generated by this code segment?

Comments

Popular posts from this blog

Choose Your Social Media Channels Week 5 Quiz