Gimp-Forum.net
color to alpha - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: color to alpha (/Thread-color-to-alpha)



color to alpha - trandoductin - 12-04-2019

need help python plug-in
I am trying to help someone on my forum to automate some steps
and one of the steps is colortoalpha
so I used
pdb.plug_in_colortoalpha(image,active_layer,color) but it isn't producing the same result as doing it from front end.

but if you do it through the front end there are two other settings one of which is the transparency threshold.

How do I perform the same settings as the front end specifying those 2 extra settings in addition to color?

Thanks in advance.


RE: color to alpha - Ofnuts - 12-04-2019

The 2.10 frontend uses a new GEGL plugin. If you want/need to use the 2.8 API, there is likely some preprocessing involved to emulate the two settings.


RE: color to alpha - trandoductin - 12-04-2019

so there's no way to call GEGL plugin?
or is there a way?
Sorry, I know nothing about GEGL or how to call it from existing python plugins.


RE: color to alpha - rich2005 - 12-04-2019

I think it is broken, shortly before 2.10.14 was released there was a rush of procedures aimed at replicating / replacing the old discrete compiled plugins. For colortoalpha see:
https://github.com/GNOME/gimp/blob/5d79fba8238a27b8691556489898d33b3fa0dda0/pdb/groups/plug_in_compat.pdb
starting line 762

Then GEGL its self, running in the GEGL graph terminal colortoalpha works providing I do not specify a colour. Good for white only, or has the syntax changed?

bah humbug. Whole thing is a screw-up


RE: color to alpha - Blighty - 12-04-2019

Also be aware that Color To Alpha has changed from 2.8 to 2.10

Open an image.
Put a white layer below.
Do Color To Alpha on the image. first in 2.8 (or 2.10 legacy); then in 2.10 default using the default white.