README.md

ggboy

Lifecycle:
experimental

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.

library(ggboy)
img <- "https://sipi.usc.edu/database/preview/misc/house.png"

ggboy(img)

Modify dithering ‘spread’

purrr::walk(
  .x = c(0, 0.1, 0.2, 0.3), 
  .f = ~print(ggboy(img, dither_spread = .x)))

Modify colour palette

purrr::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)))

Extension frames

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"))

Manual frame text

library(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")))

Animated GIFs

ggboy_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"))



cj-holmes/ggboy documentation built on Sept. 17, 2024, 8:09 a.m.