stats220

Description of my meme

Display the meme

my meme

Images I used to create it

  1. The first images is a picture of Muffine Muffin

  2. The second images is a picture of Chihuahua

Chihuahua

R code I used to create it

library(magick)

# create a blank image and write text
image <- image_blank(400,
                     150,
                     color = "#000000") %>%
  image_annotate(text = "WHEN I TEST MY FIRST\nIMAGE CLASSIFIER MODEL",
                 color = "#FFFFFF",
                 size = 35,
                 font = "Impact",
                 gravity = "center")

# read a muffin image and write text
image_1 <- image_read(path = "https://www.biggerbolderbaking.com/wp-content/uploads/2020/05/Bakery-Style-Lemon-Blueberry-Muffins-WS-Thumbnail.jpg") %>%
  image_crop("700x700+200") %>%
  image_scale(200)%>%
  image_annotate(text = "CHIHUAHUA",
                 color = "#FF0000",
                 size = 30,
                 font = "Impact",
                 gravity = "southwest")

# read a chihuahua image and write text
image_2 <- image_read(path = "https://www.k9web.com/wp-content/uploads/2021/01/five-purebred-chihuahua-dogs.jpg") %>%
  image_crop("230x230+300") %>%
    image_scale(200) %>%
      image_annotate(text = "MUFFIN",
                     color = "#FF0000",
                     size = 30,
                     font = "Impact",
                     gravity = "southeast")

# combine two images in one row
second_row <- c(image_1, image_2) %>%
  image_append()

# create my meme
meme <- c(image, second_row) %>%
  image_append(stack = TRUE)

# write the image
image_write(meme, "my_meme.png")