It is currently 27 Jan 2022, 14:00

• Featuring Members' Images •
Could be related to 'Color to Alpha on (Visible/Linked/or Whatever) Layers'
oldmangrumpy
GIMPER
Krikor
Krikor
oldmangrumpy

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Color to Alpha on (Visible/Linked/or Whatever) Layers

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger
1st Place
5775 Post(s)

Color to Alpha on (Visible/Linked/or Whatever) Layers

Post#1 by tim » 17 May 2019, 22:47


Requested by Wallace here.
This plug-in will allow you to turn all layers (invisible/visible or linked/unlinked)
to apply apply Color to Alpha to them.
If layers current do not have alpha channel, it'll be added.
c2a_alllayers.py #
Color to Alpha on Visible layers.
(3.48 KiB) Downloaded 586 times
Plug-in Menu Location: Python-Fu/Color to Alpha on Visible Layers

Instructions:
  1. Open your image with multiple layers.
  2. Run plug-in, select what type of layers you want to apply to, Select color (to apply Color to Alpha).
  3. That's it. If layer currently do not have alpha channel it'll be added in order for Color to Alpha to work.
aka Tin
World Food Program | Good Deeds Forum

         

Pat625
Tutorial Creator
2nd Place
4514 Post(s)

Post#2 by Pat625 » 17 May 2019, 22:56


You are so quick with this script writing, Tin. I am amazed!

tim
GL Blogger
1st Place
5775 Post(s)

Post#3 by tim » 17 May 2019, 23:34


Cut and paste Pat. It's all cut and paste.
aka Tin
World Food Program | Good Deeds Forum

         

Wallace
Global Moderator
14th Place
906 Post(s)

Post#4 by Wallace » 18 May 2019, 00:18


:thank_you:
Image

nidhogg
Forum Member
27th Place
76 Post(s)

Post#5 by nidhogg » 18 May 2019, 14:38


Yesterday...all my scripts were swiftly swept away...oh I believe in...gimp oh yay.
Wouldn't have posted this,
but...yesterday. I actually made a "dramatic" decision to finally dump all the .scm scripts. Some coders have been saying it for a long time, that scm is deprecated format and I see only python plugins being created anymore.
But these were in my 2.8 storage folder, made by fencepost around 2009.
Yesterday.png
Yesterday.png # (60.83 KiB) Viewed 8037 times (Thumbnail | Recognize | Sq Tile | LNFI)
Then there is this, multiple layer actions:
https://gimpchat.com/viewtopic.php?f=9&t=9446

Probably needs a fix for 2.10.

I remember a third one, but I'm too drunk to search for it. :lol:

Always good to have .py, thank you Tim.
GIMP Learn rocks...

rich2005
GIMP Guru
22nd Place
179 Post(s)

Post#6 by rich2005 » 18 May 2019, 15:06


I would keep your old script-fu's ;)
Put them in an archive "just-in-case". One thing that is still possible with script-fu that python is not able, is load on-the-fly.

Image

Using Ofnuts resource mangaer, this my "might need sometime" collection and look at that, a C2A for all layers, no need to reinvent the wheel. Although to be fair, it is old and maybe not as comprehensive as tin's

nidhogg
Forum Member
27th Place
76 Post(s)

Post#7 by nidhogg » 19 May 2019, 18:00


Yeah that's actually better just-in-case, decided to zip em after all, when I woke up with a sober human head. I just want to get cleaner interface and there were so many old scripts that have either exactly same function or work similarly than the newer python plug-ins.
Oh you've put all the resource manager entries in same place, that's neato.
GIMP Learn rocks...

jiri.etwas
Newly Registered
135th Place
1 Post(s)

Post#8 by jiri.etwas » 29 Dec 2020, 20:48


Hi, awesome script. However, how do you add to set the opacity threshold to 0? The script has some default opacity threshold tolerance which messes up my animated gif.

How do I add opactiy threshold = 0 to this line? Would you know? Thanks and happy new year
(PF_COLOR, "color","Color To Alpha", (255,255,255))
GIMP Learn rocks...

tim
GL Blogger
1st Place
5775 Post(s)

Post#9 by tim » 30 Dec 2020, 14:00


The line you're looking at is the parameter definition for plug-in not code that runs color to alpha
the code line that runs color to alpha is
pdb.plug_in_colortoalpha(image,layer,color)
but there seems to be no way to set opacity threshold as the call doesn't have anything related to that.
aka Tin
World Food Program | Good Deeds Forum

         

RJKD
Tutorial Creator
6th Place
1973 Post(s)

Post#10 by RJKD » 31 Dec 2020, 19:19


This is going to be useful, thanks T.


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 15 guests