It is currently Fri Apr 19, 2024 7:49 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 9:33 am  (#1) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
A request for script writers. Is it possible to write a script to add an alpha channel to all layers that don't have one?

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


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: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 9:54 am  (#2) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
Yes, I think it would be possible. Not that hard either.


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 10:04 am  (#3) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
def py_add_alpha(img, drawable):
 
  layerlist = img.layers
 
  for l in layerlist:
     if not l.has_alpha:
        pdb.gimp_layer_add_alpha(l)


just needs register, etc.


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 10:09 am  (#4) 
Offline
GimpChat Member

Joined: Mar 29, 2011
Posts: 346
Location: Wisconsin
Or if you prefer a script:
Attachment:
all-layers-add-alpha.scm [1.5 KiB]
Downloaded 2107 times

The script will be found in
Layer > All Layers > Add Alpha to All Layers

_________________
Image


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 10:10 am  (#5) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
ok, here it is

http://www.fileden.com/files/2010/2/7/2 ... d_alpha.py

damn, fastposted. This one is in filters->alpha to all...


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 10:14 am  (#6) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Thank you dd. I don't know how to add a register. Will it show up in GIMP as it stands?

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 10:15 am  (#7) 
Offline
Script Coder

Joined: Apr 10, 2011
Posts: 532
No, but I made a complete plugin for you, here

http://www.fileden.com/files/2010/2/7/2 ... d_alpha.py


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 10:19 am  (#8) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Thanks dd and bkh1914.

Scripts for Python and non-Python users.

How cool is that?! :bigthup

I'll give them both a try.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Mon May 09, 2011 10:36 am  (#9) 
Offline
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
Location: Somewhere in GIMP
Both work perfectly.

Dd, I moved yours to "<Image>/Layer/Alpha to all..."

Thank you both very much!

Didn't even have to do a rain dance. Sun is shining here. :hexer

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Sun Jan 24, 2021 12:09 am  (#10) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 12516
Had a need for this (about to do a photo collage for Hank Aaron). The python isn't detected but the Script-fu works great and I appreciate it. Still, GIMP is very slow at importing layers and exporting layers (ouch). lol

:)

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Add Alpha Channel to All Layers
PostPosted: Sun Jan 24, 2021 5:43 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1825
No need for this script any more Lyle, just change the default settings to what they should've been all along....

Attachment:
alpha-channel.png
alpha-channel.png [ 110.23 KiB | Viewed 1241 times ]


Top
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Add Alpha Channel to All Layers

1

No new posts Attachment(s) Alpha Channel not working

7

No new posts Attachment(s) Colorizing (only) with a Radial Gradient/ Alpha Channel

8

No new posts Eraser painting on layer that has alpha channel

2

No new posts Attachment(s) How does it works on Layer Blending Mode "Add" with Alpha Channel?

4



* Login  



Powered by phpBB3 © phpBB Group