# NOT RUN {
stimuli <- demo_stim() |> resize(0.5)
# make a photographic negative version
image_func(stimuli, "negate")
# set different argument values for each image
image_func(stimuli, "implode", factor = c(0.2, -0.2))
# }
# NOT RUN {
# other image functions
image_func(stimuli, "blur", 5, 3)
image_func(stimuli, "contrast", sharpen = 1)
image_func(stimuli, "oilpaint", radius = 5)
image_func(stimuli, "colorize", opacity = 50,
color = c("hotpink", "dodgerblue"))
# load a logo image and superimpose it on each image
logo <- system.file("extdata/logo.png", package = "webmorphR") |>
magick::image_read() |>
magick::image_resize(70)
image_func(stimuli, "composite", logo, offset = "+5+10")
# use a self-defined function
testfunc <- function(image) {
rot <- magick::image_rotate(image, 180)
c(image, rot) |> magick::image_average()
}
image_func(stimuli, testfunc)
# }
Run the code above in your browser using DataLab