Skip to content

Combine

Overview

The Combine Operation would combine the images in the pipeline into one image.

Configuration

Use "combine" as the type of the operation.

Keys in "config":

Key Type default value Description
direction string "ttb" There are 4 options: "ttb", "btt", "ltr", "rtl"
"ttb" means "top to bottom"
"btt" means "bottom to top"
"ltr" means "left to right"
"rtl" means "right to left"
horizontal_align string "center" There are 3 options: "left", "center", "right"
This applies when "direction" is "ttb" or "btt".
vertical_align string "center" There are 3 options: "top", "center", "bottom"
This applies when "direction" is "ltr" or "rtl".

Examples

Take this xopp file as an example.

Direction

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ttb"
            }
        },
        {
            "type": "save"
        }
    ]
}

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "btt"
            }
        },
        {
            "type": "save"
        }
    ]
}

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ltr"
            }
        },
        {
            "type": "save"
        }
    ]
}

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "rtl"
            }
        },
        {
            "type": "save"
        }
    ]
}

Horizontal alignment

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ttb",
                "horizontal_align": "left"
            }
        },
        {
            "type": "save"
        }
    ]
}

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ttb",
                "horizontal_align": "center"
            }
        },
        {
            "type": "save"
        }
    ]
}

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ttb",
                "horizontal_align": "right"
            }
        },
        {
            "type": "save"
        }
    ]
}

Vertical alignment

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ltr",
                "vertical_align": "top"
            }
        },
        {
            "type": "save"
        }
    ]
}

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ltr",
                "vertical_align": "center"
            }
        },
        {
            "type": "save"
        }
    ]
}

alt text

config.json
{
    "pipeline": [
        {
            "type": "load",
            "config": {
                "paper_background_preserved": true,
                "trim": true
            }
        },
        {
            "type": "combine",
            "config": {
                "direction": "ltr",
                "vertical_align": "bottom"
            }
        },
        {
            "type": "save"
        }
    ]
}