Computers and Technology, 29.04.2021 21:30, cadecurtis
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)
Answers: 2
Computers and Technology, 21.06.2019 21:00, lisamccray45
It is not a good idea in a cover letter to mention another person whom the employer knows.
Answers: 1
Computers and Technology, 22.06.2019 23:00, maxy7347go
Which factor is the most important when choosing a website host? whether customers will make secure transactions the number of email accounts provided the purpose of the website the quality of the host control panel
Answers: 3
Computers and Technology, 23.06.2019 02:30, hailey5campbelp7d1c0
What is the power dissipated by a resistor with a current of 0.02 a and a resistance of 1,000 ? a. 200 w b. 20 w c. 0.4 w d. 4 w
Answers: 1
Please help
I wrote this code to just filter over an image not completing turn it the color blue r...
Mathematics, 28.08.2021 16:10
Health, 28.08.2021 16:10
Mathematics, 28.08.2021 16:10
Chemistry, 28.08.2021 16:20