It is currently Thu Mar 28, 2024 10:41 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Scripting GEGL functions
PostPosted: Mon Aug 24, 2020 10:28 pm  (#21) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2231
Location: Poland
Hi Kevin.

Great solutions. :tyspin
Do you have a working example when it comes to choosing a color?
I am doing something very wrong because a tip from Massimo Valentini
"color", gegl.gegl_color_new (b "# 700")
,
does not help.

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue Aug 25, 2020 12:12 am  (#22) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14796
Location: roma, italy
Started using the method kindly provided by Kevin for using GEGL.
Look here: viewtopic.php?f=11&t=18691&start=30
I like much more GEGL c2g !
Thanks again Kevin !

_________________
"Where am I ?"


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue Aug 25, 2020 2:22 am  (#23) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
to specify a color you can use rgb(r,g,b) or rgba(r,g,b,a):
Attachment:
Untitled.png
Untitled.png [ 86.44 KiB | Viewed 4816 times ]


I recommend reading the information in the GEGL Graph dialog:
Attachment:
Untitled1.png
Untitled1.png [ 38.27 KiB | Viewed 4811 times ]


Kevin


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Sun Sep 13, 2020 3:02 pm  (#24) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2231
Location: Poland
A very good solution is presented on the website:
Samj Créations
https://samjcreations.blogspot.com/2020 ... -tres.html

Image

If you want to use gegl_list_all (for me the slashes must be in the opposite direction) this is in the attachment.

@Kevin
Late thanks for the information provided


Attachments:
gegl_list_all.zip [1.5 KiB]
Downloaded 161 times

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Sun Sep 13, 2020 5:27 pm  (#25) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2231
Location: Poland
First tests....
The interesting thing about a plugin is that for it to work, you don't have to enter all its parameters - just the ones you want to change - and the rest are accepted by default.

Image

Image

If You are interested in parameter names and their range, you can find them in * .c files (in the appendix they come from Gegl Version: 0.4.24 - gegl\operations common).


Attachments:
Gegl-operations-common.zip [315.09 KiB]
Downloaded 165 times

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue Sep 15, 2020 12:15 pm  (#26) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2231
Location: Poland
I adapted the plug (a bit) to my needs:
Ver.2 - add: 80 operations, open the result as a layer, Preset in Notepad (separate entry in the menu: Filters/GEGL command & preset ...) with a list of operations (and to save by pasting versions of interesting settings).

Image
Image

Since the gegl.exe executable (Windows) is available in portable versions of Gimp from Samj Creation, but not in the official version of gimp.org - it is also included.
Why there are two fields for custom operations - to compare how changing a specific parameter affects the result (and keep the previous setting).

ps. Samj writes "Gegl_command_line.py" will likely be replaced by a C filter after Python 2 is abandoned.


Attachments:
Mosaic + apply-lens.png
Mosaic + apply-lens.png [ 89.76 KiB | Viewed 4105 times ]
Gegl_command_line V.2.zip [324.61 KiB]
Downloaded 179 times

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue Sep 15, 2020 12:33 pm  (#27) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14796
Location: roma, italy
Is this version callable from a main .py filter?
Does it return the result to the caller?
If yes, could you write a very small example as a guide?
Thanks!

_________________
"Where am I ?"


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue Sep 15, 2020 1:22 pm  (#28) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2231
Location: Poland
Hi Diego.

Usage is simple: :yes
- open any RGB photo *;
- run the plugin from the menu: Filters / GEGL command line ...;
- select the type of operation (80 standard +2 non-standard=Custom);
- select ExportType (PNG or JPEG);
- select how to open image (as a new layers or a new image);
- new images processed by Gegl are saved in the bin folder (and overwritten with);
- when you run ( Filters / GEGL & preset.txt command...) a document will open with a list of all operations and a link where you can find additional ones informations;
- in this I also save interesting settings for Custom;
- the record can be pasted into the plugin Command line GEGL (in Custom-1 or Custom-2)
- 80 operation is run without aditional parameters with default values ​​(there are many more operations in the documentation - but require additional parameters).

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue Sep 15, 2020 1:59 pm  (#29) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14796
Location: roma, italy
What you detailed is how to use it ONLINE
(2.point "run the plugin from the menu: Filters / GEGL command line ...")

I would like to run one filter written by me and -when a gegl operation is required- write something like
.....
outlayer=pdb.python_fu_gegl_command_line (inImage, inlayer, cmd string)
...
then do whatever next I need using outlayer produced by the gegl command line

Is it possible?

_________________
"Where am I ?"


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue Sep 15, 2020 2:17 pm  (#30) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14796
Location: roma, italy
I answer to myself: YES !
#!/usr/bin/env python
from gimpfu import *
def TestGEGLsamj(inImage, inLayer):

    gimp.message ("Hello!")
   
    wrklayer=inLayer.copy()
    inImage.add_layer (wrklayer,0)
    pdb.python_fu_gegl_command_line (inImage, wrklayer, 2, "blabla", "blabla", 0, 0)    # 2= alien map
    outlayer = inImage.layers[0]
   
    gimp.message ("Done!")
    # ...... do what you like on outlayer
   
   
    return

register(
    "TestGEGLsamj",
    "TestGEGLsamj",
    "TestGEGLsamj.",
    "Diego",
    "Diego Nassetti ",
    "2020",
    "TestGEGLsamj",
    "RGB*",
    [
        (PF_IMAGE, "image", "Input image", None),
        (PF_DRAWABLE, "drawable", "Input drawable", None),
        ],
    [
        (PF_IMAGE, "outimage", "Output image", None),
        ],
    TestGEGLsamj,
    menu="<Image>/Diego/Test",
    )

main()


_________________
"Where am I ?"


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Wed May 19, 2021 12:50 pm  (#31) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Hello :)

Here is the paynekj's code converted into a "gegl_command.py" plug-in.
It does not show in any menu, but it enables to code "pdb.python_gegl(theImage, theDrawable, theGeglCommand)".
It's tested on Linux but not on Windows.

EDIT:
That's a (near-)duplicate of gimp-forum.net.
(The file was "fu-python-gegl_ops_test.py". It enabled to code "pdb.gegl_gegl(theDrawable, theGeglCommand)".)
Regardless of the duplication, I suggest to keep "gegl_command.py" that is made up of paynekj's simpler version.
( :oops: Sorry, for the mess.)

==> "gegl_command.py" has to be put in the "plug-ins" directory.


Attachments:
gegl_command.zip [934 Bytes]
Downloaded 307 times

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Last edited by cli345 on Fri Jun 04, 2021 8:49 am, edited 4 times in total.
Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Thu May 20, 2021 3:16 am  (#32) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 12566
Location: Spain, Aragón
cli345, thanks again for your nice plug-ins.
I have windows and it works great in neontext. :tyspin :hi5


Attachments:
Works_in_Windows.jpg
Works_in_Windows.jpg [ 42.62 KiB | Viewed 4200 times ]

_________________
Image

Gimp 2.10.30(samj) portable _ OS Windows 10 Home_ 64bits
Don’t be afraid to start over. It’s a new chance to rebuild what you want.
Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Thu May 20, 2021 3:38 pm  (#33) 
Offline
GimpChat Member

Joined: Apr 19, 2021
Posts: 121
Location: France
Thanks instead to paynekj :tyspin (It isn't my plug-in, I only isolated his code into a file)

Thank you Issabella for your feedback :)

_________________
Photo to cartoon : https://github.com/cl4cnam/gimp_cartoon_plugin


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue May 25, 2021 9:41 am  (#34) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14796
Location: roma, italy
Is there an update of the Gegl-operations-common file posted at #25?
Some operations are missing.
Sorry to ask but I'm unable to find an update by googling, I suppose there is a recent more complete list of the c functions, where to look to see the required parameters.
Thanks.

_________________
"Where am I ?"


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue May 25, 2021 12:54 pm  (#35) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2414
dinasset wrote:
Is there an update of the Gegl-operations-common file posted at #25?
Some operations are missing.
Sorry to ask but I'm unable to find an update by googling, I suppose there is a recent more complete list of the c functions, where to look to see the required parameters.
Thanks.


For what it is worth the GEGL page is back on line. https://gegl.org/operations/ That takes you to individual functions with descriptions and syntax.

For Windows ;)

The samj 2.10.24 no longer includes the file gegl.exe but it is there in the zip on post#25 I works in both samj and regular Gimp 2.10.24
It is worth reading the samj GEGL post on this page https://samjcreations.blogspot.com/2020 ... -tres.html

Example screenshot for functions listing ( --list-all ) and for an individual operation. ( --info gegl:xxxxx) I make 250 operations.

Attachment:
gegl.jpg
gegl.jpg [ 161.44 KiB | Viewed 3799 times ]

_________________
Image


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue May 25, 2021 1:01 pm  (#36) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2231
Location: Poland
https://gegl.org/operations/

Image

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Tue May 25, 2021 1:30 pm  (#37) 
Offline
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14796
Location: roma, italy
Thanks a lot, I will check whether I can find what needed.
In any of my last scripts there are some gegl operations (sometimes I didn't find what I was looking for).

_________________
"Where am I ?"


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Wed Nov 24, 2021 11:10 pm  (#38) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1350
Hey guys. A command like

gegl:layer src=/home/contrast/Pictures/LinkedLayers/share.png

is literally the closest thing to having to a shared shared layer system like photoshop

Image I made a GEGL Graph preset of it but I was wondering if anyone had a better idea to implement this?


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Thu Nov 25, 2021 10:15 am  (#39) 
Offline
GimpChat Member
User avatar

Joined: Oct 31, 2020
Posts: 1350
I would like to show GEGL Graph's ability to live syntax edit text style effects. I wish more Gimp users knew about this as I have been doing this since June 2021 and no longer have to spam multiple drop shadow filters.

https://streamable.com/4p9c1z


Top
 Post subject: Re: Scripting GEGL functions
PostPosted: Thu Nov 25, 2021 3:21 pm  (#40) 
Offline
GimpChat Member
User avatar

Joined: Jul 04, 2019
Posts: 120
Location: Lake Havasu City, Arizona, USA
contrast_,
That was a informative video. Thanks.

_________________
Charles
Hazmat suits are retro.


Top
Post new topic Reply to topic  [ 53 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts I figured out how to hide useless UI functions in GEGL filters.

1

No new posts Eager to learn how to draw pixel functions in GIMP python

2

No new posts Attachment(s) GEGL "Glass over Text' is STAND ALONE BUT NOW PART OF GEGL EFFECTS

5

No new posts Attachment(s) GEGL Bevel (filter of its own but now ships with GEGL Effects)

32

No new posts Attachment(s) About namespaces in GEGL Plugins (old GEGL effects will break)

3



* Login  



Powered by phpBB3 © phpBB Group