Stacks a list of images vertically or horizontally into a single image.

render_stack(
  input_list,
  stack = c("v", "h", "vertical", "horizontal"),
  align = c("center", "start", "end", "left", "right", "top", "bottom"),
  background = c(0, 0, 0, 0),
  convert_colorspace = TRUE,
  filename = NULL,
  preview = FALSE
)

Arguments

input_list

List of 3-layer RGB/4-layer RGBA array, rayimg class, or image filenames.

stack

Default "v". Stack direction: "v"/"vertical" or "h"/"horizontal".

align

Default "center". Alignment on the non-stacking axis. Options: "start"/"left"/"top", "center", "end"/"right"/"bottom".

background

Default c(0,0,0,0). Background color for padding, as numeric c(r,g,b[,a]) in 0..1 or a color string.

convert_colorspace

Default TRUE. Whether to convert all images to match the colorspace of the first image in the list.

filename

Default NULL. File to save the image to. If NULL and preview = FALSE, returns an RGB array.

preview

Default FALSE. If TRUE, it will display the image in addition to returning it.

Value

A rayimg RGBA array.

Examples

if(run_documentation()){
render_stack(list(dragon, 1 - dragon), stack = "h") |>
 plot_image()
}

if(run_documentation()){
render_stack(list(dragon, render_bw(dragon)), stack = "v") |>
 plot_image()
}