Help to implement a G'MIc command on a Krita script

Hello,

I need to use a gmic filter into a Krita Phyton script and I don’t know how exactly works.

for example:


from krita import *

application = Krita.instance()
currentDoc = application.activeDocument()
currentLayer = currentDoc.activeNode()

gmic_command = “syntexturize_matchpatch 1080,1080,6,5,5,1,0,0,50,50”

gmic.run (gmic_command)

Krita.instance().activeDocument().refreshProjection()


Can anybody say how it works or tell me where find the needed tutorials or manuals?

Thanks

Hi @Knytzor

I’m not sure it’s possible to call G’Mic filter from Krita scripting.

The only way I see is to execute G’Mic from Krita scripting is to try load gmic library using ctypes and start to work with low-level function provided by library (I think it’s possible but I didn’t tested it)

The way to do it might change if you’re working on windows or linux.

Another solution is to install G’Mic as a standalone program and do stuff through command line executions driven from a script…

Grum999

Thanks for your Answer Grum999.

Sounds very interesting.

The thing is GMIC has a button where allows you to copy the command to implement it on a script. The thing I need to know is how to use it to apply this kind of filter to several images or folders faster.

If you yo have any idea to how to implement this GMIC filter in a plugin o extension allowed by Krita, please tell me.

Thans in advance

It does sound like you need to learn how to drive G’Mic from the command line. There’s lots of documentation for it and forums for advice.

Thanks Ahad!
Can you guide me where please?

Here’s the launchpad for the wonderful world of G’Mic:
https://gmic.eu/

The ‘Resources’ and ‘Community’ Links at the top will probably be very useful to you.

2 Likes