Automation script for Krita

Hi there hope your all well! Glad to be a new member on this forum. I have just started working with Krita and using it to resize different images.

I spend quite a bit of time resizing folders of images to the same width and height all the time and wondering if there is a script or some type of automation to help speed this up.

Ideally I would be able to specify the folder and size of the image in pixels and then have all images in that folder resized in a new folder.

Any tips would be highly appreciated!
Thank you

Krita has a command line, but I don’t think resizing is an option. Only converting formats. You can technically create a python script in Krita that would import the images from a folder, resize and save them.

But for that kind of thing using imagemagick might be a better option unless you are converting from some format it does not support.

Hello, and welcome to this community :slight_smile:

I think it is better done with different tool. Krita good at manipulating images. But not in batch processing. Even though it supports scripting.

For your task I would go with this tool: ImageMagick (legacy) – Convert, Edit, or Compose Digital Images

It is a complete world with a lot of image processing functions.

Here some hints how it can be used for directory processing:

Main idea is to set input pattern output pattern and settings for the command.

This one I would go with first:

for file in *.xbm; do convert $file "`basename $file .xbm`.png"; done

Also. GIMP has Filters → Batch → Batch Process which gives you “David’s Batch Processor”. That can perfom a variety of operations, including resizing, on a selected set of files.

1 Like

For things like that i like using graphics magick, it’s very similar to image magick but i find the commands easier to remember. For resizing you would do something like this.

gm convert image.png -resize 2000x2000 newimage.png

Other options to automate would include making a python script using the pillow library or even a JavaScript image library and run the script with node.
I guess making a krita python plugin that would receive a list of images to be resized would be a solution too however i dislike having to open krita to just resize images, so to me the script approach is better.

1 Like

If you prefer to convert with a graphical interface, you can also use XnConvert, which is free for non-commercial use. The software is available for Linux, Mac and Windows and the range of functions is enormous.

Michelist

1 Like

I have thought to make a script for this once already but you have stuff like BIMP for GIMP and Natron that is a program made from the ground to do stuff like that. Making a inferior clone sounds a bit of a waste of time or is it still worth?

Thanks very much everyone, will be trying out all these solutions to work out the best fit. Appreciate the responses.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.