Exporting presets

Exporting presets

I created a workflow for my presets and wonder how I can export it.

I would like to see the modules for each group. What I see is:

<?xml version="1.0" encoding="UTF-8"?>
<darktable_preset version="1.0"><preset><name>my-workflow</name><description></description><operation>modulegroups</operation><op_params>gz03eJx1UktWwzAMvIr3LELvAKy4hOKosV5ty5WdUng6EhfgSpwCu3npL3STJ2tGI42UjT7/fv9sVDXTGJiGznIsArmcE3mHH2odxIg+0BFFxr4rGBIKlElwhVknHGCVdtOaSt5PgSLEsoLeTOZJ7Lrm/fXlDLFnwf0Evksw3rxHgeSuE5EHNMmDxYC1HR4T5zp9twQztwcP0WLrM3quL7O4+R89UC8t9QjPbUVQiOMjRi91CXTSgOxoWzrhMlcMGJkyJuEteexyEYxjcVo44rXLyztA3pnFkbFcjxTzLHZHWs58S/I10p48lG7AAuTrz9FDRq0fsjpDaoXTRa9STtZMHWagOJon07DZr96f734NVyfSJBRACHOTFKwjHZqMCNpShWAJz1Grv12SOvhCwcCHque4pNrW59mXYOHJOvW0n2j7qc0+yqkqO5C6BY0+IMT8B4ORRvE=</op_params><op_version>1</op_version><enabled>1</enabled><autoapply>0</autoapply><model>%</model><maker>%</maker><lens>%</lens><iso_min>0.000000</iso_min><iso_max>340282346638528859811704183484516925440.000000</iso_max><exposure_min>0.000000</exposure_min><exposure_max>10000000.000000</exposure_max><aperture_min>0.000000</aperture_min><aperture_max>100000000.000000</aperture_max><focal_length_min>0</focal_length_min><focal_length_max>1000</focal_length_max><blendop_params></blendop_params><blendop_version>0</blendop_version><multi_priority>0</multi_priority><multi_name>(null)</multi_name><multi_name_hand_edited>0</multi_name_hand_edited><filter>0</filter><def>0</def><format>0</format></preset></darktable_preset>

Here’s your code presented in XML format:

I don’t see “module” separated from “groups” FWIW

Maybe what you’re looking for is buried between <op_params> and </op_params>

Under <preset>:
<description> is missing
<blendop_params> is missing

so the code snippet is not right XML format-wise.

May be helpful, maybe not …

3 Likes

Maybe I did something wrong, this is why I showed the screenshot. I pressed export and posted the contend of the file.

My goal is to get a list of all modules I regularly use.

Can’t help with that, sorry, I don’t use dt.

Looking again at the screenshot, the XML doesn’t seem to match the screen content, per se.

For example, I would expect:

<group>
.
.

<creative>
<framing>stuff</framing>
<grain>stuff</grain>
.
.
</creative>
</group>

Why try to answer dt questions when you dont use it?

2 Likes

This looks like a bug (or some very odd option). There is an export, but I dont see an import.

I’m not sure what you are trying to do. The module screenshot represents a layout option you created. This layout is reflected when you are using dt to edit images. The layout does not apply a workflow, it just helps your workflow.

A classic @g-man confrontational post.

I try to be helpful in a general sense. After all, XML is XML, no matter what produces it.

Would be nice to have your knowledgeable dt input on that matter.

You can import presets in preferences / presets:

After I imported your preset, it shows up and works:

As for the XML format (also for @cedric) - feel free to skip this:

Summary
  • the XML is well-formed
  • description is empty
  • blendop_params is empty

Darktable uses the same XML format (I could say ‘schema’, but that’s a specific thing in the XML world and darktable does not indicate one in the file) for all modules, whether they are processing modules (most, but not all of which support blending) or not.

The format is quite general. Cedric is right in a way: if we had a schema for each module type, there could be human-readable (and verbose) parameters, like group and so on. Instead, the parameters are in that op_params tag, which contains base64-encoded binary data, which can simply be loaded right into the module’s internal parameter area (it’s platform-independent, though, endianness is handled correctly). Even if it were human-readable data, usually there is very little a human could do with them anyway, and this is more efficient size-wise and speed-wise (no complicated XML parsing is needed to load the data), and development-wise (whenever a new module parameter is added, code is written to ensure backward compatibility, but no new XML tag needs to be added to the schema and the XML reader / writer).

So, don’t worry, your export worked, and can be shared with others or saved to a separate location and it can be re-imported just fine.

2 Likes

Even with a general schema, you could use “key/value” pairs for the parameter (something like
<parameter name=“x” value=“y” />). Very verbose, and does the reader know what “name” stands for, or what “value” means? Internal names and value ranges don’t have to be the same as UI names and ranges. E.g. angles need to be expressed in radians for most math, I guess most users feel more at ease with degrees…

As for storing a workflow this way, that looks hard: a workflow is also an “order of operations”, not just the modules you use (or may use, not all images will need all modules).

1 Like

XML schema doesn’t enforce this; you can have deacriptive attribute values without schema. We could also supply schema for the current document type that darktable produces and the base64 values would still be valid.

In XML, you can’t really have a “general schema” – the idea doesn’t really make sense. In XML, a schema generally expresses how an XML document is formed, generally via document constrains. Instead of “general schema” we have the idea of well formed or valid XML. The “key/value” pairs are called “attributes” in XML.

(I still work with XML every day :slight_smile: )

1 Like

but thats not the way it’s encoded in darktable :wink:
<op_params> contains the configuration

2 Likes

Right, I should have said “A schema used for all module preset exports”. And I know about attributes in XML :stuck_out_tongue: . I just didn’t want to get too technical in this context.

In this case, I think that while there are ways to store individual parameters, the notion of “human-readable” is abused: yes, you could read the text (syntax), but what does that text tell you (semantics)?

1 Like

Sorry for the naming. It was chosen in a way that I can recognize easily that this was created by me.

I am doing notes in a textfile. I simply would like to remember the modules, whcih I often used and not typing everything.

These modules are used in the beginners video https://youtu.be/ZUc6LOzg_Nk I am sure I will change this later. Is it possible to rearrange the modules in the listing?

There are two module orders:

  • history (editing) order
  • execution (computation) order.

The’right side’ is in execution order. Do not change that while you are still new to darktable! It defines how the image is processed.

The module groups module reflects the execution order, as far as I know.

1 Like

No question, coders know better which module has to be used in the export first.

Maybe the word “workflow” describes best what I mean.

You see the screenshot. I put some modules there. I would like to see them there in a way I use them.

Examples:
Denoise, I do at the end. It doesn’t make sense to do it, when I crop the noisy area.

Levelling I do before cropping… If heavy levelling is needed cropping before is useless.

So I would like to have my modules in a special order which is my standard workflow, not all used with every photo. There are some modules, where it doesn’t matter if used before another.

My personal workflow order doesn’t have any influence how the photo is computed at the end.

But the order in the module panel is the pipe-line order and you use that panel to change the pipe-line order. (which is useful or even needed in some situations, LUTs come to mind)

So allowing users to rearrange the available modules as they want it means you need another way to change pipeline order… (I know there is a tab to show the active modules, but having the modules only there in pipeline order is confusing as well, as the order would be different in the other tabs).

(See the manual)

I’m not advocating this as a change but I think that is one way of thinking (as you mention) but not all people think or work that way…so for example for me a perfectly acceptable and logical way to work would be to have the active modules tab be the focus and control of the pipeline and to have that tab be the only place that pipeline changes would be made just as they are now and then to have custom module groups be separated and unbound from that order reflect how I would like to organize and work through my modules either by name or alphabetically or whatever… I’m fine with how it is and can adapt to whatever is in place but I have never really understood why the modules in custom or select groups need to be in pipeline order

1 Like

One reason could be “no one ever thought of the alternative”…

Also, treating one tab differently for the layout may complicate the code, now it’s just one order for all tabs, and “just keep only the modules you need”.

1 Like

I want a way to be remembered which modules I should check. I am not interested to rearrange processing.

As explained with my examples it makes sense for me to use some modules previous to others, this has nothing to do with rendering.

I could put a simple text with modules in a window, but maybe there are other ways to remember me.