gemm_image_lines: Convert an image to a series of different-width lines.

View source: R/gemm_image_lines.R

gemm_image_linesR Documentation

Convert an image to a series of different-width lines.

Description

This function is adopted directly from Georgios Karamanis' aRtist project at '<https://github.com/gkaramanis/aRtist/blob/main/portraits/portraits

Usage

gemm_image_lines(
  photo,
  filepath = tempfile(fileext = ".png"),
  line_color = "black",
  background_color = sample(colors(), 1),
  contrast = 4,
  density = 80,
  width = NA,
  height = NA
)

Arguments

photo

The path to an image to visualize, read via [magick::image_read]

filepath

The path to save the output image to

line_color

The color to draw the lines of the image

background_color

The flat color to use as a background

contrast

Numeric value used to scale contrast (higher values create higher contrast images)

density

How many pixels to rescale the longest dimension to. Higher values create more "dense" lines

width

The width of the output ggplot

height

The height of the output ggplot

Value

filepath


mikemahoney218/gemm documentation built on Sept. 15, 2022, 10:21 a.m.