Question: python, the code shown doesnt work For your final image manipulation problem in this worksheet, write program that takes an image in any mode and


For your final image manipulation problem in this worksheet, write program that takes an image in any mode and increases its size as described on the previous slide. The program should ask the user to enter a filename, an integer multiplier for the width and an integer multiplier for the height. It should open this file, perform the transformation and then save the larger version of the image to the file 'output.png'. Here is an example of the effect your program should produce: astronaut.png Enter a filename: astronaut.png Enter a width multiplier: 1 Enter a height multiplier: 2 nstructions Forum Tutoring Problem astronaut.png Enter a filename: astronaut.png Enter a width multiplier: 1 Enter a height multiplier: 2 Lotion 1 from PIL import Image 2 4 5 LON 3 def changeDimension(image_file,w,h): image = Image.open(image_file) #Opening image im_width, im_height = image.size #Storing actual size of image resize = image.resize((im_width*w, im_height*h)) #resizing image by mult resize.save("output.png'") #Saving the file resize.show() #Showing resized file 9 image.show() #Showing original file 10 file_name = input("Enter a filename: ") #Asking user for file name 11 width = int(input("Enter a width multiplier: ")) #Integer multiplier of wig 12 height = int(input("Enter a height multiplier: ")) #Integer multiplier of 13 changeDimension(file_name,width, height) #Calling changeDimension function 00 Submissions Output Autosaved a few seconds ago Load 11 minutes ago Load Paste snapshot saved 11 minutes ago Load Paste snapshot saved 14 minutes ago Load #1 Not yet! Failed a test
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
