HOW TO - FIND THE REGIONS OF LEAST/MOST DIFFERENCE
INGREDIENTS
FORMULA
~~~~
USAGE
| DiffMask | Difference mask. |
| DiffMaskSmooth | Vectorsmoothed difference mask. |
| AutoAAed | Automatically AAed using my vectorscaler. This is the filtered version that will be masked. |
| Combined | AutoAAed masked by DiffMask. |
| CombSmooth | AutoAAed masked by DiffMaskSmooth. |
| CombIndx | Combined indexized to the original palette |
| CombSmoothIndx | CombSmooth indexized to the original palette |
PRESETS:
| Situation | Selective Gaussian Blur options |
| Photo | RADIUS 5, THRESHOLD 70 |
| Pixelart | RADIUS 3, THRESHOLD 50 (used for DiffMask) |
PLUGIN: selectdiffs.py
CODE
import newvector as nv
def perLayer(image, layer, blur_radius = 3, blur_delta = 50, threshold = 16, invert = False, smooth=False):
"'Smart' Auto-antialiasing. Leaves highresolution detail alone." newlayer = pdb.gimp_layer_copy (layer,False) # need to add it to image here?
pdb.plug_in_sel_gauss (image, newlayer, blur_radius, blur_delta) newlayer.mode = DIFFERENCE_MODE
#need to flush displays here?
buf = pdb.gimp_edit_named_copy_visible (image,'temp') fsel = pdb.gimp_edit_named_paste (newlayer,buf,False) pdb.gimp_floating_sel_anchor(fsel)
pdb.gimp_threshold(newlayer, threshold, 255) if invert:pdb.gimp_invert(newlayer)
if smooth:# do something I haven't decided yet with pdb.plug_in_smooth_selection(image, newlayer) here pass#Add a layer mask and chuck the layer content across mask = pdb.gimp_layer_create_mask (newlayer, ADD_COPY_MASK) pdb.gimp_layer_add_mask(newlayer,mask) return newlayer
FURTHERING
RELATIVES