我想寫一個腳本,重新大小,移動和混合兩個圖像在一個使用gimp 2.8在Ubuntu 13.10。gimp編輯混合python腳本產生不同的混合比混合工具
我上傳了2倍所需的圖像,結果在這裏: http://imgur.com/a/bjgIA
我設法讓所有的運行,但有一點失敗。混合命令。我將問題簡化爲pdb.gimp_edit_blend命令,它不是將圖層蒙版與透明背景混合,而是創建一個不透明的漸變。
image = gimp.image_list()[0] #image is 237x300 png like above
pdb.gimp_image_resize(image, 300, 300, -100, 0)
fg_layer = pdb.gimp_image_get_active_layer(image)
mask = pdb.gimp_layer_create_mask(fg_layer,ADD_WHITE_MASK)
pdb.gimp_image_add_layer_mask(image, fg_layer, mask)
# from here it goes wrong, if I skip this step than I can get the correct result
# using the gimp blent tool from the gui using the same settings as here
pdb.gimp_edit_blend(fg_layer, FG_BG_RGB_MODE, NORMAL_MODE, GRADIENT_LINEAR, 100, 0, 0, True, False, 0, 0, True, 0, 150, 150, 150)
整個代碼是在這裏:http://pastie.org/9079343
任何想法,我做錯了什麼? 非常感謝
什麼是您收到的不良結果? – CodeCamper
@CodeCamper http://i.imgur.com/wLzcq0a.jpg它也在上面提到的結果專輯中 – mbernasocchi