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)
#> Loading required package: magrittr
#>
#> Attaching package: 'imager'
#> The following object is masked from 'package:magrittr':
#>
#> add
#> The following object is masked from 'package:Rgram':
#>
#> grayscale
#> The following objects are masked from 'package:stats':
#>
#> convolve, spectrum
#> The following object is masked from 'package:graphics':
#>
#> frame
#> The following object is masked from 'package:base':
#>
#> save.image
library(png)