subject

PLEASE HELP ME FIX THIS CODE. I WANT IT TO HAVE USER INPUT TO CHANGE AND IMAGE FILTER TO BLUE RED OR GREEN.

user_color = input("What color would you like to paint the canvas, blue, red or green?:")

def user_red(pixel):
pixel[0] = 100 + pixel[0]
pixel[1] = 100 - pixel[1]
pixel[2] = 100 - pixel[2]

return pixel

def user_green(pixel):
pixel[0] = 100 + pixel[0]
pixel[1] = 100 - pixel[1]
pixel[2] = 100 - pixel[2]

return pixel

def user_blue(pixel):
pixel[0] = 100 + pixel[0]
pixel[1] = 100 - pixel[1]
pixel[2] = 100 - pixel[2]

return pixel

def custom_filter(image, user_color):
for x in range(image. get_width()):
for y in range(image. get_height()):
pixel = image. get_pixel(x, y)
new_colors = invert_pixel(pixel)
image. set_red(x, y, new_colors[0])
image. set_green(x, y, new_colors[1])
image. set_blue(x, y, new_colors[2])

return image

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

timer. set_timeout(change_image, IMAGE_LOAD_TIME)

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 14:10, normarismendoza
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
image
Computers and Technology, 22.06.2019 21:30, aesthetickait
How do you take a green screen out of the video while editing?
Answers: 2
image
Computers and Technology, 23.06.2019 06:00, jack487
How can a user delete a drawing object
Answers: 1
image
Computers and Technology, 23.06.2019 10:50, whyidkmyself
Your friend kayla is starting her own business and asks you whether she should set it up as a p2p network or as a client-server network. list three questions you might ask to kayla decide which network to use and how her answers to those questions would affect your recommendation.
Answers: 2
You know the right answer?
PLEASE HELP ME FIX THIS CODE. I WANT IT TO HAVE USER INPUT TO CHANGE AND IMAGE FILTER TO BLUE RED...

Questions in other subjects: