USE PYTHON THANK YOU

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

USE PYTHON THANK YOU

Instructions
To enlarge an image, one must fill in new rows and
columns with color information based on the colors of
neighboring positions in the original image.
• Develop and test a function named enlarge .
• This function should expect an image and an integer
factor as arguments.
The nction should build and return a new image
that represents the expansion of the original image by
the factor.
Hint: Copy each row of pixels in the original image to one
or more rows in the new image
To copy a row, use two index variables, one that starts on
the left of the row and one that starts on the right. These
two indexes converge to the middle. This will allow you to
copy each pixel to one or more positions of a row in the
new image.)
An example of the program is shown below:
Original
Enlarged
enlarge.py
1 """
2 File: enlarge.py
3 Project 7.11
4
5 Defines and tests a function to enlarge an image.
6 "|||||
7
8 from images import Image
9
10 def enlarge (image, factor):
11
images.py
12
13
14
15 def main():
16
17
18
19
20
21 if __name__
22 main()
23
24
25
U
"""Builds and returns a copy of the image which is larger
by the factor."""
pass
filename =
image
newimage
newimage.draw()
=
smokey.gif
input("Enter the image file name: ")
Image(filename)
enlarge (image, 2)
=
"__main__":
+
Transcribed Image Text:Instructions To enlarge an image, one must fill in new rows and columns with color information based on the colors of neighboring positions in the original image. • Develop and test a function named enlarge . • This function should expect an image and an integer factor as arguments. The nction should build and return a new image that represents the expansion of the original image by the factor. Hint: Copy each row of pixels in the original image to one or more rows in the new image To copy a row, use two index variables, one that starts on the left of the row and one that starts on the right. These two indexes converge to the middle. This will allow you to copy each pixel to one or more positions of a row in the new image.) An example of the program is shown below: Original Enlarged enlarge.py 1 """ 2 File: enlarge.py 3 Project 7.11 4 5 Defines and tests a function to enlarge an image. 6 "||||| 7 8 from images import Image 9 10 def enlarge (image, factor): 11 images.py 12 13 14 15 def main(): 16 17 18 19 20 21 if __name__ 22 main() 23 24 25 U """Builds and returns a copy of the image which is larger by the factor.""" pass filename = image newimage newimage.draw() = smokey.gif input("Enter the image file name: ") Image(filename) enlarge (image, 2) = "__main__": +
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education