Adding a button for each filter

As you may recall, the purpose of this app is to connect the filters we made to a user interface to make it more user friendly. So with that in mind, lets walk through a couple.

The first filter we made as a class was the “cyanify” so first let’s make the button

cyanify_button = Button(leftframe, text = "cyanify", width = 10)

Then we are going to want to set the background image to a version of itself where it has been “cyanified”

cyanify_button.config(command = lambda: edit.setBackgroundImage(cyanify(edit.image))) 

Then, with that done, we can pack our button into place

cyanify_button.pack(padx = 3, pady = 3)

With these three steps done, we should now have a functioning filter button in our app. Before you test it, remember to put the line “window.mainloop()” as the last line in our program.

Once you have that button done, you can create a button for each of the different filters you made.