subject

Please help I wrote this code to just filter over an image not completing turn it the color blue red or green. How do I have the code filter the image and still show the image but with a red filter or green or blue. thank you

# Constants for the image
IMAGE_URL = "https://codehs. com/uploads/c709d869e62686611c1ac84 9367b3245"
IMAGE_WIDTH = 420
IMAGE_HEIGHT = 300
IMAGE_LOAD_TIME = 1000

image = Image(IMAGE_URL)
image. set_size(IMAGE_WIDTH, IMAGE_HEIGHT)
add(image)

"""
Filter that takes an image as a parameter
and applies a filter, then returns the filtered image
"""
# asks the user to input a color of choice

user_color = input("Pick a color, blue, red or green:")

if user_color == "red":
red = 255
green = 0
blue = 0

if user_color == "green":
red = 0
green = 255
blue = 0

if user_color == "blue":
red = 0
green = 0
blue = 255

def custom_filter(image):
for x in range(image. get_width()):
for y in range(image. get_height()):
image. set_blue(x, y,blue)
image. set_red(x, y,red)
image. set_green(x, y,green)

return image

def change_image():
global image
image = custom_filter(image)

timer. set_timeout(change_image, IMAGE_LOAD_TIME)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Why is it a good idea to leave an interview being courteous and polite?
Answers: 1
question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 23.06.2019 20:40
Instruction active describing list features which statements accurately describe the features of word that are used to create lists? check all that apply. the tab key can be used to create a sublist. the enter key can be used to add an item to a list. the numbering feature allows for the use of letters in a list. the numbering feature can change the numbers to bullets in a list. the multilevel list feature provides options for different levels in a list.
Answers: 2
question
Computers and Technology, 24.06.2019 10:30
This device directs network traffic. bridge hub nic repeater router switch
Answers: 3
You know the right answer?
Please help I wrote this code to just filter over an image not completing turn it the color blue r...
Questions
question
Mathematics, 13.09.2019 08:20
question
Mathematics, 13.09.2019 08:20
Questions on the website: 13722363