I'd like to apply some filters to an uploaded image. The filters get generated based on a text that gets entered by the user. This is how the function looks so far:
def validate_email(self):
textboxValue = self.lineEdit.text()
image = self.open()
for c in textboxValue:
if c == 'a':
image = image.filter(ImageFilter.GaussianBlur(1.05)).show()
elif c == 'b':
image = ImageEnhance.Brightness(image)
image.enhance(1.1).show()
elif c == 'c':
image = ImageEnhance.Contrast(image)
image = image.enhance(1.1).show()
elif c == '@':
image = ImageOps.grayscale(image).show()
else:
print(c)
I'm pretty sure that yesterday my code worked, but today I constantly get the error
AttributeError: object has no attribute ...
and the "..." differ, sometimes it's enhance, sometimes getbands etc. It's always the ImageEnhance part that causes the error. The GaussianBlur filter is working fine.. I read about that solution, but that didn't help me. I assume it's too old..
I'm new to Python so maybe I did some basic mistakes. I would be glad if somebody could help!