我想写一个脚本,重新大小,移动和混合两个图像在一个使用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