Question: 1

Which of the following describes the instructions for a general image filter?

Given an image:
for every (x, y) coordinate in the image
Get the current pixel at (x, y)
Modify the pixel according to a function
Update image at (x, y) with this modified pixel

Given an image:
for every (x, y) coordinate in the image
Get the current pixel at (x, y)
Add 50 to the red value of the pixel
Add 50 to the green value of the pixel
Add 50 to the blue value of the pixel
Update image at (x, y) with this modified pixel

Given a pixel:
Modify the red value of the pixel according to a function
Modify the green value of the pixel according to a function
Modify the blue value of the pixel according to a function
return the modified pixel

Given an image:
Get the pixel at (0, 0) from the image
Modify the pixel according to a function
Update image at (0, 0) with this modified pixel

The second option describes the instructions for a general image filter, as it specifies modifying the red, green, and blue values of each pixel in the image by adding 50 to each value.