compose_image: Compose a modified/annotated image from an image file

View source: R/compose_image.R

compose_imageR Documentation

Compose a modified/annotated image from an image file

Description

This function inputs an image file and allows for resizing, cropping, and text annotations

Usage

compose_image(
  image,
  filename = NULL,
  path = NULL,
  scale = 1,
  crop_region = NULL,
  text = NULL,
  textcolor = "white",
  boxcolor = NULL,
  font = "Helvetica",
  fontsize = 70,
  rel_fontsize = NULL,
  gravity = "southwest",
  location = "+20+20",
  border = FALSE
)

Arguments

image

The path to the image file to be modified

filename

The filename of the output image

path

The path to the output image

scale

The resizing proportion of the original image (0 to 1; default is 1 = original size)

crop_region

The region to be cropped (e.g. '100x150+100+100', (width x height +upper_x +upper_y)).

text

The text string to be added to the image

textcolor

The color of the text annotation (default is "white")

boxcolor

The color of the textbox (default is 'NULL')

font

The font of the text annotation (default is "Helvetica")

fontsize

The fontsize of the text annotation (default is 70)

rel_fontsize

Whether to adjust the fontsize relative to width (x) or height (y)

gravity

The anchor point of the added text (default is "southwest")

location

The location of the text relative to the anchor point

border

Set to 'TRUE' if you want a black border frame for the output image

Value

The filename of the image file that was created


borstell/signglossR documentation built on June 11, 2025, 5:58 a.m.