This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Remote / Headless Batch Processing

Tags: None
(comma "," separated)
bradfordsmith
Registered Member
Posts
4
Karma
0

Remote / Headless Batch Processing

Sun Aug 18, 2019 1:44 pm
Is it possible to do remote / headless batch processing with Krita?
Will it take a python startup script as a boot argument?
If not.. is it possible to run Krita without the ui, or will the plugin API be able to close the application after the batch process is complete?

Thanks!
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
The kritarunner application exists for that. On Unix, you might still need a X server because of things like font handling.
bradfordsmith
Registered Member
Posts
4
Karma
0
Indeed, that's what I'm looking for! Thank you. are there any examples / documentation on kritarunner anywhere? I haven't been able to find much.

To test it out, I wrote a simple png exporter, that works from inside of the UI / scripter. When I try to run via Kritarunner it doesn't seem to run. So I had two questions based on some investigation.
  • Does "-s" option expect a module name for import, or an absolute path to a python file? "--help" doesn't seem to make that clear.
  • Someone else mentioned "DebugView", as a way to check output / errors with Kritarunner possibly. Is there any information on how to get that working?

thanks so much!
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
Note that for simple export or file conversion, krita has its own commandline arguments.

Kritarunner expects a module name, but there's open wish bug to change that, so that part hasn't been documented yet -- and I haven't had time to work on the tool myself.

Debugview is a windows utility for checking stdout and stderr: https://docs.microsoft.com/en-us/sysint ... /debugview -- just start it before running krita or kritarunner.
User avatar
scottpetrovic
Registered Member
Posts
520
Karma
4
OS
I am not sure if this is what you are asking about, but the only command line stuff I see for executing Krita stuff is here

https://docs.krita.org/en/reference_man ... and%20line

I am not sure about it plugging into python stuff though.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
scottpetrovic wrote:I am not sure if this is what you are asking about, but the only command line stuff I see for executing Krita stuff is here

https://docs.krita.org/en/reference_man ... and%20line

I am not sure about it plugging into python stuff though.


Yes, that doesn't cover the kritarunner executable.
bradfordsmith
Registered Member
Posts
4
Karma
0
For now the scripts are all python / windows platform, and I do see the export options in the krita.exe now that you mention it.
In my specific case, I may need to modify color profile / space settings prior to export, so I'll be targeting kritarunner to iterate over folders of images, passing both the filepath to open / convert, and any required arguments for the conversions / infoObject() export settings
bradfordsmith
Registered Member
Posts
4
Karma
0
Thanks for all the assistance.
A quick run through debugView shows something un-expected. I'm using the same script that I wrote in scripter, and it seems that when run in kritarunner, the krita module can't be imported.
It's unclear ATM if it's seeing the
from krita import *
import at the top of script, I'll keep testing

[13256] Creating engine
[13256] Try to import the pykrita module
[13256] krita.scripting: "Traceback (most recent call last):"
[13256] krita.scripting: " File \"C:\\Program Files\\Krita (x64)\\lib\\krita-python-libs\\krita\\__init__.py\", line 7, in <module>"
[13256] krita.scripting: " from .api import *"
[13256] krita.scripting: " File \"C:\\Program Files\\Krita (x64)\\lib\\krita-python-libs\\krita\\api.py\", line 28, in <module>"
[13256] krita.scripting: " from PyKrita.krita import *"
[13256] krita.scripting: "ImportError: DLL load failed: The specified module could not be found."
[13256] krita.scripting: "Could not import krita"
[13256] Cannot load the PyKrita module, aborting



Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell