In this project, you can pair up with a partner to develop a novel image filter...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/64fc2e015f9b8_1694248444397.jpg)
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/64fc2e0f600d0_1694248462191.jpg)
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/64fc2e28d2ba5_1694248487205.jpg)
Transcribed Image Text:
In this project, you can pair up with a partner to develop a novel image filter that can be applied to any digital image of your choosing! You will describe your image filter, your development process, and embed your image filter along with its description on your personal portfolio website. YOUR TASK: Fill in the function custom_filter that takes in an Image as a parameter, and modifies the pixels in the image in some way to create a new image, then returns that modified Image! Make your filter unique. Experiment with different ways of modifying each pixel in the image. Here are some questions to help you brainstorm your custom filter: • What happens if you only modify one specific color channel in each pixel (red, blue, or green)? • What happens if you swap color channels in each pixel? • What happens if you only modify pixels if they have a certain amount of red, blue, or green? • What happens if you modify a pixel based on the pixels around it? Have fun! main.py # Constants for the image IMAGE_URL 3 IMAGE WIDTH = 420 4 IMAGE_HEIGHT = 300 5 IMAGE_LOAD_TIME = 1000 6 123 7 8 9 10 11 12 13 14 18+ 19 9 add (image) = image Image (IMAGE_URL) image.set_size(IMAGE_WIDTH, IMAGE_HEIGHT) ***** "https://codehs.com/uploads/c709d869e62686611c1ac849367b3245" 15 # This is an example of an invert filter 16 def custom_filter(image): 17 Filter that takes an image as a parameter and applies a filter, then returns the filtered image *** for i in range (len(image)): for j in range (len (image[0])): image[i][j] 255 image[i][j] return image() 20 21 22 def change_image(): 23 24 25 26 timer.set_timeout(change_image, IMAGE_LOAD_TIME) global image image custom_filter(image) Output Run Clear Docs Assignment Traceback (most recent call last): File VFS.browser.timer.py line 13, in f Grade msg="{0.info)\n(0._class_name_): (0.args[0]}* .format(exc) File https://static1.codehs.com/gulp/2635988b67273920f9e2501f77b6a07 bc0d6ef62/abacus/evaluation/brython-graphics.html?canvasHeight=480&can |vaswidth=400&abacusUID=79879&parentOrigin=https%3A%2F%2Fcodehs.com&ifr ameID=browser-runner-79879/_main_ line 25, in change_image image custom_filter (image) File https://static1.codehs.com/gulp/2635980b67273920f9e2501f77b6a07 bc0d6ef62/abacus/evaluation/brython-graphics.html?canvasHeight=480&can vaswidth=400&abacusUID=79879&parentOrigin=https%3A%2F%2Fcodehs.com&ifr ameID=browser-runner-79879/_main_ line 18, in custom_filter for i in range (len(image)): TypeError: object of type 'Image has no len() M In this project, you can pair up with a partner to develop a novel image filter that can be applied to any digital image of your choosing! You will describe your image filter, your development process, and embed your image filter along with its description on your personal portfolio website. YOUR TASK: Fill in the function custom_filter that takes in an Image as a parameter, and modifies the pixels in the image in some way to create a new image, then returns that modified Image! Make your filter unique. Experiment with different ways of modifying each pixel in the image. Here are some questions to help you brainstorm your custom filter: • What happens if you only modify one specific color channel in each pixel (red, blue, or green)? • What happens if you swap color channels in each pixel? • What happens if you only modify pixels if they have a certain amount of red, blue, or green? • What happens if you modify a pixel based on the pixels around it? Have fun! main.py # Constants for the image IMAGE_URL 3 IMAGE WIDTH = 420 4 IMAGE_HEIGHT = 300 5 IMAGE_LOAD_TIME = 1000 6 123 7 8 9 10 11 12 13 14 18+ 19 9 add (image) = image Image (IMAGE_URL) image.set_size(IMAGE_WIDTH, IMAGE_HEIGHT) ***** "https://codehs.com/uploads/c709d869e62686611c1ac849367b3245" 15 # This is an example of an invert filter 16 def custom_filter(image): 17 Filter that takes an image as a parameter and applies a filter, then returns the filtered image *** for i in range (len(image)): for j in range (len (image[0])): image[i][j] 255 image[i][j] return image() 20 21 22 def change_image(): 23 24 25 26 timer.set_timeout(change_image, IMAGE_LOAD_TIME) global image image custom_filter(image) Output Run Clear Docs Assignment Traceback (most recent call last): File VFS.browser.timer.py line 13, in f Grade msg="{0.info)\n(0._class_name_): (0.args[0]}* .format(exc) File https://static1.codehs.com/gulp/2635988b67273920f9e2501f77b6a07 bc0d6ef62/abacus/evaluation/brython-graphics.html?canvasHeight=480&can |vaswidth=400&abacusUID=79879&parentOrigin=https%3A%2F%2Fcodehs.com&ifr ameID=browser-runner-79879/_main_ line 25, in change_image image custom_filter (image) File https://static1.codehs.com/gulp/2635980b67273920f9e2501f77b6a07 bc0d6ef62/abacus/evaluation/brython-graphics.html?canvasHeight=480&can vaswidth=400&abacusUID=79879&parentOrigin=https%3A%2F%2Fcodehs.com&ifr ameID=browser-runner-79879/_main_ line 18, in custom_filter for i in range (len(image)): TypeError: object of type 'Image has no len() M
Expert Answer:
Answer rating: 100% (QA)
It seems like youre trying to create a custom image filter using Python but youre encountering an error related to the len function The error message indicates that the Image object youre using does n... View the full answer
Related Book For
Project Management The Managerial Process
ISBN: 9781260570434
8th Edition
Authors: Eric W Larson, Clifford F. Gray
Posted Date:
Students also viewed these programming questions
-
George and Wanda received $30,200 of Social Security benefits this year ($12,000 for George; $18,200 for Wanda). They also received $5,000 of interest from jointly owned City of Ranburne Bonds and...
-
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...
-
Googles ease of use and superior search results have propelled the search engine to its num- ber one status, ousting the early dominance of competitors such as WebCrawler and Infos- eek. Even later...
-
The table represents values of differentiable functions f and g and their first derivatives. Use the table of values to answer the questions that follow. Work all of the parts below the line. X f g...
-
A factory manager must decide whether to stock a particular spare part. The part is absolutely essential to the operation of certain machines in the plant. Stocking the part costs $10 per day in...
-
Exercise 53 of Chapter 15 asked for a Students t-based test of the hypothesis that every bag of Chips Ahoy! cookies had at least 1000 chips. Here is a histogram of 10,000 bootstrapped means based on...
-
show how conversations and interaction fit into broader social and interactive context of organizational change;
-
Mom and Pop Groceries has just dispatched a years supply of groceries to the government of the Central Antarctic Republic. Payment of $250,000 will be made one year hence after the shipment arrives...
-
Section G--Stock Split and Stock Dividend The common stock of COB, Inc. is currently selling at $80 per share. The directors wish to reduce the share price and increase the share volume prior to a...
-
Good Homes Construction Company is about to begin the construction of a large new home. The companys president, Michael Dean, is currently planning the schedule for this project. Michael has...
-
Shelly Eckert has prepared the following list of statements about internal control. Identify each statement as true or false. (a) (b) One of the objectives of internal control is to safeguard assets...
-
In this problem, we consider mild modifications of the standard MDP setting. (a) (10 points) Sometimes MDPs are formulated with a reward function R(s) that depends only on the current state. Write...
-
All-Walnut, Inc. produces two models of bookcases. The bookcases sell for the amount listed in the table below. Each bookcase requires a certain number of labor hours, machine time, and materials...
-
Problem 1 Find the number of degrees of freedom of the mechanisms (a)-(d) (a) (b)
-
3) (10 pts) The following grammar is given E EAE (E) -E | id V={E,A), T={-,(,),*,/,+,id} and starting symbol is E. a) Give the left-most derivation of w= id+id*id. Is w accepted? b) Is this a...
-
4. X, the proprietor of a departmental store, decided to calculate separate profits for his two departments L and M for the month ending 31st January. Stock on 31st January could not be valued for...
-
For self-employment tax purposes, which of the following is not considered earnings from self-employment? A. Guaranteed payment received from a partnership by a limited partner for services (s)he has...
-
The National Collegiate Athletic Association (NCAA) and the National Federation of State High School Associations (NFHS) set a new standard for non-wood baseball bats. Their goal was to ensure that...
-
What aspects of the Arthur Andersen culture contributed to the scandal?
-
Shell Case Fabricators (SCF) designs and builds shell casings that enclose electronic products such as calculators, cell phones, and modems. Typically the cases are plastic or plastic compounds. SCF...
-
What benefits do small pharma firms accrue through outsourcing project work?
-
44. On January 1, Year 4, the government leased a police car for five years at $20,000 per year with the first payment being made on December 31, Year 4. This is a capitalized lease. Assume that, at...
-
42. For each of the following, indicate whether the statement is true or false and include a brief expla nation for your answer. a. A pension trust fund appears in the government-wide financial...
-
40. The City of Pfeiffer starts the year of 2008 with the General Fund and an enterprise fund. The General Fund has two activities: education and parks/recreation. For convenience, assume that the...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App