selection - Gimp python-fu how do I select a polygon? -
problem
i have need make polygonal selection on image hundreds of times. help, have been trying use python console create script in calculated fashion (same size area, hundreds of different start points). using gimp 2.8.18 on windows 10 machine.
the problem function pdb.gimp_image_select_polygon not seem function.
code
here bare bones of trying in python console:
theimage = gimp.image_list()[0] op_add = 0 point_count = 5 x = 0 y = 0 points = [0.0 in range(0,10)] points[0] = 64.0 + (128.0 * x) points[1] = 64.0 * y points[2] = 128.0 * x points[3] = 32.0 + (64.0 * y) points[4] = 64.0 + (128.0 * x) points[5] = 64.0 + (64.0 * y) points[6] = 128.0 + (128.0 * x) points[7] = 32.0 + (64.0 * y) points[8] = 64.0 + (128.0 * x) points[9] = 64.0 * y pdb.gimp_image_select_polygon(theimage, op_add, point_count, points)
when runs, nothing happens. otoh, if use selection function, selection:
pdb.gimp_image_select_rectangle(theimage, 0, 64 ,0 ,128 ,32)
i no traceback errors using gimp_image_select_polygon, know have correct number of parameters , correct types of parameters. i've tried various things , unable find online.
does see problem code, or python engine in gimp totally fubar?
the length argument number of coordinates, not number of points (so, typically, double)
op_replace
isn't defined in version.
for 100x100 square @ (100,100):
p=[100,100,100,200,200,200,200,100] pdb.gimp_image_select_polygon(image, channel_op_replace,len(p),p)
Comments
Post a Comment