Skip to contents

Adds sepia tone, soft dither, paper texture, and a rotating top shadow. The shadow is drawn in a top margin before rotating the whole page.

Usage

scanify_journal(
  img,
  paper = NULL,
  sepia = TRUE,
  dither = TRUE,
  dither_strength = 0.3,
  tilt_deg = 0.6,
  rotate_bg = "white",
  pad_top_px = NULL,
  shadow_strength = 0.35,
  saturation = 10
)

Arguments

img

magick image

paper

optional path/URL to paper texture

sepia

logical

dither

logical

dither_strength

0..1 blend amount (softer texture than full dither)

tilt_deg

degrees to rotate the page (small skew)

rotate_bg

background color used when flattening after rotate

pad_top_px

top margin in pixels (NULL = ~2% of height)

shadow_strength

0..1 peak opacity at the very top of the margin

saturation

If not sepia toned, color saturation

Examples

if (FALSE) { # \dontrun{
if (requireNamespace("magick", quietly = TRUE)) {
  img <- magick::image_blank(200, 200, "white")
  scanify_journal(img)
}
} # }