knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(Rgram)
This document introduces Rgram and shows how to use the package.
Images form a significant part of the data in today's world. Whether you want to enhance your poorly-lit profile picture or analyze satellite images, filters are your best friends.Rgram aims to help you to create four filters for your image:
flipping
: This function can be used to flip the image horizontally in black and white.
greyscale
: This function can be used to convert a color image into a greyscale image.
padding
: This function can be used to add padding to the the borders of an image.
rotate
: This function can be used to rotate an image by the specified number of degrees.
To call/read your input image you need to load two libraries: imager and png.
library(imager) library(png)
grayscale("https://raw.githubusercontent.com/UBC-MDS/Rgram/master/tests/testthat/test_images/grayscale/sample.jpg") %>% plot()
rotate("https://raw.githubusercontent.com/UBC-MDS/Rgram/master/tests/testthat/test_images/rotate/sample.jpg", 60) %>% plot()
padding("https://raw.githubusercontent.com/UBC-MDS/Rgram/master/tests/testthat/test_images/padding/sample.jpg", 20) %>% plot()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.