image_fragment: Add a Graded Fragmentation Effect to a Magick Image

View source: R/img_fragment.R

image_fragmentR Documentation

Add a Graded Fragmentation Effect to a Magick Image

Description

This function creates a set number of copies of a magick image, with an increasing proportion of random non-background "fragments" of the image obscured by coloured squares.

Usage

image_fragment(image, pixel_size, levels, pixel_colour = "white")

Arguments

image

a magick image object

pixel_size

a double representing the height and width of each image fragment

levels

the number of fragmentation levels to generate, inclusive of the fully revealed image

pixel_colour

a valid magick colour string such as "navyblue" or "#000000" that determines the fill colour of the obscured image fragments

Examples

stimulus <- image_read_svg("http://jeroen.github.io/images/tiger.svg", width = 400)

fragments <- image_fragment(stimulus, pixel_size = 20, levels = 10)

roryspanton/fragmentr documentation built on July 24, 2024, 4:44 p.m.