knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
This package provides three functions: - sharpen - compress - crop
As the name suggests, we aim to providing some tools for easy image processing. To use this package, follow the installation guide on README and install this package. Then, import the package.
library(rimgtool)
The purpose of this function is to detect and enhance the edges in a grey-scale image using a 2-D convolution. To demonstrate how it works, we first load a image of our respectful program director.
img <- png::readPNG("../img/milad_cropped.png") plot.new() rasterImage(img[, , 1], 0, 0, 0.5, 1)
Then, we pass the image into the sharpen()
function and get an edge-enhanced back. We can compare the two images, and it is obvious that the wrinkles and hair of the photo below have more details.
img2 <- sharpen(img) plot.new() rasterImage(img2, 0, 0, 0.5, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.