Home

Awesome

<!-- README.md is generated from README.Rmd. Please edit that file -->

ggboy <img src="data-raw/hex.png" align="right" height="160"/>

<!-- badges: start -->

Lifecycle:
experimental

<!-- badges: end -->

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"
<img src="man/figures/README-unnamed-chunk-4-1.png" width="320px" />
ggboy(img)
<img src="man/figures/README-unnamed-chunk-5-1.png" width="320px" />

Modify dithering ‘spread’

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

<img src="man/figures/README-unnamed-chunk-6-1.png" width="320px" /><img src="man/figures/README-unnamed-chunk-6-2.png" width="320px" /><img src="man/figures/README-unnamed-chunk-6-3.png" width="320px" /><img src="man/figures/README-unnamed-chunk-6-4.png" width="320px" />

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

<img src="man/figures/README-unnamed-chunk-7-1.png" width="320px" /><img src="man/figures/README-unnamed-chunk-7-2.png" width="320px" /><img src="man/figures/README-unnamed-chunk-7-3.png" width="320px" /><img src="man/figures/README-unnamed-chunk-7-4.png" width="320px" />

Extension frames

ggboy(
  img = img,
  frame_data = image_to_frame("https://i.imgur.com/lq58kIb.png"))
<img src="man/figures/README-unnamed-chunk-8-1.png" width="320px" />
ggboy(
  img = img,
  frame_data = image_to_frame("https://upload.wikimedia.org/wikipedia/commons/3/3f/Game_Boy_Camera.png"))
<img src="man/figures/README-unnamed-chunk-9-1.png" width="320px" />
ggboy(
  img = img,
  frame_data = image_to_frame("https://channard.files.wordpress.com/2017/05/gb-camera-rahmen-16.jpg"))
<img src="man/figures/README-unnamed-chunk-10-1.png" width="320px" />
ggboy(
  img = img,
  frame_data = image_to_frame("https://i.imgur.com/SxTRr.jpg"))
<img src="man/figures/README-unnamed-chunk-11-1.png" width="320px" />

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")))
<img src="man/figures/README-unnamed-chunk-13-1.png" width="320px" />

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"))
<img src="man/figures/README-gif-1.gif" width="320px" />