Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a) Write a program to change picture colors according to the following criteria: Your program L9Q1initials.py must start with a commented ID Box AND

a) Write a program to change picture colors according to the following criteria: Your program ?L9Q1initials.py must start wi

: : :

a) Write a program to change picture colors according to the following criteria: Your program "L9Q1initials.py" must start with a commented ID Box AND include a comment that indicates the purpose of the program. EACH function in your program must state its purpose in comments. Ensure you group your code into logical blocks and use comments to explain each block. Coding style is important! The main function in your program should be named: repair_picture () When >>> repair_picture() is called from the command line, the program should: (a) open up the picture 'bird_broken.png' (provided in Blackboard), (b) call the helper functions: repair_bottom (picture) repair_left (picture) (explained next), (c) show only the final picture to verify the changes. The helper function repair_bottom (picture) will: Adjust each color component on the bottom half of the image so it becomes: (255 - current color component) The helper function repair_left (picture) will: Swap the green and red components on the left half of the image if the blue component is greater than 100. Otherwise, do not modify them. The pictures below demonstrate how 'bird_broken.png' is transformed. Viewing the result after each successive transformation can help you verify whether the transformation was done correctly. However, when your program is submitted for marking it should only show the final picture (which includes both transformations). Original version of 'bird_broken.png' After performing repair_bottom Final: After both repair_bottom and repair_left VEYS DANE 2 92

Step by Step Solution

3.44 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

import numpy as np import matplotlibpyplot as plt def repairbottompicture heightwidthpictureshape n... 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

Data Structures and Algorithm Analysis in Java

Authors: Mark A. Weiss

3rd edition

132576279, 978-0132576277

More Books

Students also viewed these Programming questions

Question

Findthe 1-VenergycarriedbythesignalF(v)8/(v216).

Answered: 1 week ago

Question

Can leftist heaps efficiently support decreaseKey?

Answered: 1 week ago