Skip to content

Instantly share code, notes, and snippets.

@dmi3kno
Last active July 28, 2019 14:26
Show Gist options
  • Save dmi3kno/57dfe912758975952117c3ecc48e04ac to your computer and use it in GitHub Desktop.
Save dmi3kno/57dfe912758975952117c3ecc48e04ac to your computer and use it in GitHub Desktop.
Thanks to Will Chase @W_R_Chase
library(magick)
library(bunny)
library(baRcodeR)
joe <- image_read("~/Downloads/bg/joe_mango2.png")
################## make barcode #################
baRcodeR::custom_create_PDF(user=FALSE, Labels = 20190728,
name = '~/Downloads/bg/LabelsOut', type = 'linear')
bc <- image_read_pdf("~/Downloads/bg/LabelsOut.pdf") %>%
image_trim() %>%
image_scale("150x150")
############# making sticker ##################
lbl <- image_blank(800,800, "white") %>%
image_annotate("∙", size=1800, color="#ffba08",
font="Lato", gravity = "Center") %>%
image_trim() %>%
image_annotate("Plus:", font="Roboto Slab", color="white",
gravity = "Center", location="+0-60",size=65) %>%
image_annotate("expend_cheng()", font="Ubuntu Mono", weight = 700, color="#3772a6",
gravity = "Center", location="+0+0 ",size=35) %>%
image_annotate("Exclusive interview", font="Roboto Condensed", color="#fcf6b1",
gravity = "Center", location="+0+35",size=25) %>%
image_annotate("with developer of", font="Roboto Condensed", color="#fcf6b1",
gravity = "Center", location="+0+60",size=25) %>%
image_annotate("shinymeta", font="Ubuntu Mono", color="white",
gravity = "Center", location="+0+90",size=30) %>%
image_rotate(-15) %>%
image_fill("red", "+1+1", fuzz = 1, refcolor = "white") %>%
image_transparent("red", fuzz=1) %>%
image_scale("200x200")
################################################
cover <- image_blank(700, 800, "grey95") %>%
image_annotate("FUTURE", font = "Anton", location = "+0-270",
gravity = "Center", weight=400, size=250, color="#233d5c") %>%
image_composite(joe, offset = "South") %>%
image_annotate("What do shiny promises", font="Roboto Condensed", color="#af3b6e",
gravity="West", location="+10-120",size=23) %>%
image_annotate("PROMISE", font="Oswald", weight=700, color="#af3b6e",
gravity="West", location="+10-85",size=58) %>%
image_annotate("5", font="serif", style="italic", color="#ffba08",
gravity="West", location="+10+35",size=90) %>%
image_annotate("tips", font="serif", style="italic", color="#ffba08",
gravity="West", location="+50+25",size=50) %>%
image_annotate("for making", font="Roboto Condensed", color="black",
gravity="West", location="+10+70",size=18) %>%
image_annotate("your apps", font="Roboto Condensed", color="black",
gravity="West", location="+10+90",size=18) %>%
image_annotate("more", font="Roboto Condensed", color="black",
gravity="West", location="+10+110",size=18) %>%
image_annotate("reactive", font="Roboto Condensed", color="black", weight=700,
gravity="West", location="+10+130",size=18) %>%
image_annotate("Is your plan", font="Roboto Condensed", weight=400, color="#428bca",
gravity="East", location="+10-135",size=61) %>%
image_annotate("MULTICORE OR", font="Oswald", weight=700, color="#ffba08",
gravity="East", location="+10-85",size=45) %>%
image_annotate("MULTIPROCESS?", font="Oswald", weight=400, color="#ffba08",
gravity="East", location="+10-40",size=45) %>%
image_annotate("The ultimate guide to", font="Roboto Condensed",
gravity="East", location="+10+0",size=20) %>%
image_annotate("forking your R session", font="Roboto Condensed",
gravity="East", location="+10+20",size=20) %>%
image_annotate("Joe Cheng", font="Roboto Condensed", color="#233d5c",
gravity = "East", location="+10+130",size=42) %>%
image_annotate("keynote at UseR!2019", font="Roboto Condensed", color="#233d5c",
gravity = "East", location="+10+160",size=20) %>%
image_annotate("It is so", font="Oswald", weight=400, color="#428bca",
gravity = "East", location="+10+200",size=80) %>%
image_annotate("META", font="Oswald", weight=700, color="#428bca",
gravity = "East", location="+10+300",size=150) %>%
image_composite(lbl, offset = "SouthWest", operator = "Atop") %>%
image_composite(bc, offset = "+200+750")
cover
cover %>% image_write("future_magazine_20190728.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment