You are here

Python plugin preview option

Hello everyone!

I have made a filter plug-in in Python using python-fu and I wonder if it is possible to make it preview the changes done in the sliders to the active layer or to a new layer in the main window. Is there any tutorial for coding that? If I can understand correctly the GUI can't be anymore automatic (python-fu) but there's a big gap in available tutorials/guides. The only Python plug-in I could find being able to do that preview was "Layer Effects" but with 6000+ lines it is not that easy to digest...

Any help is welcome

Thank you!

John

there is a simpler filter here:
http://www.gimphelp.org/python_fu.shtml

implementing ahigh pass filter with the same preview mechanism as the layer effects python plugin.

Clicking the Preview button run the filter with the current settings in the main image. You can change the value of the sliders, then click the preview button to remove it then re-apply with the new value.

I was playing on my own to get it to update automatically, but the slider widget emits value changed events while being dragged, which is no good. it can be changed to update on release with

set_update_policy(gtk.UPDATE_DISCONTINUOUS)

but....then value of the associated spinbox dopesn't update as you slde the slider (ugh!)

Someone who knows python better may be able to create an autoupdate using timers or something...

There is also som e leftover layer filter code in it, but it is a simpler place to start.

-Rob A>

Thank you very much! That was what I was looking for! I'll take some time to study it...

The page with the working download link is:
http://www.gimphelp.org/scripts/high_end_sharpen_py.shtml

Subscribe to Comments for "Python plugin preview option"