Guest User

Untitled

a guest
Apr 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import gimpcolor
  2.  
  3. # load mask as layer
  4. mask=pdb.gimp_file_load_layer(image,'/path/to/mask.png')
  5. pdb.gimp_image_add_layer(image, mask,0)
  6.  
  7. # get selection
  8. pdb.gimp_image_select_color(image, CHANNEL_OP_REPLACE, mask,gimpcolor.RGB(0,0,0))
  9.  
  10. # drop the mask layer
  11. pdb.gimp_image_remove_layer(image,mask)
Add Comment
Please, Sign In to add comment