Question: Use python 3 Write a program that takes a coloured image and turns it into a greyscale image according to the method described below. The

Use python 3

Write a program that takes a coloured image and turns it into a greyscale image according to the method described below.

The program should ask the user to enter a filename, open this file, perform the transformation and then save the greyscale version of the image to the file 'output.png'.

To turn a colour image into a greyscale image, we need to decide on a single colour value for each greyscale pixel (based on the three colour values from the corresponding RGB pixel). For this problem, we should decide on this colour value by simply averaging the red, green and blue colour values (and rounding the result down to an integer).

Here is an example of the effect your program should produce:

Use python 3 Write a program that takes a coloured image and

Enter a filename: astronaut.png

turns it into a greyscale image according to the method described below.

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!