Created
January 12, 2017 19:16
-
-
Save karthik/901ca5273d45da2c2004fb3659a78b2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(magick) | |
# Package and issues available at: https://github.com/ropensci/magick | |
# ------------------------------------------------------------------------- | |
wizard_hat <- image_read("http://i.imgur.com/rpJ09lY.png") %>% | |
image_scale("x100") | |
bigdata <- | |
image_read('https://i.imgur.com/6X65Els.jpg') %>% | |
image_scale("x300") | |
hadley <- | |
image_read("https://i.imgur.com/e3As6XR.jpg") %>% | |
image_scale("x250") | |
start <- | |
image_composite(bigdata, image_fill(hadley, "none", fuzz = 5000), offset = "+100+80") | |
images <- lapply(seq(from = -100, to = 30, by = 10), function(i) { | |
image_composite(start, image_scale(wizard_hat, "x100"), offset = paste0("+185+", i)) | |
}) | |
image_animate(image_join(images), loop = 5) | |
# Sorry Hadley! | |
image_read("http://i.imgur.com/Y8JUQsV.gif") %>% image_scale("x250") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment