image_fragment | R Documentation |
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.
image_fragment(image, pixel_size, levels, pixel_colour = "white")
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 |
stimulus <- image_read_svg("http://jeroen.github.io/images/tiger.svg", width = 400)
fragments <- image_fragment(stimulus, pixel_size = 20, levels = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.