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
-
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.
-
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started