knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(Rgram)

This document introduces Rgram and shows how to use the package.

Introduction to Rgram

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:

Data: An image to be called using 'library(imager)' or 'library(png)'

To call/read your input image you need to load two libraries: imager and png.

library(imager)
library(png)

Examples

'greyscale' function

grayscale("https://raw.githubusercontent.com/UBC-MDS/Rgram/master/tests/testthat/test_images/grayscale/sample.jpg") %>% plot()

'rotate' function

rotate("https://raw.githubusercontent.com/UBC-MDS/Rgram/master/tests/testthat/test_images/rotate/sample.jpg", 60) %>% 
  plot()

'padding' function

padding("https://raw.githubusercontent.com/UBC-MDS/Rgram/master/tests/testthat/test_images/padding/sample.jpg", 20) %>% 
  plot()


UBC-MDS/Rgram documentation built on March 30, 2021, 12:02 p.m.