a) Write a program to draw a picture in Python using the ImageDraw class and then frame the picture according to the following criteria:• Your program "L10Ql initials py" must start with a commented...














a) Write a program to draw a picture in Python using the ImageDraw class and then frame the picture according to the following criteria:



• Your program "L10Ql initials py" must start with a commented academic integrity pledge, ID Box, and program purpose. EACH function in your program must state its purpose ni 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) si called, ti should:



(a) call two helper functions: fi xframe ( fi l ename) 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 verticall and horizontallY (d) show only the final framed picture



The helper function fix frame ( fi l e named wil: (screenshots on next page)



(a) open the broken frame pictureindicated by file_name



(b) crop the green, yellow, blue, and red sections from the broken frame (c) resize the yellow, blue, and red sections to match the green section (d) rotate the yellow and blue sections to match the expected orientations (e) paste the four sections into their correct locations to fix the frame



(f) return the fixed frame picture



To work properly on both broken frame files provided ( 'broken 600.png' and



' b r o k e n 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!
Mar 28, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here