Question: IN JAVASCRIPT Write a function called swapGB that takes an image as an argument and returns a copy of the input image, where all the

IN JAVASCRIPT

  1. Write a function called swapGB that takes an image as an argument and returns a copy of the input image, where all the green channels and the blue channels are swapped. If the color of a pixel is (r, g, b) in the input image, its color in the output must be (r, b, g) . You must useimageMap, without using loops.

  2. Write a function called shiftRGB that takes an image as an argument and returns a copy of the input image, where all the channels are shifted. If the color of a pixel is (r, g, b) in the input image, its color in the output must be (b, r, g) . You must use imageMap, without using loops.

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!