Customization

Getting Started with Customization

Beyond the basic features, Batcher allows you to:

As the amount of customization may be overwhelming at first, you may want to take a look at a few examples below.

When editing layers, customization options are automatically displayed. To enable customization when exporting layers, select Settings → Show More Settings.

Dialog of Export Layers with additional customization

Examples

I want to export all layers using the image size, not the layer size.

Uncheck or remove the “Use layer size” procedure.

I want to export only visible layers.

Check the “Visible” constraint (or add one if not already).

I want to export only visible layers, including those that have invisible parent layer groups.

  1. Check the “Visible” constraint (or add one if not already).
  2. Edit the “Visible” constraint (hover over the constraint and click on the pen and paper icon). In the dialog, click on More options and then uncheck Also apply to parent folders.

I don’t want to preserve folder hierarchy when exporting layers.

Add the “Remove folder structure” procedure.

How do I rename the layers to form a sequence of numbers, e.g. “image001”, “image002”, …?

Click on the text entry next to Save as: and choose image001, or type image[001] in the entry.

My layers contain a ‘.’. All characters after the ‘.’ are replaced with the file extension. How do I prevent this?

In the text entry next to Save as:, type [layer name, %e]. This ensures that the resulting image name will be e.g. some.layer.png instead of some.png (the default behavior).

How do I export only layer groups at the top level?

  1. Uncheck the “Layers” constraint.
  2. Add the “Layer groups” constraint.
  3. Add the “Top-level” constraint.

I want to adjust brightness in my layers. Can this be done?

Yes, you may insert any GIMP filter as a procedure:

  1. Select Add Procedure... → Add Custom Procedure...
  2. Find gimp-drawable-brightness-contrast in the procedure browser and select Add.
  3. Adjust the parameters as desired.
  4. Select OK to add the procedure.

I need every layer to have the same background.

  1. In GIMP, assign a color tag to the layer(s) you want to consider background (right-click on a layer → Color Tags → choose your color).
  2. In the plug-in, the color tag will be displayed next to the layer name(s).
  3. Add the “Background, foreground” → “Insert background” procedure. If needed, you may place this procedure after “Use layer size” by dragging it onto “Use layer size”.
  4. If you want to edit layers rather than export them, you may want to merge the inserted background with each layer. To do so, add the “Merge background” procedure.

I want to save the entire image as a single multipage PDF file.

While multipage PDF export is already possible in GIMP without any third-party plug-ins, Batcher allows you to apply custom procedures before the export or export each layer group (instead of the entire image).

  1. Add the “Export” procedure.
  2. Adjust the output folder as needed. The folder explorer in the main dialog will be ignored.
  3. Type pdf next to File extension.
  4. Select an option in Perform export:. To export a single image, select For the entire image at once.
  5. If needed and if For the entire image at once was selected, adjust Image filename pattern as seen fit.
  6. Specifically for the PDF format, you need to check Layers as pages when the native PDF export dialog is shown. Otherwise, only a single page will be exported.
  7. You may also want to uncheck the “Use layer size” procedure to use the image size (since PDF pages have the same dimensions), otherwise you might obtain unexpected results.

Also note that if you export top-level layer groups and the first layer group contains only a single layer, the Layers as pages option in the PDF dialog cannot be checked, even if subsequent layer groups contain multiple layers. This is the current behavior of the PDF export in GIMP.

Adjusting Layer Names

By default, layer names are used as filenames. The text entry next to Save as lets you customize the filenames.

There are several built-in fields that you can combine to form a filename pattern. For example, image[001] renames the layers to image001, image002 and so on. The text entry can show you examples of how each field is used if you place the text cursor inside a field. The fields are described below in detail.

The preview automatically updates as you change the filename pattern and so can greatly help you figure out how your specified pattern affects the layer names.

Fields must be enclosed in square brackets and must have a correct number of options. Options must be separated by commas. Invalid options result in the field being inserted literally.

Available fields

You can choose the fields from the dropdown list displayed when clicking on the text entry, or you can type the fields manually.

Number

A number incrementing for each layer. The numbering is separate for each layer group.

Options:

Examples:

[layer name]

The layer name.

Options:

Examples:

[image name]

The current image name.

Options:

Examples:

[layer path]

The “full path” of a layer. For example, if the image has a layer group named Body containing a layer group named Hands containing a layer named Left, the layer path will be Body-Hands-Left.

Options:

Examples:

[replace]

Replaces a part of the specified field with another string. This essentially allows to fine-tune any field. Regular expressions are supported as well.

Options:

For the example below, suppose that a layer is named “Animal copy #1”. While the square brackets ([ and ]) enclosing the first three field options are optional, they are necessary in case you need to specify an empty string ([]), leading spaces or commas.

Examples:

[tags]

Color tag assigned to a layer. For example, suppose that a layer has a green color tag assigned. Then (by default) the tag will be formatted as green.

Options:

Examples:

[current date]

The current date.

Options:

Examples:

[attributes]

Layer or image attributes.

Options:

Examples:

Inserting reserved characters in optionss

To insert a literal space or comma in a field option, enclose the option with square brackets. To insert a literal square bracket ([ or ]), double the bracket and enclose the option with square brackets (e.g. [[[] to insert a literal [).

If the last option is enclosed in square brackets, leave a single space between the last and the second to last closing square bracket.

Examples:

Procedures

Procedures allow you to apply image filters to each layer. Press the Add Procedure... button and select one of the available procedures, or add a custom procedure.

For each added procedure, you may perform any of the following:

You can add the same procedure multiple times.

Built-in Procedures

Apply opacity from layer groups

Combine opacity from all parent layer groups for each layer. This corresponds to how the layer is actually displayed in the image canvas.

For example, if a layer has 50% opacity and its parent group also has 50% opacity, the resulting opacity of the layer will be 25%.

Insert background

Insert layers tagged with a specific color tag as background for each layer.

Note that even background layers are processed and exported - to prevent this behavior, enable the Without color tags constraint.

The blue color tag is used as background by default. You may set a different color tag representing the background layers by editing the procedure option Color tag.

In the dialog, this procedure is always inserted in the first position. This prevents potential confusion when Use layer size is unchecked and the background is offset relative to the layer rather than the image canvas. If this is your intention, you can always move this procedure below Use layer size.

Insert foreground

Insert layers tagged with a specific color tag as foreground for each layer.

The green color tag is used as foreground by default.

For more information, see “Insert background” above.

Merge background

Merges an already inserted background layer (via “Insert background”, see above) with the current layer.

This is useful if you wish to have a single merged layer rather than the background as a separate layer.

When exporting layers, the background is merged automatically before the export. Hence, this procedure is only useful when editing layers.

If there is no background layer inserted, this procedure has no effect.

Merge foreground

Merges an already inserted foreground layer (via “Insert foreground”, see above) with the current layer.

When exporting layers, the foreground is merged automatically before the export. Hence, this procedure is only useful when editing layers.

For more information, see “Merge background” above.

Export

Performs export with additional customization not available in the main dialog.

Options:

When exporting each layer separately (the default), the Export procedure usually makes sense to be applied as the last procedure since procedures after Export would have no effect.

Remove folder structure

Export all layers to the output folder on the same level, i.e. do not create subfolders for layer groups.

Rename

Rename layers according to the specified pattern. This procedure uses the same text entry as the one next to Save as described in Adjusting Layer Names. If this procedure is specified, the text entry next to Save as has no effect.

Additionally, this procedure allows customizing whether to also rename folders (by enabling Rename folders) or only rename folders (by enabling Rename folders and disabling Rename layers).

Scale

Scales layers.

This is similar to the built-in Scale layer... procedure in GIMP that allows scaling width and height individually, using absolute (pixels) or relative (percentages) measures.

Options:

Use layer size

If enabled, layers will be resized (not scaled) to their size instead of the image size. This procedure is enabled by default.

To keep the size of the image canvas and the layer position within the image, disable this setting. Note that in that case the layers will be cut off if they are partially outside the image canvas. To export the entire layer, leave this setting enabled.

When editing layers, you may want to disable this procedure as the image will be resized to the last processed layer’s dimensions.

Adding Custom Procedures

You can add any procedure available in the GIMP Procedural Database (PDB) by pressing Add Procedure... and then selecting Add Custom Procedure.... Select the desired procedure from the browser dialog and press Add. The edit dialog allows you to edit the procedure name and the values of its options.

Editing procedures

When editing a procedure, you may (and sometimes have to) adjust its options. GIMP PDB procedures are usually accompanied by descriptions of the entire procedure as well as its options. Hover over option names to display tooltips describing them in more detail. The description for an option often indicates the range of valid values.

If a procedure contains a layer/drawable/item option, you may select one of the following:

Constraints

To exclude certain layers from processing and export, press the Add Constraint... button and select one of the available constraints. As with procedures, you can enable, disable, reorder, edit or remove constraints as needed. Adding the same constraint multiple times is also possible.

Built-in Constraints

Layers

Process only layers (i.e. ignore layer groups). This constraint is enabled by default.

Layer groups

Process only layer groups.

Matching file extension

Process only layers having a file extension matching the extension typed in the text entry.

Selected in GIMP

Process only layers selected in GIMP.

Selected in preview

Process only layers selected in the preview. If you save settings, the selection is saved as well.

Top-level

Process only layers at the top of the layer tree (i.e. do not process layers inside any layer group).

Visible

Process only visible layers.

By default, layers (visible or not) whose parent layer groups are invisible are also ignored. To disable this behavior, edit the constraint, click on More options and check Also apply to parent folders.

With color tags

Process only layers having a color tag.

By default, all layers without a color tag are excluded. To process only layers with specific color tags, edit this constraint and add the color tags for the Color tags option. For example, by adding a blue tag, only layers containing the blue tag will be processed. Other tagged or untagged layers will be excluded.

Without color tags

Process only layers having no color tag.

By default, all layers with a color tag are excluded. To ignore only specific color tags, edit this constraint and add the color tags for the Color tags option.

If a layer group is assigned a color tag, it will normally not be ignored. To also ignore layer groups with color tags, click on More options and check Also apply to parent folders.

More Options

When editing procedures or constraints, you may adjust additional options when clicking on More options.

Enable for previews

If checked (the default), apply the procedure or constraint in the preview.

Unchecking this can be handy if a procedure takes too long or manipulates the file system (reads or saves files).

Also apply to parent folders (constraints only)

If checked, a layer will satisfy a constraint if all of its parent groups also satisfy the constraint. For example, if checking this option for the “Visible” constraint, a visible layer would be ignored if any of its parent layer groups are not visible.

This option is unchecked by default and is only checked for the “Visible” constraint that is displayed when running this plug-in for the first time.