I want to put an image in front of another one, then use this combined image as a button's background image in Tkinter.
How can I do it?
I am free to
import Tkimage, Image.
Clarify: I want to stick this on the center of this so that something like will be achieved! (I want to write Candy Crush! as a homework!)
Best How To :
Just use photoshop or G.I.M.P.. I assure you, doing it that way will be much simpler and less redundant than essentially getting Tkinter to photo edit for you (not to mention what you're talking about is just bad practice when it comes to coding)
Anyways, I guess if you really want, it would be possible. Create a tkinter button with an image function (image="path\to\image.png") then assign it to a .grid(). For the second image, assign it to the same .grid() coordinants while making sure the overlay image is transparent. Here's an extremely general example since I've been given very little information to go off of.
Button0 = tk.Button(self, compound="top", image=.\path\to\BackgroundImage.png, fg="black", command=lambda: "call your function here"
Button0.grid(row=1, column=1, padx=10, pady=10)
Button1 = tk.Button(self, compound="top", image=.\path\to\TransparentCandyImage.png, fg="black", command=lambda: "call your function here"
Button1.grid(row=1, column=1, padx=10, pady=10)
EDIT: You can also look for Python/scripts that integrate into GIMP (called "Script-Fu's") for performing batch photo editing. There are tons of out there that do all sorts of cool things but I don't know one off hand that will do exactly what you need. Here are some quick search results that look promising though: