gimp edit blend in python script produces different blend than the blend tool -
i'm trying write script re-sizes, moves , blends 2 images in 1 using gimp 2.8 on ubuntu 13.10.
i uploaded 2 needed images , results here: http://imgur.com/a/bjgia
i managed run 1 point fails. blending command. reduced problem pdb.gimp_edit_blend command instead of blending layer mask transparent background creates opaque gradient.
image = gimp.image_list()[0] #image 237x300 png 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) # here goes wrong, if skip step can correct result # using gimp blent tool gui using same settings 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)
the whole code here: http://pastie.org/9079343
any idea i'm doing wrong? lot
your error pretty in own code - calling blending function passing fg_layer first parameter, instead of mask:
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) ^^^^^^^^
instead, same call passing mask drawable parameter (you have in "mask" variable):
pdb.gimp_edit_blend(mask, fg_bg_rgb_mode, normal_mode, gradient_linear, 100, 0, 0, true, false, 0, 0, true, 0, 150, 150, 150)
Comments
Post a Comment