Wiring darktable with Krita [nsfw]

Could you show 1 sample (ready) photo of Darktable + Krita? I was curious about your futuristic vision and in fact we will have a more polished workflow

Hm, loading an image itself may be easy, but I am talking about something else. This would be a simple addition to your module but with big impact. Your module will load a cached image and deliver a cached image. What I have in mind is a simple checkbox that tells darktable to not load the underlying image and it tells krita to load the image by its native mechanism. That way you could e.g. load a multi layer tiff as layers, edit it in krita, and run the flat output through darktable for colour grading. Another example would be a film negative workflow: Load the image with alpha layer in krita, use the scratch removal there to in paint the scratches, and pass the flat output to darktable for inverting and further processing. This does not sound too complicated to me, just turning some functionality on or off that is there anyway once your module is there.

I don’t have a ready sample of that and I don’t think a finished product will bring anything to the conversation. I mean good results can be achieved even with bad tools if you master them. The point is to simplify the workflow and increase your chances to get good results in a minimal amount of time.

But that is exactly what I’m speaking of. The whole conversation since the beginning is about dealing with painted layers in Krita, then reinject them into darktable pipeline.

Yes. I mean something else (maybe easier with pictures):

What I understood you were describing
image

What I think would make sense to add
image

Edit: I know that this may be achieved by just loading the image in krita directly, but this would break the link to the source image. With my idea, you would be able to copy-paste edits in darktable that include the krita module and have it always operate on the correct source image. Of course this may help only in non-destructive, “automatic” krita documents (or semi-automatic, which means to get a reasonable krita starting point when copy-pasting edits in darktable), but this already helps a lot (e.g. for my negative workflow).

In the lua scripts we just do a which command on linux to find the executable. If we are on mac/windows we have the use specify the executable location.

Ok so I did my first Krita + darktable retouch today. I must say… dodging and burning in linear is much more pleasant, it’s far easier to blend the brush strokes than in displa-referred (as expected… gaussian blur just works in linear).

So, I did the basic contrast editing of this picture in darktable and exported to OpenEXR 32 bits without filmic curve (the pic shown here has filmic on though):

I did the dodging and burning in Krita and saved the file as a .kra, then exported it back to OpenEXR (it seems OpenEXR doesn’t save layers). The dodging is performed by painting white on a layer blended in addition, the burning by painting black on a layer bended in multiplication. I also tried to dodge by painting in black on a layer blended in division (so that falls back to an exposure compensation), but after a while you end up dividing by almost zero and artifacts begin to show (although it gives a much better transition). Here is the flattened stack of D&B layers (notice I removed the underwear marks and scars only with dodging and burning):

Then I imported the Krita export back in darktable as OpenEXR, added some more sharpness and applied filmic:

It’s been a long time since I haven’t done that kind of editing, it makes me very happy, I missed that (it was 6h of work but I’m out of shape and I had to fight the soft a bit).

5 Likes

I admit I do prefer the original, and the original feels and looks a lot more natural.
I can see a smooth transition.

(it seems OpenEXR doesn’t save layers)

At least Blender is able to save EXR files with layers and Affinity Photo is able to open this files:

I’ve just tested with a file from this Natron bug and Krita is able to open EXR files with layers.

I tried OpenEXR with layers, it can work but the alpha channel is completely messed-up when you reopen it.

I can’t confirm this. I tested with Krita 4.2.8. Could you perhaps post your .kra file?

I have no experience with Krita, but potentially it sounds great. I’m thinking in particular of painting over small specular reflections that push into clipping… I have trouble dealing with these via the dt masking system. That may just be my inexperience, but it was relatively easy to over-paint these in LR.

No, it happens when using OpenEXR in and out, trying to save the layers, then re-open it. I was told it’s because Krita doesn’t use premultiplied alpha (seriously guys ?).

I believe many of us work with mutiple programs for photo retouching, as one software can’t fit all needs.
For example, I use DT, C1, Gimp, Nik, ON1, Portrait Pro, and others. Of course I don’t use all of them every time, but every SW has its specific use case where it excels.
When using a suite of programs, you need a pivot program which is capable to run all the others by doing round trip.
DT at the moment can’t be the pivot program as you can’t define a list of external editors. The LUA script for Gimp is only a partial solution.
For example, Capture One has the “Edit with” / “Open with”

Unfortunately, most of those programs will not go beyond a flat 16 bits display referred TIF file as input, but that is enough for many purposes.

Of course a tighter integration with layered linear 32 bits EXR is much better, but you can only do it with one specific program.
I can’t comment on Krita as I don’t use it.

Marco

1 Like

Okay, here’s my vision:

In a rendition, that is, an image file that represents the culmination of a lot of processing to make it look right in a particular medium, I’d like to see stored in that rendition file the entire chain of processing it took to get there, from each of the softwares, in sequence. In the image file. Not in some sidecar.

Image metadata is a mess of blocks and tags organized in rather myopic manners, but XMP starts to stand out as a potential space in which to accomplish such. Like most things here, I know enough about it to be dangerous; looking for more knowledgeable folk to weigh in…

Of course you can, it just isn’t done for you. The gimp script just dumps a tiff to the temp folder and tells.gimp to open it. This script could be adapted to work with any program.

As I said the gimp LUA script is a very partial solution:

  • can only work with one program, unless you want to change the pointer to the executable each time, which is very slow
  • if you want to use in sequence more programs on the same image, it will export a new TIFF every time. It is not possible to just open the same TIFF
    What would be needed is a new lighttable module where you have a custom list of external editors in a combo box and two buttons “Edit with” (which will export and create a new TIFF file) and “Open with” (which will just open the TIFF file without exporting).
    Maybe it can be done in LUA and I’m thinking to do it myself.
    Marco

Copy the gimp script, rename it, change the pointer to the program to whatever you want, call the lua script in your lua config file. Then you have one for each editor.

If you want that chain, then you probably don’t want or need to come back to darktable. From your next-in-chain application you’d need another “open with…” type of thing. GIMP is good at this and others here have worked gimp to open other apps.

1 Like

Further to this, given that different people use different tools for the same role, it’s sub-optimal to have one out of a variety of apps that perform a particular role be a “pivot app”. If, for example, you want to use dt as the “pivot app”, what use is that to someone that uses RT as their raw editor?

Why wouldn’t you come back? Darktable provides an excellent DAM solution, so the goal that I have is to have the entire photo management in darktable. Ideally, each involvement of external software such as gimp would still end in darktable. For 95% of images, darktable alone is sufficient, but for the other 5% (pano, *stacking, heavy retouching, composing) I would still want to do the management in darktable. And maybe even a final touch such as colour look or cropping. Even more ideally, what comes when the images are ready, such as printing, would be manageable by darktable as well.