02-28-2018, 07:01 PM
Say, for example, I have a layer that is solid red (255,0,0) on the left side and solid blue (0,0,255) on the right. Then I cut out and keep a rectangle or polygon from the middle. If I zoom in I see that the edge of the polygon fades to white. The left fades from red to white, and the right from blue to white.
The original pixels, at what now is the edge, were full red (or blue).
Is there a way to cut that leaves the pixels at the edge at their original color (hue/sat/lum)?
This is what I did:
pdb.gimp_image_select_polygon(image01, CHANNEL_OP_ADD, len(polygonPoints), polygonPoints)
pdb.gimp_selection_invert(image01)
pdb.gimp_edit_cut(layerobj)
pdb.gimp_selection_invert(image01)
I think that what is happening is that for the cut the pixels at the edge might be considered as, for example, 80% inside the polygon and 20% outside - so they are given acolor that is 80% red.
I there way to select a threshold so that the pixels that are >= 50% red would be solid (255,0,0) red, otherwize they would be cut from the polygon?
Thanks,
Saurabh
The original pixels, at what now is the edge, were full red (or blue).
Is there a way to cut that leaves the pixels at the edge at their original color (hue/sat/lum)?
This is what I did:
pdb.gimp_image_select_polygon(image01, CHANNEL_OP_ADD, len(polygonPoints), polygonPoints)
pdb.gimp_selection_invert(image01)
pdb.gimp_edit_cut(layerobj)
pdb.gimp_selection_invert(image01)
I think that what is happening is that for the cut the pixels at the edge might be considered as, for example, 80% inside the polygon and 20% outside - so they are given acolor that is 80% red.
I there way to select a threshold so that the pixels that are >= 50% red would be solid (255,0,0) red, otherwize they would be cut from the polygon?
Thanks,
Saurabh