You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a tonne of breaking changes - nothing will work as
before!
The return image is still a ggplot render, but the
parametrisation is very different
Please log any bugs you find!
Intro
I have always loved the aesthetic feel of David Fincher’s Alien 3
film. From the cavernous, brutal and liminal environments, to the
desolate and isolated nature of the story. In fact, I have always
really loved the aesthetic of the Alien films in general, and more
recently the incredible Alien Isolation game.
At the start of Alien 3, several ‘retro-futuristic’ scanline
portrait images are seen (shown below), and I was keen to see if I
could recreate this scanline style for any given image with R.
This project has been on the back-burner for a long time, but the
rough code I initially wrote years ago has now turned into this
{scanline} package. This package is super niche and is just for
fun.
The default arguments try to replicate the overall feel of the
original scanline images shown above. However, custom parameters can
be chosen to significantly change the look of the output
Not recommended!! - but you absolutely could make your plots
look like they are being viewed on a terminal onboard the Nostromo!
Using the {magick} graphics device to create an image of the plot
which is then passed to scanline()
library(ggplot2)
#> Warning: package 'ggplot2' was built under R version 4.2.2fig<-magick::image_device(1800, 1000, res=450)
diamonds|>
ggplot() +
geom_density(aes(price, after_stat(scaled)), fill="grey70")+
stat_ecdf(aes(price))+
theme_linedraw()+
theme(panel.grid= element_blank())+
labs(
title="Diamond price distribution",
x="Price",
y="Scaled density")
dev.off()
#> png #> 2fig|>magick::image_negate() |> scanline(n_scanlines=160, border_size=0, frame_size=0)