任何可以告訴我如何使用PyGI(或PyGTK)更改圖像顏色? 我需要方法或屬性,如CEGUI中的「ImageColour」,改變非alpha通道的圖像。例如: 我有一張照片,它只是白色的圓形。我需要在界面的不同位置使用這一輪,使用不同的顏色。例如,我不會創建本輪的另一個dublicates,例如,我需要256種不同的顏色。 和圖片示例:PyGI編輯圖像顏色
This is picture with white round, what I've got
This is picture with round, what color I want to see
這裏是功能,我使用變色什麼:
image = gtk.Image()
image.set_from_file("images/button.png")
pix_buffer = image.get_pixbuf()
pix_buffer.fill(0xA32432FF)
image.set_from_pixbuf(pix_buffer)
那無法正常工作。這充滿了紅色四邊形的圖像。
另一個想法是modify_fg/modify_base,但在這裏只能modify_bg什麼改變只背景(並且不改變白色)