[Gimp-developer] easier way to convert image into selection
David Gowers
00ai99 at gmail.com
Thu Sep 14 17:09:59 PDT 2006
On 9/15/06, William Skaggs <weskaggs at primate.ucdavis.edu> wrote:
>
>
>
> From: Alexander Rabtchevich <alexander.v.rabtchevich at iaph.bas-net.by>
>
> >Some plug-ins (edge detection for example) provide images as a result.
> >If their result is required as a selection, I new only one way to make
> >it: create layer mask, copy the image into the mask and convert the mask
> >into selection. Is there a shorter way to do it?
> >
> >More common question: maybe it worth improving such plug-ins with an
> >option "Create selection"?
>
> I don't think so, but it might be nice to have a "layer to selection"
> filter that would create a selection from the gray values of the
> active layer.
>
> -- Bill
Working on it.
It's much easier to code 'image to selection':
c = pdb.gimp_channel_new_from_component(image, GRAY_CHANNEL, 'TEMP
IMAGE2SELECTION')
image.add_channel(c)
pdb.gimp_selection_load(c)
image.remove_channel(c)
gimp.delete(c)
'layer to selection' is:
pdb.gimp_selection_none(image)
buf = pdb.gimp_edit_named_copy(drawable, bufname)
c = pdb.gimp_channel_new(image, image.width, image.height,
bufname, 50.0, (0,0,0))
image.add_channel(c)
fsel = pdb.gimp_edit_named_paste(c, buf, False)
pdb.gimp_floating_sel_anchor(fsel)
pdb.gimp_selection_load(c)
image.remove_channel(c)
gimp.delete(c)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /lists/gimp-developer/attachments/20060914/0c347a92/attachment.html
More information about the Gimp-developer
mailing list