Question: In this exercise, you'll get some more practice writing image filters! YOUR JOB: Write a function called removeBlue that takes a Weblmage as a parameter

In this exercise, you'll get some more practice writing image filters! YOUR JOB: Write a function called removeBlue that takes a Weblmage as a parameter and sets the blue value of every pixel in the image to be 0 . This will remove all blue from the image, giving it a night vision tone. EXAMPLE: BEFORE: // Constants for the image var IMAGE_URL = "https://static.codehs.com/img/library/characters/monkey.jpg var IMAGE_WIDTH =350; var IMAGE HEIGHT =250; var IMAGE_X = getWidth() / 2 - IMAGE_WIDTH / 2; var IMAGE_Y = getHeight( ) / 2 - IMAGE_HEIGHT / 2; // We need to wait for the image to load before modifying it var IMAGE_LOAD_WAIT_TIME = 50; // Filter that sets the blue value of every pixel in the image to be 0 function removeblue(image) \{ I/ WRITE YOUR CODE HERE! \} function start() \{ /I set up the image var image = new WebImage(IMAGE_URL); image. setsize(IMAGE_WIDTH, IMAGE_HEIGHT); image, setposition(IMAGE_X, IMAGE_Y); /I Add it to the canvas add(image); II Wait for it to load before applying the filter setTimeout(function() \{ removeblue(image); \}. IMAGE LOAD WAIT TIME)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
