It is currently Fri Oct 20, 2017 10:10 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: [SOLVED] I need a script to convert a layer in a layer mask
PostPosted: Mon Feb 27, 2012 7:47 pm  (#1) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5872
GIMP Version: 2.7.5
Operating System: Windows
OS Version: XP - SP3
GIMP Experience: Basic Level



I forgot it!
i have a bw image that i need to paste as layermask...should be simple but i am stuck i even look the help but didn't helped much :gaah

PS i loaded the image i want copy as layermask as layer, it has same size of the other layer

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Last edited by PhotoComix on Thu Mar 22, 2012 1:43 pm, edited 2 times in total.

Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 7:53 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5872
i see but is cumbersome:
i entered in quickmask mode
pasted over the quickmask,
then saved as a channel,
then finally transferred as layermask

i remember was a script maybe from saulgoode to avoid this but i can't see in his site

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 8:39 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 3664
PhotoComix wrote:
i see but is cumbersome:
i entered in quickmask mode
pasted over the quickmask,
then saved as a channel,
then finally transferred as layermask

i remember was a script maybe from saulgoode to avoid this but i can't see in his site

Sightly simpler:
- Open as layer
- Make it the only visible (already the case if on top and as big as the image)
- Drag any of the RGB color channels down in the general channels list
- Delete layer
- Init layer mask to this channel

_________________
Image


Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 8:54 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
PhotoComix wrote:
i see but is cumbersome:
i entered in quickmask mode
pasted over the quickmask,
then saved as a channel,
then finally transferred as layermask


A bit easier:
    Enter Quickmask
    Paste
    Exit Quickmask (your pasted layer is now the selection)
    Add Layer Mask initialized to "Selection"

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 9:06 pm  (#5) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5872
yes that is quicker

Quote:
Add Layer Mask initialized to "Selection"


I am wrong or i may initialize the layermask only when i creating it ?

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 9:10 pm  (#6) 
Offline
GimpChat Member

Joined: May 16, 2010
Posts: 13982
Location: USA
Cant you just create a new layer add a mask and select the other layer and copy and paste the layer into the mask?
Jolie actually has a tutorial on this at her YouTube channel. :) (the remove bg tutorial)


Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 9:15 pm  (#7) 
Offline
GimpChat Member
User avatar

Joined: Mar 02, 2011
Posts: 1852
Location: Michigan
easiest way yet ask at gimp chat get 4+ different ways to do one thing :D
it always amazes me how many ways one thing can be done in gimp

_________________
Image
I'm back I think


Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 9:29 pm  (#8) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5872
Rod wrote:
Cant you just create a new layer add a mask and select the other layer and copy and paste the layer into the mask?
Jolie actually has a tutorial on this at her YouTube channel. :) (the remove bg tutorial)


that was what i planned but copy and paste on the layermask doesn't work (that just create a floating selection)

Ofnuts and Saulgoode suggestions simplify the process, ..still i would prefer direct copy and paste

but at least now i may do quickly

PS
Saulgoode i am wrong or you wrote (maybe years ago for a previous gimp version) a sort of "paste as layermask" script (name was different but that was the main function )

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Mon Feb 27, 2012 10:59 pm  (#9) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
PhotoComix wrote:
PS
Saulgoode i am wrong or you wrote (maybe years ago for a previous gimp version) a sort of "paste as layermask" script (name was different but that was the main function )

I probably did, way back when. Rather than revisit that, here is a script which might simplify your task a little while being a bit more general in its utility.

It is largely based upon the GAP's "Copy layer mask from layer above" function in the Frames Modify command.

Here is the description:

;; This script adds a layermask to the active layer based upon
;; the layermask of the visible layer above it in the layer stack.
;; Specifically,
;;   If the active layer already has a mask, it is replaced.
;;   If the above layer has a mask, that mask is added to the active layer.
;;   If the above layer does not have a mask, a grayscale copy of the
;;     above layer is added as a mask to the active layer.
;;   If there is no visible layer above the active one, a mask is added
;;     initialized from the selection (avoiding the dialog popup).


The command, "Copy Layer Mask From Above", is added to both the "Layer->Mask" menu and the Layers context menu (that appears when you right-click on a layer).

With this script installed, you could dragon drop your mask layer from the other image onto the target image, placed above the layer to which it is to be added as a mask. You will have to remove the layer (or hide it) after running the script so it doesn't save that many steps, but I think it is generally an approach that should prove useful in other situations (I have used a similar script for a few years now -- for some reason I find copy-n-paste to be a bit tedious).

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Last edited by saulgoode on Tue Feb 28, 2012 4:31 am, edited 1 time in total.

Top
 Post subject: Re: How copy a layer as layer mask
PostPosted: Tue Feb 28, 2012 12:33 am  (#10) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4694
Location: Bendigo Vic. Australia
Saulgoode Ive been watching this thread becouse I to had this problem with a folder full of layer masks I found difficult to use. Your script works a treat.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Batch script: add a predefined image layer, set layer mode, export.

7

No new posts Layer Mask

2

No new posts Script-fu add a layer from one image to another as a layer?

5

No new posts Attachment(s) [DECIDED TO BE IMPOSSIBLE] Convert a layer to an image's Alpha Channel

2

No new posts All Layer Boundaries to cropped layer HEIGHT request

5



* Login  



Powered by phpBB3 © phpBB Group