GIMP Chat http://gimpchat.com/ |
|
Difference between "Python-Fu" and "Python" plugin http://gimpchat.com/viewtopic.php?f=9&t=18401 |
Page 1 of 1 |
Author: | Herbie [ Sun May 31, 2020 9:25 am ] |
Post subject: | Difference between "Python-Fu" and "Python" plugin |
A year ago, when it came to writing GIMP plugins, I was a real "NEWBIE". In the meantime I have been working intensively on programming GIMP plugins with Python, C and C++. There is a lot of information on the Internet about GIMP, plugins and Python. These are so different and not always correct, so that a beginner easily loses interest to do plug-in programming. To prevent this from happening, I would like to help a little other newbies and beginners. At the start of my plugin programming, I kept asking myself what is the difference between a Python-Fu and a "real" Python plugin. I would like to explain this below. By the way, the term "real Python plugin" does not come from me. I would rather say "Python-Fu" and "Python" plugin. A "Python-Fu" plugin without GIMP functionality looks roughly as follows: Code: Select all #!/usr/bin/python A ("real") Python plugin without GIMP functionality roughly looks like this: Code: Select all #!/usr/bin/python At first glance, you get the impression that everything is much more complicated. This may be the case initially, but the programmer has a lot more freedom in designing the surface. I decided to use this variant. For testing, creates the two plugins "HN-Gimp-Plugin-PythonFu.py" and "HN-Gimp-Plugin-Python.py" with the codes and copies them into the private "plug-ins" directory (under Windows "C:\Users\<user name>\AppData\Roaming\GIMP\2.10\plug-ins"). After starting GIMP and creating a new image with File -> New... you start both plugins one after the other using Filters -> Shapes Examines the content and functionality of the plugins. Especially look at the differences in the code. If you call Help -> Plug-in Browser in GIMP, then type "HN" in the search field and select the displayed plugins one after the other, you should above all compare the TOP line in the right window of the plugin browser. In the meantime, I have written my own module with many methods that make writing a Python and C++ plugin much easier. If you wanted to examine a fully programmed "real" Python plugin, I recommend my "HN: Draw arrow" plugin (viewtopic.php?f=9&t=17084). By the way: I create and test my Python plugins under "Windows 10" using the free development environment "Microsoft Visual Studio Community 2019, Version 16.5.4". If you have any questions or need further help, I will be happy to assist you. Greetings Tscheppo |
Author: | Skinnyhouse [ Mon Jun 01, 2020 3:15 pm ] |
Post subject: | Re: Difference between "Python-Fu" and "Python" plugin |
Thanks Herbie! As someone who has not ventured outside the Gimp plug-in safety net I found this very interesting. |
Author: | yaohaonanc [ Wed Jun 09, 2021 3:09 am ] |
Post subject: | Re: Difference between "Python-Fu" and "Python" plugin |
Hello。I would like to ask a few questions: 1, if the GIMP's Python plugin can be written in Python3. 2. I want to use Python's NumpY and CV2 in my plugin. If I can use, what should I use, how can I not, how do I make matrix operations in the plugin? Please,thank you |
Author: | ofnuts [ Wed Jun 09, 2021 11:15 am ] |
Post subject: | Re: Difference between "Python-Fu" and "Python" plugin |
With Gimp 2.10, this is Python2. Gimp v3 is moving to Python3. You can use Numpy in Python v2, but you have to install it for the Python runtime used by Gimp, which can be a bit complicated if you are using Windows, or a flatpak/snap package on Linux. See https://www.gimp-forum.net/Thread-Gimp-python-and-numpy |
Author: | ecs1749 [ Wed Sep 29, 2021 6:48 pm ] |
Post subject: | Re: Difference between "Python-Fu" and "Python" plugin |
For the "Python" plugin, there is no reason that the code has to be started by GIMP. It should be possible to do it the other way around. I should be able to start the code with Pyscripter or the Wing debugger and start GIMP from the plug-in code. This would give me far better debugging capability, wouldn't it? I see that there is an entire Python 2.7 in the Python directory. I should be able to place any python package in site-package and load it from the plug-in. This is going to be fun!!! Using GIMP as a graphic editing package, much like matplotlib for python |
Author: | ecs1749 [ Wed Sep 29, 2021 7:58 pm ] |
Post subject: | Re: Difference between "Python-Fu" and "Python" plugin |
ok. This is interesting: https://stackoverflow.com/questions/819 ... o-it%20%29 |
Author: | ofnuts [ Thu Sep 30, 2021 2:00 am ] |
Post subject: | Re: Difference between "Python-Fu" and "Python" plugin |
ecs1749 wrote: Also: https://stackoverflow.com/questions/444 ... 0#44435560 |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |