Isso funciona para mim:
from gi.repository import Gtk
class Handler:
def on_window1_delete_event(self, *args):
Gtk.main_quit(*args)
def change_image(image):
the_image = builder.get_object("replaceimage")
the_image.set_from_file(image)
the_image.queue_draw()
builder = Gtk.Builder()
builder.add_from_file("ui/sample.glade")
builder.connect_signals(Handler())
window = builder.get_object("window1")
window.show_all()
change_image("assets/image.png")
Gtk.main()
Ele usa este arquivo glade .
No entanto, exige que você salve a imagem no disco primeiro.