It is currently Sun Jun 30, 2024 12:14 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Access built-in Kaleidoscope with Python
PostPosted: Sat Feb 12, 2022 9:30 am  (#1) 
Offline
GimpChat Member

Joined: Feb 12, 2022
Posts: 6
Hi,

I'm trying to write a python script, that performs a number of steps. Most of them I can already perform, but one of the most important ones I can not access (meaning the kaleidoscope function).
I want to use the Built in Kaleidoscope function from GIMP (which in the GUI I can access via filter -> disturbe -> kaleidoscope) and would like this function in the script as well.
Is there any way (such as pdb.plug_in_mosaic(variables, variables) for the Gimp native kaleidoscope?
Any help is much appreciated.

Using Windows 11 & GImp 2.10

Many thanks in advance


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Access built-in Kaleidoscope with Python
PostPosted: Sat Feb 12, 2022 4:57 pm  (#2) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
Ever since the arrival of GIMP 2.10, a lot of GIMP 2.8 filter/plugins were omitted. GIMP 2.10 works with Gegl plugins and there is not a PPB for gegl plugins. You can use G'MIC to call the 4 different style of Kaleidoscopes.
pdb.plug_in_gmic_qt(image, layerName, 1, 0, "command")

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Access built-in Kaleidoscope with Python
PostPosted: Sat Feb 12, 2022 8:57 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2260
Location: Poland
Hi Gimpquestion.

Since You started writing the python plugin, you can probably do it by using the sample code
https://www.gimpscripts.net/2021/11/pattern-editor.html
Good luck coding.


Attachments:
Kaleidoskope.jpg
Kaleidoskope.jpg [ 51.97 KiB | Viewed 774 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Access built-in Kaleidoscope with Python
PostPosted: Sun Feb 13, 2022 7:05 am  (#4) 
Offline
GimpChat Member

Joined: Feb 12, 2022
Posts: 6
Thanks for the answers already.

@MareroQ - this seems as it requires interaction with a GUI.
I want to automatically apply the same filter (with same specifications) to a large number of images in a for loop.


@Pocholo THis seems promissing, but I don't have the G'MIC plug in? Where can I get this?
To clarify for myself: Does this enable me to interact with the Built in GEGL Kaleidoscope, which i find in "Filter -> Distortion", or rather with the fractal explorer?

Many thanks in advance!


Top
 Post subject: Re: Access built-in Kaleidoscope with Python
PostPosted: Sun Feb 13, 2022 7:48 am  (#5) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1196
For the G'MIC plugin download go to https://gmic.eu/ Click on the download tab and choose download. Choose the ".exe" Windows platform. Install it, and restart GIMP. You'll find it in the menu "Filter" down at the bottom. Once you open G'MIC, Click on: Deformation> and there are three kind.

There is no Pocedure for the "Gegl" internal plugins. Like MareroQ stated, you can extract the function from the plugin he created mention on prior post.

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Access built-in Kaleidoscope with Python
PostPosted: Mon Feb 14, 2022 7:18 am  (#6) 
Offline
GimpChat Member

Joined: Feb 12, 2022
Posts: 6
Thanks!
If I call the command as outlined, nothing happens (instead of command I entered "Kaleidoscope [Polar]" but I get a run time error message. Probably, because i have to transfer the parameters, that apply to it?
Can you give me a pointer as to how that is done/ where I can find the documentation for that. I went a little bit through the documentation of G'MIC, but didnt find pointers on how that is actually accomplished in the Python-Skript.

Thanks again!


Top
 Post subject: Re: Access built-in Kaleidoscope with Python
PostPosted: Mon Feb 14, 2022 9:56 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 27, 2016
Posts: 345
Location: Germany, BW
From one of Pocholo's plugins:
for example:
pdb.plug_in_gmic_qt(img,refLayer,1,0,"fx_spherize 31,2.5,0,64,34,0,9,0,0")

img - the image you work on
refLayer - the layer
1,0 - in and output options of GMIC
and the action string.

_________________
Regards
nelo

(Gimp 2.10 on Linux Mint MATE 20.1)


Top
 Post subject: Re: Access built-in Kaleidoscope with Python
PostPosted: Fri Feb 18, 2022 3:43 am  (#8) 
Offline
GimpChat Member

Joined: Feb 12, 2022
Posts: 6
Thanks that helped :)

Maybe a followup on GIF Animation via scripting.
I tried a very simple setup with the python script:
png file is loaded as image
pdb.script_fu_waves_anim(image, image.active_layer, 30, 35, 10, 0)
image = pdb.plug_in_animationoptimize(image, image.active_layer)
pdb.gimp_image_convert_indexed(image, 0, 0, 255, 0, 1, '')
pdb.file_gif_save(image, image.active_layer, '1.gif', '1.gif', 0, 1, 10, 1)
while str write is declared as a string specific string

Is there an apparent reason, why the .gif file is returning empty/ with 0 bytes?


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Permission to access folder SOLVED.

2

No new posts A way to allow GIMP access to removable media - MacOS 10.15

4

No new posts Kaleidoscope & Mandala Art

19

No new posts Slow Change Kaleidoscope

7

No new posts Make a key binding to access third party GEGL Operations faster

1



* Login  



Powered by phpBB3 © phpBB Group