Computers and Technology, 29.04.2021 03:00, Animallover100
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, 23.06.2019 19:30, wilkinsonei4069
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a, b] se pot scrie ca produs de două numere prime? “.
Answers: 1
Computers and Technology, 24.06.2019 16:00, achsahjosey
This isn't about school but every time it tells me to watch an ad to unlock the answer to a question it prompts a survey and it just keeps loading. so i haven't been able to get answers for my tests in like a week.
Answers: 2
Please help
I wrote this code to just filter over an image not completing turn it the color blue r...
Business, 23.12.2020 03:10
History, 23.12.2020 03:10
Mathematics, 23.12.2020 03:20