knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
Welcome to BeautyR! This is a small package that will provide image processing capabilities. The package contains three functions. The instructions below will explain the use of these functions.
emboss
This function turns a colorful image into an embossment-type image.
Parameters:
- input_path: character
The file path for the original image we want to emboss.
- output_path: character
The file path to save the embossed image.
Return:
- An embossed image will be saved in output path.
Example:
library(BeautyR) emboss("../img/Google-logo.jpg", "../img/Google-logo_emboss.jpg")
flip
This function flips the images either vertically or horizontally and save it to the output path.
Parameters:
- input_path: character
The file path for the original image we want to flip.
- output_path: character
The file path to save the flipped image.
- direction: character
Direction to flip, "h" or "v", which represents horizontal and vertical respectively.
Return:
- An flipped image file will be saved in output path.
Example:
library(BeautyR) flip("../img/Google.png", "../img/Google_flip_h.png", "h")
get_image_details
This function returns attributes of the input image, such as dimension, width, height and aspect ratio. Users can choose the attributes they want to look at by specifying the names of attributes.
Parameters:
- input_path: character
The file path for the image we want to return information of.
- detail: character
The name of attribute that the function will return. Default set to be 'All'. Available choices are: 'All', 'Dimension', 'Width', 'Height', and 'Aspect Ratio'.
Return:
- A data frame that has the detailed information about input image.
Example:
library(BeautyR) get_image_details("../img/Google.png")
Gilbert Lei
Jielin Yu
Olivia Lin
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.