On 9/15/06, William Skaggs <[EMAIL PROTECTED]> wrote:


From: Alexander Rabtchevich <[EMAIL PROTECTED]>

>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)


_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Reply via email to