GIMP Chat http://gimpchat.com/ |
|
Help with pdb.plug_in_displace when using python-fu http://gimpchat.com/viewtopic.php?f=9&t=18057 |
Page 1 of 1 |
Author: | i-regular [ Tue Feb 25, 2020 3:52 am ] |
Post subject: | Help with pdb.plug_in_displace when using python-fu |
I'm trying to write a plugin for realistically blending tattoos to facial images, but I am unable to get any effect when using pdb.plug_in_displace in version 2.10 of GIMP. Note, that the displacement works if I manually go to Filters -> Map -> Displace and uses the same tattoo image and displacement map. A sample of my code is given below: Code: Select all img = gimp.Image(width, height) Any suggestions to why the displacement (in the last line of the code above) has no effect - is really appreciated Thanks! |
Author: | MareroQ [ Tue Feb 25, 2020 4:43 am ] | ||
Post subject: | Re: Help with pdb.plug_in_displace when using python-fu | ||
Hi i-regular. You used the wrong number of parameters - lack: run_mode=...... Code: Select all pdb.plug_in_displace(img, tattoo_layer, 10, 10, True, True, disp_drawable, disp_drawable, 2, run_mode=RUN_NONINTERACTIVE)
|
Author: | i-regular [ Tue Feb 25, 2020 5:04 am ] |
Post subject: | Re: Help with pdb.plug_in_displace when using python-fu |
Thanks - I forgot to tell that I was running the plugin from within GIMP, so I believe in that case I do not need to specify the run-mode? But, I will need to run it later from batch, so thanks for pointing out! I found the issue. There seems to be an error in version 2.10.14 of GIMP where the procedure does not work. I just upgraded to version 2.10.18 and now it seems to work also without specifying the run-mode i.e. with no modifications to the code above. Also I tried version 2.8.22 of GIMP where it also works! Anyhow thanks for the help - I really appreciate it! |
Author: | ofnuts [ Tue Feb 25, 2020 7:47 am ] |
Post subject: | Re: Help with pdb.plug_in_displace when using python-fu |
MareroQ wrote: Hi i-regular. You used the wrong number of parameters - lack: run_mode=...... Code: Select all pdb.plug_in_displace(img, tattoo_layer, 10, 10, True, True, disp_drawable, disp_drawable, 2, run_mode=RUN_NONINTERACTIVE) You never *need* that run_mode parameter. It's a named parameter because it is optional in the Python API (and defaults to RUN_NONINTERACTIVE, so you typically only use it with RUN_INTERACTIVE). The doc mentions it because the Python doc is built from the Scheme one, but there are mappings between the Python and Scheme. |
Author: | MareroQ [ Tue Feb 25, 2020 10:07 am ] |
Post subject: | Re: Help with pdb.plug_in_displace when using python-fu |
Quote: ... the Python doc is built from the Scheme one, but there are mappings between the Python and Scheme This is what I understand now why in script-fu this is the first parameter and in python the last - if needed (because erroneously indicated in the Python Procedure Browser also as the first by stupid analogy). Thanks for the clarification. |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |