ggboy
simulates the retro aesthetic of low resolution ordered image
dithering cameras.
This project is for fun. It creates outputs solely based on artistic merits (what looks good to my eye) My attempt at implementing ordered dithering is not precise. This project is not an exact technical replication of anything
ggboy
is built upon the ggplot2
and magick
R packages for plotting
and image processing.
image_to_frame()
(see
examples below)ggboy_gif()
(see
example below)ggboy
outputs at the
correct size ggboy_save()
library(ggboy)
img <- "https://sipi.usc.edu/database/preview/misc/house.png"
ggboy()
default valuesggboy(img)
dither_spread
purrr::walk(
.x = c(0, 0.1, 0.2, 0.3),
.f = ~print(ggboy(img, dither_spread = .x)))
palette
argumentpurrr::walk(
.x = list(
c("#000000", "#4D4D4D", "#999999", "#E6E6E6"),
c("#000000", "#4D4D4D", "#999999", "#E6E6E6") |> rev(),
c("#405010", "#708028", "#A0A840", "#D0D058"),
c("#0D0887", "#9C179E", "#ED7953", "#F0F921")),
.f = ~print(ggboy(img, palette = .x)))
ggboy
by using any image as a frame with the
image_to_frame()
function (or by creating the frame data yourself)image_to_frame()
will scale and crop the
image firstframe_data
argument of
ggboy()
ggboy(
img = img,
frame_data = image_to_frame("https://i.imgur.com/lq58kIb.png"))
ggboy(
img = img,
frame_data = image_to_frame("https://upload.wikimedia.org/wikipedia/commons/3/3f/Game_Boy_Camera.png"))
ggboy(
img = img,
frame_data = image_to_frame("https://channard.files.wordpress.com/2017/05/gb-camera-rahmen-16.jpg"))
ggboy(
img = img,
frame_data = image_to_frame("https://i.imgur.com/SxTRr.jpg"))
{magick}
package to create a frame
with user-defined textlibrary(magick)
ggboy(
img,
frame_data =
image_to_frame(
image_read(matrix(rep("black", 160*144), ncol = 160)) |>
image_annotate("Your text here", "north", color = "white", size = 15, weight = 700) |>
image_annotate("...AND HERE!", "south", color = "white", size = 13, style = "italic", location = "+0+1")))
ggboy_gif()
functionggboy_gif(
gif = "https://media.tenor.com/l4PitD9s0cEAAAAM/mind-blown.gif",
scale = 2,
first_n = 50,
fps = 10,
frame_data = image_to_frame("https://upload.wikimedia.org/wikipedia/commons/3/3f/Game_Boy_Camera.png"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.