Question: I need help with this assignment. I got time till its due I'm just a little confused cause I do not know Python a lick.

I need help with this assignment. I got time till its due I'm just a little confused cause I do not know Python a lick.

Very short description:

Write a Python program to manipulate an image in PPM format.

More detailed description:

Your program should accept the name of an image in PPM format, apply a number of filters to the image (based on the users selections), and write the modified image to a new file. This is done entirely by manipulation of the text file for the PPM image.

Your program must allow the user to choose from a number of filters to apply to the image. Note that sometimes more than one filter can be applied. For example, the user may choose to flip the image horizontally AND convert the image to greyscale. The resulting modified image should have both of those filters applied.

You must choose a subset of the following filters to implement, for a total of 60 points.

Flip image horizontally: 15 points

Flip image vertically: 15 points

Convert to greyscale: 10 points

Invert image colors (you can invert the colors by negating them as described in the assignment description links below): 10 points

Flatten red, green, and/or blue (zero out the color(s) chosen). You must allow the user to flatten any combination of the colors, e.g., flatten both red and blue: 20 points

Horizontal blur: 25 points

Extreme contrast: 15 points

Random noise: 15 points

See the explanation at the following links for more information about PPM images, including their file format, and for example pictures you can use.

http://nifty.stanford.edu/2012/guerin-image-editor/image_editor.html (Links to an external site.)Links to an external site. http://nifty.stanford.edu/2012/guerin-image-editor/ (Links to an external site.)Links to an external site.

For this assignment, you may assume that one line of the PPM file corresponds to one line of the image. (In reality, one line of the PPM file could contain 1 pixel, or 1 line, or 1.5 lines, or 20 lines, or anything.) You may also assume that each RGB value will be a value from 0 to 255 (min value is 0, max value is 255).

Differences from the assignment description/explanation at the given links:

The description splits the program into phases, but you will complete and submit the entire program. Of course, you can implement it in phases if you would like, but you will submit the program as a whole.

You do not need to use a buffer for reading in data.

You will use the filters specified above

To view the resulting PPM images, you need an image viewer that supports the PPM format. GIMP is such a program that will work on multiple platforms. Irfanview (Links to an external site.)Links to an external site. is a program for Windows only that can be used.

Your program will need to use a menu of some sort, in order to allow the user to choose which filters to apply. An example is given in the detailed information in the links.

Program Requirements:

Your program must do the following

Use the object-oriented paradigm. In other words, your program should be broken up into classes and you must utilize principles such as information hiding.

Do NOT use any Python libraries, such as image editing libraries. You should be able to do everything in the program using basic Python (no libraries are needed). You may use the random library if you are implementing the random noise filter.

Allow the user to enter the name of a PPM image file to modify (e.g., inputfile.ppm).

Allow the user to choose the filters to apply to the image.

Apply all of the specified filters to the image and write the result to a new file.

Tell the user the name of the new image file.

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!