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:
Enter a filename: astronaut.png
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started