Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Why won't my code turn an image to grayscale in python? mage gray py (3.6.4) image gray py-C/Users/lehib ile Edit Format Run Options Window Help

Why won't my code turn an image to grayscale in python? image text in transcribed
mage gray py (3.6.4) image gray py-C/Users/lehib ile Edit Format Run Options Window Help zom graphics ipozt ef main): input-filename-input ("Enter the name of the file: ") output filename input ("What will be the name of the new file?: ") my image Image (Point (120, 120), input filename) image_width my image.getWidth ) image height my image.getHeight ) win GzaphWin ("rgb", image_width, image height) my image.draw (win) row-o column-0 win.getHouse () for row in range (image width): for column in zange (image heighth: r, gb my image.getPixel (row, column) brightness-int (round (0.299* 0.587g 0.114 b)) my_image.setPixel (row, column, color_rgb (brightness, brightness,brightness)) win.update ) win.getMouse () my image.save (output filename) win.close () main ()

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 3 Lnai 6323

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

3642159389, 978-3642159381

More Books

Students also viewed these Databases questions

Question

7. Understand the challenges of multilingualism.

Answered: 1 week ago