Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use Python 3 Write a program that takes a greyscale image and turns it into a black and white image. The program should ask the

Use Python 3

Write a program that takes a greyscale image and turns it into a black and white image.

The program should ask the user to enter a filename, open this file, asks the user to enter a 'threshold value' (described below), perform the transformation and then save the black and white version of the image to the file 'output.png'.

To turn a greyscale image into a black and white image given a threshold value:

Each greyscale pixel with a colour value greater than or equal to the threshold value should be set to white (1) in the output image.

Each greyscale pixel with a colour value less than the threshold value should be set to should be set to black (0) in the output image.

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

image text in transcribed

Enter a filename: astronaut.png Enter a threshold: 127

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_2

Step: 3

blur-text-image_3

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago