It is currently Fri Jun 12, 2026 2:24 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Remove Alpha on all layers
PostPosted: Tue Aug 07, 2018 11:18 am  (#1) 
Offline
New Member

Joined: Aug 07, 2018
Posts: 1
Hello!!! I've been googling and searching like mad for a script that can help me, but sadly I haven't found one. I often edit gifs in gimp, and would like a tool to remove alpha on all layers with alpa on it. I already found one for adding alpa, but the removing part is trickier. Thank you so much to everyone who'll be able to help me x)

//Midnight


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: Remove Alpha on all layers
PostPosted: Tue Aug 07, 2018 12:27 pm  (#2) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
It happens that there is no API for this...

If you want to remove Alpha on all layers, you can use interleave-layers to flatten all your layers on an opaque layer (use the script in "sprite" mode).

But why are you removing the alpha channel?

_________________
Image


Top
 Post subject: Re: Remove Alpha on all layers
PostPosted: Tue Aug 07, 2018 2:20 pm  (#3) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 4469
Location: Canada
Oh oh oh...I know, I know.
You can use my run code on visible layers script

and run this code
if layer.has_alpha: pdb.gimp_layer_flatten(layer)

_________________
TinT
My GIMP 2.10 plug-in writer Fiverr Gig
Plaid Community Forum
Imageplaid-patterns.com


Top
 Post subject: Re: Remove Alpha on all layers
PostPosted: Fri Apr 05, 2019 7:17 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Nov 04, 2015
Posts: 1444
I think trandoductins 'run code on visible layers script' is the only plugin that will do this.
It's a useful plugin for running python commands in Gimp.

You can easily modify the script so it always opens with the remove alpha on all layers command for anyone that wants to do this on many layers.
Just change line 86 like this.

#INPUT BEGINS
(PF_OPTION, "layergroup","Choose on what layers", 1, ["ALL LAYERS","VISIBLE LAYERS","NOT-VISIBLE LAYERS","LINKED LAYERS","NOT-LINKED LAYERS"]),
(PF_STRING, "code", "Code to Run:", "if layer.has_alpha: pdb.gimp_layer_flatten(layer)"),


Top
 Post subject: Re: Remove Alpha on all layers
PostPosted: Sat Apr 06, 2019 1:52 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4812
"pdb.gimp_layer_flatten(layer)" alone is sufficient. Gimp does the necessary sanity checks anyway.

"Good code is not code that works, good code is the minimal code that works".

_________________
Image


Top
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group