@import url('https://fonts.googleapis.com/css2?family=Cal+Sans&family=Micro+5&display=swap');
body {
background: linear-gradient(90deg,rgb(187, 223, 250) 0%, rgb(51, 255, 169) 50%, rgb(187,223,250) 100%);
background-size: 200% 200%;
animation: backgroundAnimation 5s linear infinite alternate;
}
@keyframes backgroundAnimation {
0% {background-position: 0% 50%}
100% {background-position: 200% 50%}
}
h1, h2, h3, .author {
font-family: "Cal Sans", sans-serif;
padding: 10px;
}
.author {
font-family: "Micro 5";
}
div:not(.main-container, .float, .figcaption) {
/* I thought it was strange that R Studio had Chrome's HTML inspector, but it turned out to be useful for getting those class names */
background: rgba(255, 255, 255, 0.5);
backdrop-filter: blur(10px);
border-radius: 10px;
}
p {
padding: 10px;
}
The key component of this meme is the proud linux user saying something in response to the employee asking about antiviruses. The meme uses multiple panels.
To change the original comic, I covered up the text saying “I run linux” using a white box, then I added my own (more pedantic) text on top of it. I made this change to represent the complexities of the word “Linux” which are often brought up in discussions online. I have kept the base image the same.
My project demonstrates creativity because:
image_crop(),
which was not in the lab.image_composite(), which was not in the lab.I think from module 1, I thought that the most important idea we
learned about was using vectors. I found them very useful when I was
loading in all the frames from the explosion effect. If I hadn’t used a
vector at that stage, I would have had to manually type out
explosion_frame_n many times, duplicated a lot of code, and
probably would have made a typo somewhere that would take me a long time
to find. Vectors were useful for keeping multiple values inside one
name, so that it can be used as a function input or iterated through in
a for loop.
I am curious about how we can use our abilities to create images with R to create useful images that can share information, instead of just making memes. I think the tools we used for this assignment will probably be useful for future data visualization tasks, so I’m interested in seeing what else we can make.
Do not change, edit, or remove the R chunk
included below.
If you are working within RStudio and within your Project1 RStudio
project (check the top right-hand corner says “Project1”), then the code
from the meme.R script will be displayed below.
This code needs to be visible for your project to be marked appropriately, as some of the criteria are based on this code being submitted.
library(magick)
white_box <- image_blank(width=60, height=50, color="#EEEEEE")
meme <- image_read("inspo_meme.png") %>% #xkcd 272
image_composite(white_box, offset="+210+25") %>% #Cover up the old text from the original comic by putting a white box over it
image_annotate(text="I use GNU\n/Linux, or \nas I've \nrecently \ntaken to \ncalling it, \nGNU plus \nLinux---",
#Then add my text to it
size=15,
location="+210+25") #This bit lines it up with the box
image_write(meme, "my_meme.png")
# Now the animation section:
#Original comic frames
frame1 <- image_crop(meme, "195x180+0+0")
frame2 <- image_crop(meme, "87x180+195+0") #This one has my text in it
frame3 <- image_crop(meme, "219x180+420+0")
frame4 <- image_crop(meme, "224x140+0+190")
frame5 <- image_crop(meme, "238x140+233+190")
frame6 <- image_crop(meme, "148x140+483+190")
explosion_frames <- NULL
for (num in 3:17) { #Honestly I should have just not bothered with a loop - it took a lot of debugging
explosion_img <- image_read(paste(paste("explosiongif_", num, sep=""), ".png", sep=""))
img <- image_composite(frame6, explosion_img, offset = "+0+15") # Put the explosion frame onto the panel 6 background
if (is.null(explosion_frames)) { # If this is the first explosion frame, create a list of type magick-image
explosion_frames <- c(img)
}
explosion_frames <- c(explosion_frames, img) # Otherwise just add the frame to the list of explosion frames
}
frames <- c(frame1, frame1, frame1, frame1, frame1, frame1, frame1, frame1, frame1, frame1, frame1, frame2, frame2, frame2, frame2, frame2, frame2, frame2, frame2, frame2, frame2, frame2, frame2, frame2, frame3, frame3, frame4, frame4, frame5, frame5, frame6, explosion_frames)
# Duplicating frames with text on them so that you can actually have a chance of being able to read them
image_animate(frames, fps=5) %>%
image_write("my_animated_meme.gif")