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:
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...
-
Certain springs are characterized by increasing stiffness with increasing deformation according to the relation F = k1x + k2x3 , where F is the force exerted by the spring, k1 and k2 are positive...
-
Define the joule in terms of SI base units.
-
A used conveyor dealer presents an investment package that requires you to pay $\$ 189.99$ a month with $\$ 1,499.00$ down and a nominal annual interest rate of $17 \%$. What is the actual cost of...
-
The PDC Company was described earlier in this chapter. Refer to the PDC Companys projected monthly operating schedules in Table. PDCs sales are projected to be $80,000 in September 2011. A. Prepare...
-
A European put option on the share with an exercise price of $20 is currently trading for $22.00. The call option has six months until expiry and the riskless interest rate (continuously...
-
Given a directed graph G = (V, E), explain how to create another graph G = (V, E) such that (a) G has the same strongly connected components as G, (b) G has the same component graph as G, and (c) E...
-
What major asset will normally be insignificant for service enterprises and relatively substantial for retailers, wholesalers, and manufacturers? Briefly discuss.
-
Evaluate how bias, cross-cultural barriers, and ethnocentrism impact the organization, and address how you ensure that your employees feel they are represented and heard? What are at least three...
-
Discuss three benefits of seeking feedback, both in formal and informal ways, from those who are being coached. Discuss whether feedback should be formative or summative and justify your response....
-
e) Explain any TWO (2) techniques that the researcher could use to ensure the two groups f) are equivalent in ability. In order to reject the null hypothesis, it is necessary to analyse the data...
-
Fynn is 29 and has come to see Clive, a counsellor, because he has recently broken up with his girlfriend Stacey and she has moved out of their shared apartment. Stacey has been attending counselling...
-
Juan and Maria Ramiro and Alexandro their 15 year old son, have been renting a townhouse with your agency for the last 3 months. Juan and his wife Maria do not speak or read English well. The Strata...
-
During a cesarean section, an incision is made through allEXCEPT which of the following? linea alba perimetrium superficial fascia decidua basalis
-
Sundial Technologies produces and sells customized network systems in New Brunswick. The company offers a 60-day, all software and labor-and an extra 90-day, parts-only- warranty on all of its...
-
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?
-
What is the activity in \(\mathrm{Bq}\) and in \(\mathrm{Ci}\) of a \(2.0 \mathrm{mg}\) sample of \({ }^{3} \mathrm{H}\) ?
-
The activity of a sample of the cesium isotope \({ }^{137} \mathrm{Cs}\) is \(2.0 \times 10^{8} \mathrm{~Bq}\). Many years later, after the sample has fully decayed, how many beta particles will have...
-
The technique known as potassiumargon dating is used to date volcanic rock and ash, and thus establish dates for nearby fossils, like this 1.8 -millionyear-old hominid skull. The potassium isotope...
Study smarter with the SolutionInn App