| ort | R Documentation |
Takes a cimg object and
attempts to create a data frame that, when plotted using the default
plot in base R, looks like the original image.
ort(
img,
bg = 1,
grid_size = function(x) {
1/(250 * (1.0001 - x))
},
grid_offset = function(x) {
sin(x * 100) * 10
}
)
img |
An |
bg |
Background color in case of alpha (default is white) |
grid_size |
Size of grid used for conversion |
grid_offset |
Offset of grid used for conversion |
A data frame with two columns, 'x' and 'y' that hopefully resembles the image when plotted
# Load image using imager
pineapple_img = load.image(system.file("FallingPineapple_16x16.png", package = "ort"))
# Convert to data frame plot
pineapple_ort = ort(pineapple_img)
plot(pineapple_ort)
# Example with alpha background
alph_img = load.image(system.file("alpha_gradient_test.png", package = "ort"))
# default assumes bg = 1 (white background)
alph_ort = ort(alph_img)
plot(alph_ort)
alph_ort_grey = ort(alph_img, bg = 0.5)
plot(alph_ort_grey)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.