Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

Enter a filename: astronaut.png

image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

Summarize the types and degree of reference group influence.

Answered: 1 week ago

Question

Prepare an ID card of the continent Antarctica?

Answered: 1 week ago

Question

What do you understand by Mendeleev's periodic table

Answered: 1 week ago