GIMP Chat http://gimpchat.com/ |
|
How to make plugin run faster http://gimpchat.com/viewtopic.php?f=9&t=18473 |
Page 1 of 1 |
Author: | Pocholo [ Thu Jun 18, 2020 8:43 pm ] |
Post subject: | How to make plugin run faster |
Hi guys, I hope everything is fine with all. I made a text effect python script using LayerFx.py filters but the script runs on about 30 seconds on a 100 px size text. Is there any way to make this script faster? Thanks in advanced and be safe! |
Author: | MareroQ [ Fri Jun 19, 2020 12:06 am ] |
Post subject: | Re: How to make plugin run faster |
Hi Pocholo. Only small suggestions. It may not be the easiest solution, but try to find the right piece of code in the layerfx.py file, analyze it and use (paste) in the new code. Layerfx.py contains about 6570 lines of code, but a significant part is related only to the preview function (using gtk, which slows down the execution). It is possible that it will be easier to parse the layerfx.scm code (this is only about 1485 lines of code). The adaptation will also have the advantage that it will work for users who do not have the layerfx.py file installed. |
Author: | paynekj [ Fri Jun 19, 2020 1:54 am ] |
Post subject: | Re: How to make plugin run faster |
If you tell us what you are trying to achieve, we may be able to suggest a quicker way of doing it. Kevin |
Author: | ofnuts [ Fri Jun 19, 2020 2:51 am ] |
Post subject: | Re: How to make plugin run faster |
Post the bloody code already. ![]() |
Author: | dinasset [ Fri Jun 19, 2020 4:05 am ] |
Post subject: | Re: How to make plugin run faster |
MareroQ wrote: Hi Pocholo. ... Layerfx.py contains about 6570 lines of code, but a significant part is related only to the preview function (using gtk, which slows down the execution). It is possible that it will be easier to parse the layerfx.scm code (this is only about 1485 lines of code).... ...I'm sure that -if Ofnuts will spend a bit of his summer vacation on this subject- his python version of layerfx would be less of 1000 lines of code. |
Author: | ofnuts [ Fri Jun 19, 2020 4:22 am ] |
Post subject: | Re: How to make plugin run faster |
dinasset wrote: MareroQ wrote: Hi Pocholo. ... Layerfx.py contains about 6570 lines of code, but a significant part is related only to the preview function (using gtk, which slows down the execution). It is possible that it will be easier to parse the layerfx.scm code (this is only about 1485 lines of code).... ...I'm sure that -if Ofnuts will spend a bit of his summer vacation on this subject- his python version of layerfx would be less of 1000 lines of code. Yes, but nobody would understand how to use it ![]() |
Author: | rich2005 [ Fri Jun 19, 2020 5:32 am ] |
Post subject: | Re: How to make plugin run faster |
Now why would anyone think that ![]() Attachment: fx.jpg [ 170.84 KiB | Viewed 7398 times ] |
Author: | mahvin [ Fri Jun 19, 2020 7:02 am ] |
Post subject: | Re: How to make plugin run faster |
Rich, you forgot (requires at least two paths for it to run and you know where they go, figure it out). |
Author: | ofnuts [ Fri Jun 19, 2020 7:05 am ] |
Post subject: | Re: How to make plugin run faster |
rich2005 wrote: Now why would anyone think that ![]() Attachment: fx.jpg Node-based editing at its finest ![]() |
Author: | mahvin [ Fri Jun 19, 2020 7:09 am ] |
Post subject: | Re: How to make plugin run faster |
ofnuts wrote: rich2005 wrote: Now why would anyone think that ![]() Attachment: fx.jpg Node-based editing at its finest ![]() Now I'm going to open all of your files and check for Easter eggs. |
Author: | Pocholo [ Fri Jun 19, 2020 7:50 am ] |
Post subject: | Re: How to make plugin run faster |
Thank you for your quick responds, here is the code: Code: Select all #!/usr/bin/env python |
Author: | ofnuts [ Fri Jun 19, 2020 8:50 am ] |
Post subject: | Re: How to make plugin run faster |
Since you are working on a new image, you can disable undo: pdb.gimp_image_undo_disable(image)/pdb.gimp_image_undo_enable(image). Otherwise since you are mostly calling LayerFX functions, either you find a way to obtain the same results without piling up effects, or you look at the LayerFx code and steal the relevant bits. |
Author: | MareroQ [ Wed Aug 12, 2020 7:23 am ] | ||||
Post subject: | Re: How to make plugin run faster | ||||
Hi Pocholo. I quickly needed such an effect so I added the Filters / Alpha to Logo / Hulk efect by Pocholo option ... You didn't add a download package - so I add. I hope you won't be offended by the attention: maybe you will add this option to your other plugins? The speed of execution is acceptable - I know much slower ones.
|
Author: | Pocholo [ Wed Aug 12, 2020 8:00 am ] |
Post subject: | Re: How to make plugin run faster |
No a problem my friend. I'm rather flatter by using my script to improve it. Thanks ![]() ![]() |
Page 1 of 1 | All times are UTC - 5 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |