remove_image_bg: Remove image background

View source: R/remove_image_bg.R

remove_image_bgR Documentation

Remove image background

Description

Import and image and remove the background using magick.

Usage

remove_image_bg(
  path,
  color = "white",
  fuzz = 0,
  save_path = file.path(tempdir(), "phylopic_processed", paste0(basename(dirname(path)),
    ".png"))
)

Arguments

path

a file, url, or raster object or bitmap array

color

a valid color string such as "navyblue" or "#000080". Use "none" for transparency.

fuzz

relative color distance (value between 0 and 100) to be considered similar in the filling algorithm

Value

Named list containing the modified image itself and the saved path of the modified image.

Source

path <- paste0("https://images.phylopic.org/images/", "2de1c95c-7e1f-429b-9c08-17f0a27d176f/vector.svg") img_res <- remove_image_bg(path=path)


neurogenomics/orthogene documentation built on Jan. 30, 2024, 4:44 a.m.