Sample programs of Python script

I made a sample program of Python plug-in using gimp:threshold filter non-destructively. I upload it here for other programmers’ reference.
We cannot use gegl:threshold non-destructively, so we must use gimp:threshold in place of it.

2 Likes

Thank you very much for sharing a great example. This is a “higher shelf” than a regular plugin, because it provides a so-called “live preview”.

Only cosmetically (for Gimp theme support) one line is missing:

Test Treshold

1 Like

Thank you for your information. I didn’t know it.

I made second sample program. This program creates Text boxes using Gtk.Enty.

If you input any text, the program shows the input text under the boxes. In “Numeric Box”, you can only input numbers.

1 Like

It works as described, but I can’t even imagine what this functionality would be useful for in Gimp. :roll_eyes:

I find the default color>threshold function useful for B&W mask creation and also for analyzing fast Fourier transforms.

My question was about the second example, i.e. UI_sample01.py

I only saw a comment, not a question.

So I’ll ask. Do you have any suggestions for using the second example???

Sorry, I don’t speak Python.

Most GIMP 2.10 Python programmers solely depend on gimp-fu to create UI of their program. However, gimp-fu was gone in GIMP 3.0. So, I suppose, when they try to rewrite their programs for GIMP 3.0, they will be embarrassed in UI creation.
I think it would be useful for these programmers to show simple UI creation examples. I would like to achieve something similar to what Akkana Peck has done in pyui.py in GIMP 2.10.

1 Like

This program is not intended to add new function. Its aim is to show the example how to write Python program using non-destructive filter.
So I named this thread “Sample programs of Python script”.

1 Like

I made third sample program. This program creates combo box using Gtk.ComboBoxText.

1 Like

This last example: UI_sample02.py allowed me to partially understand the use of UI_sample01.py.

I also published something: I collected (from different examples) in one file Show_Widget_Options.py.

It would be cool if you published Your plugins on GimpChat as well.

1 Like

Thank you for your post. I would welcome other’s sample program post.

I have updated UI_sample01.

I have made forth sample program. This is interactive sliders sample. If you move one of the sliders, other sliders will move accordingly.

I have renewed UI_sample03.py. The download link is below.

1 Like