Cindy Huyser <[EMAIL PROTECTED]> writes:

> I'm in the process of writing a little plug-in that will automate the
> process of converting a selection to a mask.

FYI, GIMP-1.3 finally has this feature builtin.

> My goal is to add a layer
> to the image containing the mask made from the selection. The outline of
> my process is:
> 1) Save the selection to a channel
> 2) Duplicate the original layer
> 3) Add alpha to the original and duplicate layers
> 4) Add a layer mask (transparent/black) to the duplicate layer
> 5) Copy the selection mask saved as a channel
> 6) Paste the copy buffer onto the duplicate layer
> 7) Anchor the pasted layer
> 8) Delete the selection mask channel
> I've been everything except for deleting the selection mask channel.  So
> far, I've tried:
> 1) calling gimp_channel_delete() on the channel ID, either preceded by
> gimp_selection_clear() or by itself.  The call returns TRUE.
> 2) calling gimp_drawable_delete() on the channel's drawable, with and
> without preceding it by a call to gimp_drawable_detach().

>From the PDB help of gimp_channel_delete(): 

  "This procedure deletes the specified channel. This must not be done
   if the gimage containing this channel was already deleted or if the
   channel was already removed from the image. The only case in which
   this procedure is useful is if you want to get rid of a channel
   which has not yet been added to an image."

The correct way to get rid of the channel is to remove it from the image
using gimp_image_remove_channel().

Salut, Sven
Gimp-developer mailing list

Reply via email to