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.
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:
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.
It works as described, but I can’t even imagine what this functionality would be useful for in Gimp.
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.
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”.