Start on this lab only after you have gone to lab!

This MP starts from where you left off in lab. If you missed your lab section, you will want to start on this MP by first completing Lab 3.

Download The MP

To get this complete MP, you will need to combine files from two different locations:

Completing the MP

Part 1: Shrink the Image

As part of Lab 3, you created an "Illinify" filter where you converted an image to only shades of blue and orange.

For this first part of this MP, you will create a function that shrinks the image to exactly one quarter of its size (half as wide and half as high as the original). This is not as hard as it may seem at first. Remember what you have learned about the for loop - especially the last part that increments the counter variable. You used this to iterate over every single pixel by incrementing it by one. Now that you only need every other pixel, you may want to simply change the way that counter gets incremented. Although this is not technically a filter, it very much acts like one and you can treat it as such.

Make sure to add your new function to the filters variable as the bottom of filters.js.

Part 2: Paint it Black

Now that you have shrunk the image, you will notice that it has an "image in image" effect.

Let us make this look nicer by painting each other pixel (outside the shrunk image) black. You can do that by using this command: newImg.setHSL(x,y,0);. Of course you will need to use a loop that defines x and y.



Part 3: Two More Filters

To complete this task, you must create two new, unique filters:

Submission and Grading

Your program must run to receive any credit at all. If an error occurs so that we are unable to run the program, we will not fix the error in your code. We will award points for your program completing the following:

Submit MP2 here