' broken_600.png' a) Write a program to draw a picture in Python using the ImageDraw class and...
Fantastic news! We've Found the answer you've been seeking!
Question:
'
broken_600.png'
Transcribed Image Text:
a) Write a program to draw a picture in Python using the ImageDraw class and then frame the picture according to the following criteria: •Y our program "LIOQlinitials.py" must start with a commented academic integrity pledge, ID Box, and program purpose. 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! • When the main function frame _picture (file_name) is called, it should: a) call two helper functions: fix_frame (file_name) draw_picture() (b) resize the drawn picture so it is 80% of the frame's width and height (c) paste the resized picture into the frame centering it vertically and horizontally (d) show only the final framed picture The helper function fix frame (file_name) will: (screenshots on next page) open the broken frame picture indicated by file_name (a) crop the green, yellow, blue, and red sections from the broken frame resize the yellow, blue, and red sections to match the green section rotate the yellow and blue sections to match the expected orientations paste the four sections into their correct locations to fix the frame return the fixed frame picture (b) (c) (d) (e) (f) To work properly on both broken frame files provided ('broken_600.png' and 'broken_760.png'), all coordinates used in this function should be calculated by the program using the frame's width and height. Do not hardcode coordinates! The helper function draw_picture i) will create and return a new picture with an equivalent width and height of at least (100, 100). For this function, coordinates can be hardcoded. The picture must have a minimum of: o 2 circles (or ovals) o 2 rectangles (or squares) o 2 lines o 2 triangles o A title that describes your picture o Four or more visibly different colours A sample picture drawn fitting these criteria has been provided, but the subject matter of your picture is of your own choosing. Please be creative and have fun with a) Write a program to draw a picture in Python using the ImageDraw class and then frame the picture according to the following criteria: •Y our program "LIOQlinitials.py" must start with a commented academic integrity pledge, ID Box, and program purpose. 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! • When the main function frame _picture (file_name) is called, it should: a) call two helper functions: fix_frame (file_name) draw_picture() (b) resize the drawn picture so it is 80% of the frame's width and height (c) paste the resized picture into the frame centering it vertically and horizontally (d) show only the final framed picture The helper function fix frame (file_name) will: (screenshots on next page) open the broken frame picture indicated by file_name (a) crop the green, yellow, blue, and red sections from the broken frame resize the yellow, blue, and red sections to match the green section rotate the yellow and blue sections to match the expected orientations paste the four sections into their correct locations to fix the frame return the fixed frame picture (b) (c) (d) (e) (f) To work properly on both broken frame files provided ('broken_600.png' and 'broken_760.png'), all coordinates used in this function should be calculated by the program using the frame's width and height. Do not hardcode coordinates! The helper function draw_picture i) will create and return a new picture with an equivalent width and height of at least (100, 100). For this function, coordinates can be hardcoded. The picture must have a minimum of: o 2 circles (or ovals) o 2 rectangles (or squares) o 2 lines o 2 triangles o A title that describes your picture o Four or more visibly different colours A sample picture drawn fitting these criteria has been provided, but the subject matter of your picture is of your own choosing. Please be creative and have fun with
Expert Answer:
Answer rating: 100% (QA)
Creating the Python program as described can be a complex task Below is a basic outline of the program structure and Ill provide some sample code snip... View the full answer
Related Book For
Corporate Finance A Focused Approach
ISBN: 978-1305637108
6th edition
Authors: Michael C. Ehrhardt, Eugene F. Brigham
Posted Date:
Students also viewed these programming questions
-
Calculate the amount of financing needed for Molycorp in 2012. Hint: financing amount is use of cash (capital expenditures, repayment of debt, investment in net working capital, interest expenses)...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Data obtained from asking the wrong questions at the wrong time or in the wrong place can lead to misleading summary statistics. Explain why the following collection procedures are likely to produce...
-
The 20-lb block A and the 40-lb block B are at rest on an incline as shown. Knowing that the coefficient of static friction is 0.25 between all surfaces of contact, determine the value of θ for...
-
Relaxing Recliner Chairs completed the following selected transactions: 2013 Jul. 1 Sold merchandise inventory to Great Mart, receiving a $ 45,000, nine-month, 12% note. Ignore cost of goods sold....
-
Repeat the calculations of Example 9.5, but for a total solution normality of 0.5. Data From Example 9.5:- For the Cu 2+ /Na + exchange with a strong-acid resin, show how the fraction CuR2 in the...
-
Given the following project to landscape a new building site, (a) Draw a Gantt chart using MSP. (b) Find the critical path and project duration in days. (c) Given that each resource is assigned 100%...
-
An annuity, paid in advance, is indexed to inflation at a rate of r% per period. What is the present value of this indexed annuity given a requirement of an effective investment rate of i% per period...
-
Bruce also requires a calculation of taxable income for the most recent year ended December 31, 2019. The calculation should be prepared in Excel. He has also requested that you prepare the year-end...
-
Vertex Pharmaceuticals company profile (https://www.vrtx.com/) Address the following: A description and history of the Vertex Pharmaceuticals The problem that Vertex is seeking to address The...
-
Suppose that consumers' disposable income increased by $341 billion and their spending increased by $299 billion.What was the MPC? Suppose the government increases spending on education by $30...
-
These are the instructions for the homework assignment. 1.Evaluate the reasonableness of a suspicion of fraud2.Create a preliminary fraud hypothesis3.Test and refine the fraud hypothesis through...
-
Find the error for the proposed solution. Then correct the proposed solution. 8x+1.5=3x+0.6 5x=0.9 (5x)/(5)=(0.9)/(5) x=0.18
-
1. Explain in detail the difference between a relational database and a NOSQL Database 2. Describe various data models for NOSQL database. Explain how data model play an important role in your NOSQL...
-
Lilac Corporation is an accrual method taxpayer. Lilac's corporate effective tax rate was 35% in 2023 and 21% in 2024 (due to the change in the law regarding corporate tax rates). A. Lilac...
-
8. The following events occurred during the month of May for McLain Company. a. McLain sells 240 units for $20 each. McLain collects cash for 200 of these units. The units cost McLain $8 each to...
-
The maximum pressure that can be developed for a certain fluid power cylinder is 15.0 MPa. Compute the required diameter for the piston if the cylinder must exert a force of 30 kN.
-
Maggie's Muffins Bakery generated $5,000,000 in sales during 2016, and its year-end total assets were $2,500,000. Also, at year-end 2016, current liabilities were $1,000,000, consisting of $300,000...
-
a. The 2016 sales of Cumberland Industries were $455,000,000; operating costs (excluding depreciation) were equal to 85% of sales; net fixed assets were $67,000,000; depreciation amounted to 10% of...
-
Consider a $25,000 loan to be repaid in equal installments at the end of each of the next 5 years. The interest rate is 10%. a. Set up an amortization schedule for the loan. b. How large must each...
-
Because many consumers choose between coffee and tea, the coffee and tea demand functions depend on both prices. Suppose the demand curves for coffee and tea are where \(Q_{c}\) is the quantity of...
-
Governments use wage subsidies to maintain employment in times of economic recession, to encourage firms to hire and train specific groups of workers such as low-income workers, women, and students...
-
People who qualify for affordable housing in Sydney, Australia, have their rent capped at \(30 \%\) of their gross annual income. People who live in private rental properties in the city are not...
Study smarter with the SolutionInn App