I'm trying to call module(.)functionname from a image lirary upon user input. For instance a user types in "GaussianBlurr"
I want to be able to replace (ImagerFilter.user_input) and call that filter.(Line 3)
def ImageFilterUsingPil():
im = Image.open('hotdog.jpg')
im.filter(ImageFilter.GaussianBlur) # instead im.filter(ImageFilter.user_input)
im.save('hotdog.png')
Also I tried this
user_input = 'GaussianBlur'
def ImageFilterUsingPil():
im = Image.open('hotdog.jpg')
im.filter(ImageFilter.user_input)
im.save('hotdog.png')
it threw me AttributeError: 'module' object has no attribute 'user_input'