Filters with two image inputs; layer stacks with several resolutions

There are several problems and one good solution. The problems are:

  1. The result of certain filters is different if the image is scaled (to a different canvas size in pixels) before applying the filter than after applying the filter. Scaling should be an intermediate step in non-destructive editing, due to all the advantages of non-destructive editing.

  2. Some modern filters have two images as input. These images don’t necessarily have the same size in pixels. Examples of such filters are:

  • Many variants of artistic style transfer
  • Color transfer
  • Certain variants of image-to-image translation
  • and so on.

So if a “stack” of layers can have only one canvas size in pixels, we need several stacks that can cross-talk (all layers forming a directed acyclic graph or even a more general graph for recursion/fractals). The several stacks can be either all within one file, or each in a separate file but still with cross-talk. Here’s an example:

One of the possibilities to implement the cross-talk is through layers that send and receive image data. The above graph would then look like this in the layers list:

Stack 300x300:
Filter layer
Rescale (receiver layer)

Stack 500x500:
Sender layer for rescale
Multi-image filter 2 (receiver layer)
Sender layer A for multi-image filter 2
Filter layer
Multi-image filter 1 (receiver layer)
Sender layer A for multi-image filter 1
Filter layer
Sender layer B for multi-image filter 2 
File layer

Stack 200x200:
Sender layer B for multi-image filter 1 
Filter layer
File layer

Important note: The philosophy here is based on the advantages of non-destructive editing.

Have you tried using file layer? That could be the answer to your problem.

I’m using workarouds that involve file layers (similar to this script), but the workarounds are tedious to set up, tedious to execute after each brush stroke, and they are not well compatible with the philosophy of non-destructive editing. Here’s what’s lacking:

  • Can non-destructive filter layers use two images of different pixel sizes as inputs?
  • Are there non-destructive scaling layers?
  • File layers auto-load from files (“receiver”), but how can we auto-save to files (“sender”)?

Maybe a combination of “Script Layers” and auto-save as PNG (like “Generate Image Assets” in Photoshop) could improve the situation.

There are Transform Masks.

To autosave, I’d suggest making a script.

In any case, that sounds a bit niche of a workflow. Do you have a usecase for that?

Transform Masks don’t change the canvas size in pixels.

How can a script autosave after every brushstroke?

Use cases:

  • Work non-destructively with scaling, with filters before and after it
    Use cases with filters with two images as input:
  • Many variants of artistic style transfer
  • Color transfer
  • Certain variants of image-to-image translation
  • and so on.

It’s about non-destructive editing.