Question: Overview In this assignment, you will be implementing different image filters that modify the pixels of the image in some interesting ways. The filters you

Overview
In this assignment, you will be implementing different image filters that modify the pixels of the image in some interesting ways. The filters you will be implementing are the same ones used in image editing applications and apps like Instagram (however, you will implement basic ones). While doing so, you will learn how images are stored and manipulated in a computer and you will get much more comfortable working with nested loops.
Representing Images and Colors
As you learned in class, colors can be represented by three numbers describing the values of the red, green, and blue color components. These numbers are in the range [0,255]. In this assignment, we will use a 2-Dimensional list whose elements are tuples to represent an image. We will also work with the CSE8AImage library created by the course staff which makes it easy to create new images and to query its properties.
2D Lists
One way to think of 2D lists is as a matrix. And just like with matrices, the first dimension represents the rows and the second dimension the columns. The CSE8AImage library has functions defined to query for the image height and width. The height of an image corresponds to the number of rows and the width of the number of columns. Also, remember that the top-most row is at index 0 and the bottom-most row at index height-1. Similarly, the left-most column is at index 0 and the right-most column at index width-1.
STEP A: Downloading Starter Code
To get started, first download the starter code here. Click on the dropdown at the top that says PA5 Starter Code and then download. This will download a zip file. Unzip it and you are good to go. You will only modify the pa5.py and pa5-test.py files. Please do NOT modify the contents of the CSE8AImage.py file.
Note: If you are not logged into Google, you will see a different interface. In this case, there will be a button on the top-right corner reading Download All. Click that button.
IMPORTANT: DO NOT change the original folder structure, that is, DO NOT rename/move files around. All the 3 files should be in the same folder with the given names.
You may add more images into the images/ folder for testing.
STEP B: Installing NumPy and pillow packages
In the CSE8AImage Library provided in the starter code, you may see that we have imported packages called NumPy and PIL. In order for you to be able to utilize the given library, your system should have these packages installed. Otherwise, you will get a ModuleNotFoundError message.
Follow these instructions carefully to install NumPy and pillow packages.
To find the path where you need to install these packages run the below two commands (the commands that follow >>>) on the IDLE Python shell and you can see that it prints the path where you need to install the packages (In the example below the path is: C:\Users\winny\AppData\Local\Programs\Python\Python38)
Commands:
>>> import sys
>>> print(sys.executable)
Example:
Open Command Prompt on Windows or terminal on Mac and navigate to the path printed out in the IDLE shell using the cd command as shown below. (Make sure that you do not navigate all the way to the last file, but only to the last directory. In the above example, we will navigate to the Python38 directory)
Command:
> cd
Example (For Windows):
Example (For MAC):
When you go into idle and type the sys command and print(sys.executable), you may get something similar to below on MAC machines:
/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8
Make sure that you do not navigate all the way to the last file, but only to the last directory, because python3.8 is a file, not a folder. So when you are running the cd command on the terminal of MAC machine, run it as:
> cd /Library/Frameworks/Python.framework/Versions/3.8/bin/
Note: If you see >>> before you run a command, that means you navigated to the last file rather than bin, so make sure you navigate to the last directory, not file (see above).
After navigating to the correct Python path, run the below command on the command prompt in Windows or the terminal in Mac to ensure that you have pip installed.
Command (For Windows):
python -m ensurepip
Command (For Mac):
python3-m ensurepip
Example:
Once pip is installed, you can install the numpy and pillow packages as follows using the pip command in the same path as shown below. The packages will now be downloaded to your local machine if it is not present
Command (For Windows):
> python -m pip install numpy
> python -m pip install pillow
Command (For Mac):
> python3-m pip install numpy
> python3-m pip install pillow
Example:
Note that if the package has been installed previously on your machine then it will say Requirement already satisfied otherwise it will say Downloading and once the download is complete you will be able to use these packages. You can disregard warning messages, if any.
STEP C: Unde

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!